Sei sulla pagina 1di 28

Technical Memo

Copyright 2009

Information Builders Two Penn Plaza New York, NY 10121-2898 (212) 736-4433

WebFOCUS Version 7 Release 6.9 and Higher September 2009

TM4678

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF
This technical memo describes how to generate Enable dashboards (.SWF file extension) on the WebFOCUS Reporting Server and how to insert Enable dashboards into PDF documents.

WebFOCUS Enable Integration With the Reporting Server


Syntax: How to Generate Enable Dashboards in WebFOCUS
In WebFOCUS Release 7 Version 6.9, a new SET option allows you to include the Flex Builder source .MXML contents using the -HTMLFORM command in the procedure and generate Enable dashboards (SWF files) on the WebFOCUS Reporting Server. You can generate and distribute portable Enable dashboards that are updated with the latest data and run in a disconnected environment by using the following code in WebFOCUS procedures:
SET HTMLFORMTYPE=FLEX

Note: This feature is available in code only in WebFOCUS Release 7 Version 6.9 procedures.

Setting Up Sample Enable Dashboards


To set up the sample WebFOCUS Enable for Adobe Flex dashboard, you must have Adobe Flex Builder with the WebFOCUS Enable engine.

Procedure: How to Set Up the Sample Dashboards


1. Create a Flex project, following the steps in WebFOCUS Enable For Adobe Flex User's Guide. 2. Name the project EnableTest. 3. Place the application files for the project in c:/ibi/apps/flexinpdf/.

DN4500969.0909

WebFOCUS Enable Integration With the Reporting Server 4. If the hold.xml file name is specified as the data XML file in the Enable dashboard, it uses the default HOLD file location in WebFOCUS, as shown in the following code.
[Embed(source="hold.xml",mimeType="application/octet-stream")]

5. If the data XML file name or file location is different from the default HOLD file name or location, specify a fully qualified file name with the path in the Enable dashboard source code, as shown in the following code.
[Embed(source="C:/ibi/apps/flexinpdf/enable.xml",mimeType="application/octet-stream")]

Integrating With the Reporting Server


To set up WebFOCUS Enable for Adobe Flex integration with the Reporting Server, you must have a supported version of WebFOCUS Version 7 Release 6.9 or higher. Note: In order to view an Enable dashboard in the browser, Adobe Flash Player 9.0.28 or higher is required.

Procedure: How to Run and Display the Enable Dashboard in the Web Browser
1. Open Developer Studio. 2. Create a project directory. Note: We will use the sample data (ggsales.mas) that comes with the WebFOCUS installation. You may copy this source file to the project directory of your choice. 3. Create a new procedure using the following WebFOCUS syntax.
FILEDEF FLEXTEST DISK c:/ibi/apps/flexinpdf/EnableTest.mxml SET HTMLFORMTYPE=FLEX TABLE FILE GGSALES PRINT REGION ST CITY CATEGORY PRODUCT DOLLARS UNITS COMPUTE COGS/D12.2CM = DOLLARS * .75; ON TABLE HOLD FORMAT XML END -HTMLFORM FLEXTEST

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF 4. You can also call the external MXML file using the following WebFOCUS syntax.
FILEDEF FLEXTEST DISK c:/ibi/apps/flexinpdf/EnableTest.mxml SET HTMLFORMTYPE=FLEX TABLE FILE GGSALES PRINT REGION ST CITY CATEGORY PRODUCT DOLLARS UNITS COMPUTE COGS/D12.2CM = DOLLARS * .75; ON TABLE HOLD FORMAT XML END -HTMLFORM BEGIN !IBI.FIL.FLEXTEST; -HTMLFORM END

DN4500969.0909

WebFOCUS Enable Integration With the Reporting Server

Procedure: How to Embed Data Saved in Non-default HOLD File Locations


1. Create a new procedure using the following WebFOCUS syntax.
FILEDEF FLEXTEST DISK c:/ibi/apps/flexinpdf/EnableTest.mxml FILEDEF FLEXOUT DISK c:/ibi/apps/flexinpdf/enable.swf FILEDEF FLEXDATA DISK c:/ibi/apps/flexinpdf/enable.xml SET HTMLFORMTYPE=FLEX TABLE FILE GGSALES PRINT REGION ST CITY CATEGORY PRODUCT DOLLARS UNITS COMPUTE COGS/D12.2CM = DOLLARS * .75; ON TABLE HOLD AS FLEXDATA FORMAT XML END -HTMLFORM BEGIN SAVE AS FLEXOUT !IBI.FIL.FLEXTEST; -HTMLFORM END

Note: This procedure also saves the generated SWF file on the local drive.

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

Reference: WebFOCUS Enable Requirements


All the images and other assets referenced in the Enable dashboard have to exist either on the local file system in which the SWF file runs or on a remote resource in which the SWF file can access via an HTTP request so they can be loaded at run time. You can also embed these files at compile time by using @Embed(source='filename') so these resources are included in the SWF file as a part of your application. In order to compile your application with the @Embed option, these images and resource files have to reside in the application path that the WebFOCUS Reporting Server has access to. For more information on embedding application assets into your Adobe Flex applications, please refer to the Adobe documentation. In order to use this feature, simply copy the WebFOCUS Enable engine .SWC file into the \home\etc\flex\frameworks\libs folder of the WebFOCUS Reporting Server. A valid license for Flex Builder 3 Professional is required to compile Enable dashboards with charts and other data visualization components. If Flex Builder 3 Professional is already installed on your machine in the same location as your WebFOCUS Reporting Server, it automatically looks for the license in the license.properties file in the Adobe Flex application data folder. If you have a valid Flex Builder 3 Professional license but Flex Builder is not installed on the same machine where the WebFOCUS Reporting Server is installed, you can enter the 24-digit Flex Builder license number in the licenses section of the flex-config.xml file, along with the Flex product name in lower case, as "flexbuilder3", found in the \ibi\srv76\home\etc\flex\frameworks folder. Make sure the licenses section of the flexconfig.xml file is not commented out. Save the flex-config.xml file and run the procedure. Enable dashboards need to be designed to have XML data embedded inside the application.

Electronic Publishing with Interactive Analytics


With WebFOCUS Enable integrated on WebFOCUS Reporting Server Release 7 Version 6.9 as described above, users are able to generate Enable dashboards on WebFOCUS Reporting Server and insert them into PDF reports to be distributed and offer interactive analysis in the disconnected environment.

Syntax:

How to Insert Enable Dashboards into PDF Reports


In WebFOCUS Release 7 Version 6.9, a new IMAGE-FORMAT option allows you to publish PDF reports with Enable dashboards. You can insert a SWF as an IMAGE inside a PDF report procedure using the following WebFOCUS syntax.
IMAGE=filename.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF

DN4500969.0909

Electronic Publishing with Interactive Analytics where:


filename.swf

Is the source SWF file you want to embed directly into the PDF. Note: When inserting multiple SWF files using IMAGE-FORMAT=SWF syntax, it is recommended that you create a separate HEADING LINE or HEADING ITEM as a place holder for each SWF file to be inserted.

Publishing With Interactive Analytics


To set up WebFOCUS Enable for Adobe Flex integration with the Reporting Server, you must have a supported version of WebFOCUS Version 7 Release 6.9 or higher. Note: Adobe Reader 9 or higher is required so the Flash run-time code included in the Reader can render the Flash content.

Reference: Enable Dashboard Requirements For an Interactive PDF


To set up the sample WebFOCUS Enable for Adobe Flex dashboard, you must have Adobe Flex Builder with the WebFOCUS Enable engine. It is recommended that all of the images and other assets referenced in the Enable dashboard are embedded at compile time in the SWF file as a part of your application by using @Embed(source='filename') so these resources are available inside the PDF document. In order to compile your application with the @Embed option, these images and resource files have to reside in the application path that the WebFOCUS Reporting Server has access to. For more information on embedding application assets into your Adobe Flex applications, please refer to the Adobe documentation. In the <mx:Application> tag in your Flex application, make sure to set the following: The application width and height needs to be set to a fixed size. (For example, width="1024" height="768 or width="800" height="600") The following sets the Flex application to be scalable within PDF document.
applicationComplete="stage.scaleMode = StageScaleMode.EXACT_FIT;"

Procedure: How to Insert a Pre-built SWF File Into a PDF Report


1. Open Developer Studio. 2. Create a project directory. Note: The example data source (ggsales.mas) is available from the Master Files folder in the CENTURY project of WebFOCUS. You may copy this source file to the project directory of your choice.

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF 3. Create a new procedure using the following WebFOCUS syntax.
TABLE FILE GGSALES " . " SUM REGION NOPRINT ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * UNITS=POINTS, $ TYPE=REPORT, ORIENTATION=LANDSCAPE, FONT=TIMES, SIZE=12, $ TYPE=HEADING, OBJECT=TEXT, ITEM=1, LINE=1, COLOR=WHITE, IMAGE=enable.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF, POSITION=(10 10), DIMENSION=(780 580), BORDER=LIGHT, BORDER-COLOR=WHITE, $ END

Note: Enable.swf is a pre-built SWF file, and the position and dimensions need to be specified, as shown in the following example.
TYPE=HEADING, OBJECT=TEXT, ITEM=1, LINE=1, COLOR=WHITE, IMAGE=enable.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF, POSITION=(10 10), DIMENSION=(780 580),

Procedure: How to Insert Multiple Pre-built Files Into a PDF Report


In the code sample below, the first HEADING syntax in the style sheet applies to the word "HELLO" so "HELLO" appears in red, the second HEADING syntax applies to the word "WORLD" so "WORLD" appears in blue, then the third HEADING style sheet is for the place holder created using the "." character in the HEADING to insert the SWF01.swf file, and the is for the place holder created using the "." character in the HEADING to insert the SWF02.swf file, then, on a new line, the "." placeholder is used to insert the SWF03.swf file. 1. Create a new procedure using the following WebFOCUS syntax.
TABLE FILE GGSALES SUM REGION NOPRINT HEADING "HELLO<+0>WORLD<+0> . <+0> . " " . " ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE HOLD FORMAT PDF ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=POINTS, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9, $

DN4500969.0909

Electronic Publishing with Interactive Analytics

TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=1, SIZE=10, COLOR=RED, $ TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=2, SIZE=14, COLOR=BLUE, $ TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=3, COLOR=WHITE, IMAGE=SWF01.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF, POSITION=(54 330), DIMENSION=(216 288), $ TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=4, COLOR=WHITE, IMAGE=SWF02.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF, POSITION=(350 10), DIMENSION=(216 288), $ TYPE=HEADING, LINE=2, OBJECT=TEXT, ITEM=1, COLOR=WHITE, IMAGE=SWF03.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF, POSITION=(300 330), DIMENSION=(200 200), $ ENDSTYLE END

Procedure: How to Generate and Insert a Portable Enable Dashboard Into a PDF Report
1. Create a new procedure using the following WebFOCUS syntax. Note: You need to generate a SWF first, then insert it into the PDF.
FILEDEF FLEXTEST DISK c:/ibi/apps/flexinpdf/EnableTest.mxml FILEDEF FLEXOUT DISK c:/ibi/apps/flexinpdf/enable.swf FILEDEF FLEXDATA DISK c:/ibi/apps/flexinpdf/enable.xml SET HTMLFORMTYPE=FLEX TABLE FILE GGSALES PRINT REGION ST CITY CATEGORY PRODUCT DOLLARS UNITS COMPUTE COGS/D12.2CM = DOLLARS * .75; ON TABLE HOLD AS FLEXDATA FORMAT XML END

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

-HTMLFORM BEGIN SAVE AS FLEXOUT !IBI.FIL.FLEXTEST; -HTMLFORM END FILEDEF HOLD DISK C:\ibi\apps\flexinpdf\enablepdf.pdf TABLE FILE GGSALES " . " SUM REGION NOPRINT ON TABLE HOLD FORMAT PDF ON TABLE SET STYLE * UNITS=POINTS, $ TYPE=REPORT, ORIENTATION=LANDSCAPE, FONT=TIMES, SIZE=12, $ TYPE=HEADING, OBJECT=TEXT, ITEM=1, LINE=1, COLOR=WHITE, IMAGE=enable.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF, POSITION=(10 10), DIMENSION=(780 580), BORDER=LIGHT, BORDER-COLOR=WHITE, $ END

You will be able to print the interactivity as well as the changes made to the reports or dashboards from Adobe Reader.

DN4500969.0909

Electronic Publishing with Interactive Analytics

Reference: Add Borders Around SWF Files in a PDF Report


Starting WebFOCUS Release 7.6.10, you can add or remove borders around SWF files inserted in PDF reports. In 7.6.9, the default behavior is thin black solid borders around SWF files and you cannot change this behavior. In 7.6.10, the default behavior is no borders around SWF files and you can change it to add or remove thin or thick black solid borders using the following syntax.
FLEX-BORDER=<n>

where:
<n>

Is the numeric width value for the black solid line border around SWF files. Note: This border is generated by Adobe and not by WebFOCUS so no other options will be available in this setting.

Example:

No Flex Border
Setting FLEX-BORDER to 0 is the same as not setting FLEX-BORDER at all, it results in the default behavior no border around the SWF file. Inserting the following syntax:
FLEX-BORDER=0

will result in a SWF file with no border, as shown in the following image.

10

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

Example:

Thin Flex Border


Setting FLEX-BORDER to 1 results in a thin border around the SWF file. Inserting the following syntax:
FLEX-BORDER=1

will result in a SWF file with a thin border, as shown in the following image.

Example:

Thick Flex Border


Setting FLEX-BORDER to 5 will result in a thick border around the SWF file. Inserting the following syntax:
FLEX-BORDER=5

DN4500969.0909

11

Electronic Publishing with Interactive Analytics will result in a SWF file with a thick border, as shown in the following image.

Note: Inserting a FLEX-BORDER with values between 1 and 5 will result in a border around the SWF ranging from very thin (1) to very thick (5).

Procedure: How to Generate and Insert Multiple Enable Dashboards and Combine Reports in a Compound PDF Document
Starting with WebFOCUS Version 7 Release 6.10, you can generate and insert multiple Enable Dashboards and combine them with WebFOCUS Reports to create a compound PDF document. Note: The procedure uses both GGSALES and CENTURYSALES data that are included in the WebFOCUS installation. The report2 and report3 components in this procedure are WebFOCUS Reports. The report1 and report4 components in this procedure are WebFOCUS Enable Dashboards. The Enable Dashboard examples, SalesDashRed.mxml and CenturyIBICharts.mxml, in this procedure are already created using WebFOCUS Enable for Adobe Flex. For more information on how to create these Dashboards, please refer to WebFOCUS Enable for Adobe Flex Users Guide.

12

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF The position of SWF file in each PDF report is relative to the top left corner of the COMPONENT position in the PDF document. For example, the position for report1 in the PDF document is defined as 0.01 inches from the Left side of the page and 0.25 inches from the Top of the page as below:
COMPONENT='report1', TEXT='report1', TOC-LEVEL=2, POSITION=(0.01 0.25), DIMENSION=(8 6), METADATA='Z-INDEX: 100; LEFT: 0.01in; OVERFLOW: auto; WIDTH: 8in; POSITION: absolute; TOP: 0.25in; HEIGHT: 6in', $

The position of this SWF file in the PDF report is also defined as 0.25 inches from the Left and 0.25 inches from the Top as below (in bold):
TYPE=HEADING, OBJECT=TEXT, ITEM=1, LINE=1, COLOR=WHITE, IMAGE=SalesDashRed.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF,POSITION=(0.25 0.25), DIMENSION=(8 6), $

Therefore the real position of this Enable Dashboard in the first page in this PDF document becomes 0.26 inches from the Left side of the page and 0.5 inches from the Top of the page. 1. Create a new procedure using the following WebFOCUS syntax.
FILEDEF FLEXTEST DISK c:/ibi/apps/flexinpdf/SalesDashRed.mxml FILEDEF FLEXOUT DISK c:/ibi/apps/flexinpdf/SalesDashRed.swf FILEDEF FLEXDATA DISK c:/ibi/apps/flexinpdf/SalesDashRed.xml -* FILEDEF FLEXCHAR DISK C:/ibi/apps/flexinpdf/CenturyIBICharts.mxml FILEDEF FLEXFILE DISK c:/ibi/apps/flexinpdf/CenturyIBICharts.swf FILEDEF FLEXCENT DISK c:/ibi/apps/flexinpdf/CenturyIBICharts.xml -* SET HTMLFORMTYPE=FLEX -* TABLE FILE GGSALES PRINT REGION ST CITY CATEGORY PRODUCT COMPUTE DOL2/D12.2CM = DOLLARS; AS 'Total Sales' UNITS COMPUTE COGS/D12.2CM = DOLLARS * .75; ON TABLE HOLD AS FLEXDATA FORMAT XML END -*

DN4500969.0909

13

Electronic Publishing with Interactive Analytics

DEFINE FILE CENTURYSALES MONTHNAME/A20=IF MONTH EQ '01' THEN 'January' ELSE IF MONTH EQ '02' THEN 'February' ELSE IF MONTH EQ '03' THEN 'March' ELSE IF MONTH EQ '04' THEN 'April' ELSE IF MONTH EQ '05' THEN 'May' ELSE IF MONTH EQ '06' THEN 'June' ELSE IF MONTH EQ '07' THEN 'July' ELSE IF MONTH EQ '08' THEN 'August' ELSE IF MONTH EQ '09' THEN 'September' ELSE IF MONTH EQ '10' THEN 'October' ELSE IF MONTH EQ '11' THEN 'November' ELSE IF MONTH EQ '12' THEN 'December' ; END TABLE FILE CENTURYSALES SUM QUANTITY COSTOFGOODSSOLD PROFIT BY YEAR BY QUARTER BY MONTH BY MONTHNAME BY PLANTREGION BY STATE BY CITY BY STORENAME BY PRODUCTTYPE BY PRODUCTCATEGORY WHERE ( COUNTRY EQ 'United States' ) AND ( REGION NE 'Web(R)' ) AND ( POSTALCODE NE '065208332' OR '672033296' OR '941033185' ); ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE HOLD AS FLEXCENT FORMAT XML ON TABLE SET HTMLCSS ON END -*

14

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

-HTMLFORM BEGIN SAVE AS FLEXOUT !IBI.FIL.FLEXTEST; -HTMLFORM END -* -HTMLFORM BEGIN SAVE AS FLEXFILE !IBI.FIL.FLEXCHAR; -HTMLFORM END -* COMPOUND LAYOUT PCHOLD FORMAT PDF UNITS=IN, $ SECTION=section1, LAYOUT=ON, METADATA='0.5^0.5^0.5^0.5', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=Letter, $ PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $ COMPONENT='report1', TEXT='report1', TOC-LEVEL=2, POSITION=(0.01 0.25), DIMENSION=(8 6), METADATA='Z-INDEX: 100; LEFT: 0.01in; OVERFLOW: auto; WIDTH: 8in; POSITION: absolute; TOP: 0.25in; HEIGHT: 6in', $ COMPONENT='report2', TEXT='report2', TOC-LEVEL=2, POSITION=(0.5 6.4), DIMENSION=(8 6), METADATA='Z-INDEX: 100; LEFT: 0.5in; OVERFLOW: auto; WIDTH: 8in; POSITION: absolute; TOP: 6.4in; HEIGHT: 6in', $ PAGELAYOUT=2, NAME='Page layout 2', text='Page layout 2', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $ COMPONENT='report3', TEXT='report3', TOC-LEVEL=2, POSITION=(0.5 0.5), DIMENSION=(8 2.5), METADATA='Z-INDEX: 100; LEFT: 0.5in; OVERFLOW: auto; WIDTH: 8in; POSITION: absolute; TOP: 0.5in; HEIGHT: 2.5in', $ COMPONENT='report4', TEXT='report4', TOC-LEVEL=2, POSITION=(0.01 3), DIMENSION=(8 6), METADATA='Z-INDEX: 100; LEFT: 0.01in; OVERFLOW: auto; WIDTH: 8in; POSITION: absolute; TOP: 3in; HEIGHT: 6in', $ END -*

DN4500969.0909

15

Electronic Publishing with Interactive Analytics

SET COMPONENT='report1' TABLE FILE GGSALES SUM REGION NOPRINT HEADING "." ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=HEADING, OBJECT=TEXT, ITEM=1, LINE=1, COLOR=WHITE, IMAGE=SalesDashRed.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF, POSITION=(0.25 0.25), DIMENSION=(8 6), $ ENDSTYLE END -* SET COMPONENT='report2' TABLE FILE GGSALES SUM DOLLARS UNITS BY REGION BY ST BY CITY HEADING "Regional Sales Report" ""

16

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9, $ TYPE=DATA, SIZE=9, BACKCOLOR=( RGB(238 238 238) 'WHITE' ), $ TYPE=TITLE, SIZE=10, STYLE=BOLD, COLOR='WHITE', BACKCOLOR=RGB(153 0 0), $ TYPE=HEADING, SIZE=12, STYLE=BOLD, $ ENDSTYLE END -*

DN4500969.0909

17

Electronic Publishing with Interactive Analytics

SET COMPONENT='report3' TABLE FILE CENTURYSALES SUM COSTOFGOODSSOLD PROFIT BY PRODUCTTYPE HEADING "Century Product Report" "" ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9, $ TYPE=DATA, SIZE=9, BACKCOLOR=( RGB(238 238 238) 'WHITE' ), $ TYPE=TITLE, SIZE=10, STYLE=BOLD, COLOR='WHITE', BACKCOLOR=RGB(153 0 0), $ TYPE=HEADING, SIZE=12, STYLE=BOLD, $ ENDSTYLE END -*

18

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

SET COMPONENT='report4' TABLE FILE CENTURYSALES SUM REGION NOPRINT HEADING "." ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=HEADING, OBJECT=TEXT, ITEM=1, LINE=1, COLOR=WHITE, IMAGE=CenturyIBICharts.swf, IMAGE-TYPE=FILE, IMAGE-FORMAT=SWF, POSITION=(0.25 0.25), DIMENSION=(8 6), FLEX-BORDER=1, $ ENDSTYLE END -* COMPOUND END

DN4500969.0909

19

Electronic Publishing with Interactive Analytics

Reference: Sample Enable Document


The following is the source code from the sample Enable document used throughout this Technical Memo.
<?xml version="1.0" encoding="utf-8"?> <mx:Application creationComplete="init()" backgroundColor="#FFFFFF" applicationComplete="stage.scaleMode = StageScaleMode.EXACT_FIT;" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ibi="http://www.informationbuilders.com" width="1024" height="768" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]"> <ibi:ibiCanvas x="10" y="10" width="1004" height="748" id="porterCanvas">

20

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

<ibi:ibiDataGrid x="10" y="10" height="400" width="600" id="MAIN01" visible="false"> <ibi:seturl>internal</ibi:seturl> </ibi:ibiDataGrid> <mx:Label x="10" y="10" text="Sales Performance Dashboard" width="282" height="25" fontSize="16" fontThickness="5" fontWeight="bold"/> <mx:Panel x="10" y="43" width="135" height="200" layout="absolute" title="Select Region"> <ibi:ibiList x="10" y="10" width="95" height="140" id="list1" ibiParent="MAIN01" ibiFilterAble="true" ibiColumn="REGION" ibiFilterCond="EQ" > </ibi:ibiList> </mx:Panel> <mx:Panel x="153" y="43" width="139" height="200" layout="absolute" title="Select State"> <ibi:ibiList x="10" y="10" height="140" width="99" id="list2" ibiFilterAble="true" ibiColumn="ST" ibiFilterCond="EQ" ibiFilterParent="list1" ibiParent="MAIN01"> </ibi:ibiList> </mx:Panel> <mx:Panel x="300" y="43" width="694" height="200" layout="absolute" title="Regional Detail Transactions"> <ibi:ibiDataGrid right="10" left="10" top="8" bottom="10" ibiParent="MAIN01" ibiFilterParent="list2" ibiUseColumns="REGION,CITY,ST,CATEGORY,PRODUCT,DOLLARS AS Total Sales" ibiFilterAble="true"> <ibi:ibiColumnStyle>

DN4500969.0909

21

Electronic Publishing with Interactive Analytics

<![CDATA[ { width: 15; },{ width: 20; },{ width: 10; },{ width: 20; },{ width: 20; },{ width: 20; } ]]> </ibi:ibiColumnStyle> </ibi:ibiDataGrid> </mx:Panel> <ibi:ibiDataGrid x="10" y="251" width="200" id="colChartData" ibiFilterAble="true" ibiGroupBy="ST" ibiParent="MAIN01" ibiUseColumns="ST,Sum.DOLLARS,Sum.UNITS,Sum.COGS" ibiUseFiltered="true" visible="false"/> <mx:Panel x="10" y="251" width="526" height="404" layout="absolute" title="Sales by State"> <ibi:ibiColumnChart x="10" y="10" height="344" ibiParent="colChartData" ibiGroupBy="ST" ibiUseFiltered="true" ibiXField="ST" ibiYField="Sum.DOLLARS,Sum.UNITS,Sum.COGS" showDataTips="true" dataTipFunction="colFunc" width="486"> <ibi:ibiColumnStyle> <![CDATA[ { showDataEffect: int; fillAlphas: 1, 1, 1, 1,1; fillRatios: 0,.2,.4,.75,1; fillColors: #191970, #2E2ECF, #8B8BE5, #2E2ECF, #191970; fillAngle: 0; },

22

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

{ showDataEffect: zoom; fillAlphas: 1, 1, 1, 1,1; fillRatios: 0,.2,.4,.75,1; fillColors: #6666FF, #9090FF, #BBBBFF, #9090FF, #6666FF; fillAngle: 0; }, { showDataEffect: slide; fillAlphas: 1, 1, 1, 1,1; fillRatios: 0,.2,.4,.75,1; fillColors: #3232CD, #7070DC, #ADADEB, #7070DC, #3232CD; fillAngle: 0; } ]]> </ibi:ibiColumnStyle> </ibi:ibiColumnChart> </mx:Panel> <ibi:ibiDataGrid id="pieChartData" ibiParent="MAIN01" ibiUseColumns="PRODUCT,Sum.DOLLARS" ibiGroupBy="PRODUCT" visible="false" ibiUseFiltered="true" x="430" y="251" width="200"/> <mx:Panel x="544" y="251" width="450" height="404" layout="absolute" title="Sales by Product"> <ibi:ibiPieChart x="10" y="10" width="410" height="252" ibiParent="pieChartData" ibiField="Sum.DOLLARS" ibiNameField="PRODUCT" showDataTips="true" id="explodePieChart">

DN4500969.0909

23

Electronic Publishing with Interactive Analytics

<b:rainopeeepoeiCatadvnLsee(hrIeEetIE_LC,iCik;/b:rainopee iicetoCmlt>xldPehr.dEetitnrCattmvn.TMCIKpelc)<iicetoCmlt> <ibi:ibiPieStyle> <![CDATA[{ [ fillType: Radial; fillColors: #191970,#8B8BE5,#191970,#8B8BE5,#191970; fillRatios: 0,.2,.4,.7,1; labelPosition: callout; showDataEffect: int; labelFunction: pieSeries_labelFunc; ],[ fillType: Radial; fillColors: #6666FF,#9090FF,#6666FF,#9090FF,#6666FF; fillRatios: 0,.2,.4,.7,1; labelPosition: callout; showDataEffect: int; labelFunction: pieSeries_labelFunc; ],[ fillType: Radial; fillColors: #483D8B,#B2ABDA,#483D8B,#B2ABDA,#483D8B; fillRatios: 0,.2,.4,.7,1; labelPosition: callout; showDataEffect: int; labelFunction: pieSeries_labelFunc; ],[ fillType: Radial; fillColors: #2657b5,#87a2d5,#1247ae,#6494ef,#1b4694; fillRatios: 0,.2,.4,.7,1; labelPosition: callout; showDataEffect: int; labelFunction: pieSeries_labelFunc; ],[ fillType: Radial; fillColors: #8470FF,#C7BEFF,#8470FF,#C7BEFF,#8470FF; fillRatios: 0,.2,.4,.7,1; labelPosition: callout; showDataEffect: int; labelFunction: pieSeries_labelFunc; ],[

24

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

fillType: Radial; fillColors: #00BFFF,#99E5FF,#00BFFF,#99E5FF,#00BFFF; fillRatios: 0,.2,.4,.7,1; labelPosition: callout; showDataEffect: int; labelFunction: pieSeries_labelFunc; ] }]]> </ibi:ibiPieStyle> </ibi:ibiPieChart> <ibi:ibiLegend x="10" y="270" width="410" height="84" ibiParent="explodePieChart"></ibi:ibiLegend> </mx:Panel> </ibi:ibiCanvas> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.charts.events.ChartItemEvent; import mx.charts.HitData; public var index:Number = -1; public var explodeData:Array = []; public var pieSlice:String = ""; private var lastClicked:Number = -1; //keep track of last clicked pie slice public function colFunc(h:HitData):String { var retcols:String; retcols = "State: " + h.item.ST + "\n<B>" + "Total Sales: " + cf.format(h.item["Sum.DOLLARS"]) + "</B>" + "\n"+ "Units Sold: " + h.item["Sum.UNITS"] + "\n"+ "Total COGS: " + cf.format(h.item["Sum.COGS"]); return retcols; } protected function currencyFormat(value:Object, arg2:Object, arg3:Object):String { return cf.format(value); } public function pieClick(e:ChartItemEvent):void { pieSlice = e.hitData.item.PRODUCT; index = -1; explodeData = [];

DN4500969.0909

25

Electronic Publishing with Interactive Analytics

for (var i:Number=0; i < pieChartData.dataProvider.length && index == -1; i++){ if(pieChartData.dataProvider[i].PRODUCT == pieSlice){ index = i; } } //determine what pie slice is being clicked - close if already open if(index == lastClicked){ explodeData[index] = 0; lastClicked = -1; }else{ explodeData[index] = 0.15; //explodePieChart.series[0].reserveExplodeRadius; lastClicked = index; } explodePieChart.series[0].reserveExplodeRadius = 0.15; explodePieChart.series[0].perWedgeExplodeRadius = explodeData; } ]]> </mx:Script> <mx:Style> DataGrid { backgroundAlpha: 1; headerColors: #191970, #ffffff; horizontalGridLines: true; horizontalGridLineColor: #ffcc00; verticalGridLines: false; verticalGridLineColor: #642d2d; rollOverColor: #22316C; textRollOverColor: #ffffff; headerStyleName: "mydataGridHeaderStyle"; } .mydataGridHeaderStyle { color: #ffffff; } </mx:Style> <mx:SeriesSlide id="slide" duration="1000"/> <mx:Zoom id="zoom" duration="1000"/> <mx:SeriesInterpolate id="int" duration="1000" elementOffset="10" /> <mx:SeriesSlide id="pieEffect" duration="1000"/> <mx:CurrencyFormatter id="cf" currencySymbol="$" /> <mx:Zoom id="piezoom" duration="1000"/>

26

WebFOCUS

WebFOCUS Enable for Adobe Flex Integration For Creating an Interactive PDF

<mx:Script> <![CDATA[ [Embed(source="C:/ibi/apps/flexinpdf/enable.xml",mimeType="application/octet-stream")] public static const XMLFILE:Class; public static const embededXML:XML = setConst(); private static function setConst():XML{ var ba:ByteArray = new XMLFILE() as ByteArray; return new XML(ba.readUTFBytes(ba.length)); } private function init():void { MAIN01.iArray.myXML = embededXML; } ]]> </mx:Script> </mx:Application>

DN4500969.0909

27

Electronic Publishing with Interactive Analytics

28

WebFOCUS

Potrebbero piacerti anche