You are on page 1of 10

Open Data Access Framework: Flat File Example ---------------------------------------------A.

Introduction

The Flat File Example is a demonstration of Open Data Access driver and its usage with Actuate eReport Designer and the Factory. B. Directory layout

The Flat File Example directory has the following structure: 1) "config" directory. odaconfig.xml This XML is required by eRD Pro to collect information about this ODA driver. The attributes specify driver name, designer and runtime specific properties, library names, jar locations, etc. AcOdaFlatFileExample.rol This ROL consists of both the connection and data source components used in this example. These components should be used to create your own by appropriate subclassing. CSVSource.txt Actual data source file used by this example. The file contents are a comma separated list of values. The first line of the text file is meta data information. All following lines reflect actual data. 2) "src" directory. This directory contains all the source code and required libraries for building and runnning the Actuate ODA designtime and runtime jar files. The build.bat file is a simple batch program for building the AcOdaFlatFileExampleDesigner.jar and AcOdaFlatFileExampleRuntime.jar. They require JDK 1.3.1 or higher to build. The "com" sub-folder consists of all the source code (java files.) The "jar" sub-folder contains the following files: AcOdaInterfaces.jar PullParser_SMALL.jar This directory contains the following files:

0). AcOdaFlatFileExampleDesigner. Put the following files under "oda/AcOdaFlatFileExampleDriver": odaconfig.3. The PullParser_SMALL. C. This directory contains the Actuate ODA design-time and runtime jar files.The Flat File Example jar files require the support of JRE 1. . it is recommended that user specifies the full path instead of relative path for the executable (in this case.jar AcOdaInterfaces. also shipped with this example.jar PullParser_SMALL. <Actuate> indicates current release installation top-level folder such as Actuate7 on Windows. The contents of this jar file are a set of Java classes.jar and eRD Pro to extract data/information. The example needs a subfolder "AcOdaFlatFileExampleDriver" under the "oda" folder.Check the arguments in the <Arguments> section of the <DesignTimeInterface> section in the odaconfig. The AcOdaDrivers.jar.The AcOdaInterfaces. AcOdaFlatFileExampleRuntime.txt AcOdaFlatFileExampleDesigner. use double quotes to enclose each individual argument.To avoid ambiguity.jar A Java archive consists of the relevant classes used to bring up builder user interface.xml AcOdaFlatFileExample. . . This will avoid parse problems.jar.jar provides the classes supporting Actuate's ODA interfaces. Installing the Flat File Example design time and runtime files on Windows.rol CSVSource. This archive is used both by AcDesigner. If the path names have spaces within them.jar A few tips that may help debug development and deployment problems: . also shipped with this example. To install the Flat File Example so that it runs with the eReport Designer.jar is required by AcOdaFlatFileExampleRuntime.1 or higher (except 1. 3) "lib" directory.4. a new folder "oda" under top-level installation folder <Actuate> will be created if it does not exist. The contents of this jar file are a set of Java classes.jar A Java archive implementing the runtime ODA interfaces.jar AcOdaFlatFileExampleRuntime.jar file is required by the AcOdaFlatFileExampleDesigner.xml file carefully to make sure the path names are correct.

5.Put "runDesigner.javaw. Change the executable name from "javaw.bat" as the command in the <Executable> section of the <DesignTimeInterface> section in the odaconfig. The directories that are listed in the PATH environment variable. The 32-bit Windows system directory (System32).After eReport Designer launches the Flat File Example application. If the Flat File Example application encounters any runtime error and hangs.exe".To debug any problems of the Flat File Example application: . AC_SERVER_HOME usually points to the "/. The Windows directory.txt AcOdaFlatFileExampleRuntime. The current directory accessed within eReport Designer.exe" to "java.bat" in the "oda/AcOdaFlatFileExampleDriver" folder./AcServer" directory. The 16-bit Windows system directory (System).rol CSVSource.jar PullParser_SMALL.exe) in the <Executable> field in the odaconfig. the subdirectory "oda/AcOdaFlatFileExampleDriver": needs to be created in the AC_SERVER_HOME directory on Unix. 2. D./. .xml file. .Create a batch file "runDesigner.bat" file.xml file..jar . If the path is relative. Place the entire java command into the batch file. 6.jar AcOdaInterfaces. The directory from which eReport Designer loaded. At this point.xml AcOdaFlatFileExample. since arguments are no longer required. it will wait in a modal state.. . . user can kill the Flat File Example application in the Task Manager.Within the "runDesigner. the eReport Designer application will be suspended. 3. Set the <Arguments> section empty. Append the string "%1 %2" to the end of the command. Installing the Flat File Example runtime files on Unix On Unix. This will cause any java errors to be displayed in a console window. the executable file will be searched according to the following sequence of paths: 1. The following files need to be copied there: odaconfig. This will free up the eReport Designer and return control to it. 4.

or if you need to run a variety of different reports. It can be easier for users to find the data they want by navigating a set of folders in the Encyclopedia volume than to move through a single large report. The report bursts on group boundaries. The bursting report also can create any number of detail reports. The report is based on a report/subreport structure. The key tasks to perform to create a report with bursting include: . Report bursting allows you to create a single report object executable (ROX) file that produces any number of report object instance (ROI) files. A driver report is one that uses the Actuate Requester API to run other reports on Actuate iServer. A driver report is a good choice if you want to make full use of machines with multiple CPUs. The master report is the one represented by the AcReport subclass (often called NewReportApp) that appears at the top of the Report Structure. Reasons for creating multiple ROI files include: * Security. The bursting technique presented here is just one way to achieve bursting. You can use various techniques to create the detail reports: * * * The master report contains a sequential section that lists the detail reports one-by-one. These techniques are intended for intermediate to advanced developers. * Organization. The reports might all need to use the same query and that query might be expensive to run. The bursting technique presented here works best if you need to create a single master report and any number of identical detail reports. This is the report that appears in the request completion notification when the report runs on Actuate iServer.EXAMPLE REPORTS WITH BURSTING BACKGROUND This file describes two examples that show how to design a report with bursting. You can override RoiIsTemporary( ) to automatically delete the master report at the completion of the Factory run. Because the run creates multiple small reports rather than one large report. users can download and view the reports offline more easily. You can set separate security permissions on each report by putting the reports into folders based on security rules. Your report must always include a master report. * Off-line viewing. with the subreports in distinct files. You can also use a driver report. with each group in a distinct file. a master report that controls the overall Factory run. In a report with bursting. * Query startup cost. The examples here illustrate the last two techniques.

To do this. * Override the SuggestRoiName() method of that class to determine the ROI name. Pass data from the master report to the detail report. do something like the following: Function SuggestRoiName( row As AcDataRow ) As String SuggestROIName = row. burst1.* Add a second subclass of AcReport to your design to identify the portion of the report that is to appear in a separate ROI.roi" End Function EXAMPLE REPORTS WITH BURSTING THE SUBREPORT BURSTING EXAMPLE The first example. drag it from the master report to the detail report to create a reference to the master report's page list. Group the detail reports into subfolders to keep any one folder from growing too large. For example. Optional tasks include: * * * Create a hyperlink from the master report to the detail reports to support easy navigation. you should consider spreading the files out among multiple folders. to create reports for counties in a number of states. simply include a folder name as part of the name you return from SuggestRoiName( ).GetValue( "county" ) & ". * Add a page list and page style to the detail report. and to put the reports for each state in a separate folder. is a report that uses the example sfdata .rod. DISTRIBUTING DETAIL REPORTS TO FOLDERS If your report will create a large number of ROI files.GetValue( "state" ) & "/" & row. If you want to reuse the same page list as the master report.

except that the subreport in this case is in a different ROI file. (Note: this form of the SuggestRoiName method is new for 3. Change its name to "DetailReport". For example: Function BuildFromRow( row As AcDataRow ) As AcBuildStatus If Not row Is Nothing Then CustomerQuery::StateParam = row. 2. For example: 4. Override the SuggestRoiName( row ) method of the detail report to give each subreport ROI a unique name.database. Move the master report's detail frame to the Scratch Pad. We want to use the same page list class in the detail report as we use in the master report. frames and so on. 5. 3. Use the Conditions tab of the Query Editor to add a hidden parameter to your detail query to parameterize it using a value from the master row. 6.state = :StateParam 8. Drag the detail frame from the Scratch Pad into the new Sequential section. Modify the BuildFromRow() method of the detail report section to set the detail query's parameter from the correct column in the master row. group sections. 7. Drop a Sequential Section into the Content slot just vacated.) You can use values from the master data row to help create the name. Add the other elements of the detail report: a data source. Now. Drag an AcReport component from the Structure pallete into the content slot of the sequential section created above. the page list from the outer report onto the inner report. Make needed adjustments to get it to work the way you want. Start by creating the master report.roi" End Function 9. Choose "Make a reference" from the dialog.3. You may want to open the report and run it before you read about the design details. Drag and drop. This example is very similar to a subreport example. . using the Control & Shift keys. For example: customers. For example: Function SuggestRoiName( row As AcDataRow ) As String SuggestRoiName = "State_" & row. 1. Use the same ROI name created above.GetValue( "state" ) & ". Test the master report. let's get ready for the subreport. The following are the key steps to follow to create a bursting subreport design.GetValue( "state" ) End If BuildFromRow = Super::BuildFromRow( row ) End Function 8. Create hyperlinks from the detail frames in your master report to the matching subreport. Each state provides a hyperlink to a detail report that lists all the customers for that state. Use the New Report Wizard to do this. It provides a master report that lists all the states in which MultiChip Technologies has customers.

DISTRIBUTING DETAIL REPORTS TO FOLDERS If your report will create a large number of ROI files.LinkExp: "State_" & [state] & ".roi" End Function THE GROUP BURSTING EXAMPLE The second example. The finished report looks identical to the .roi" You are now ready to run and test your report.GetValue( "county" ) & ".GetValue( "state" ) & "/" & row. you should consider spreading the files out among multiple folders. BurstGrouping. do something like the following: Function SuggestRoiName( row As AcDataRow ) As String SuggestROIName = row. and to put the reports for each state in a separate folder. To do this. is another report that uses the example sfdata database.rod. simply include a folder name as part of the name you return from SuggestRoiName( ). For example to create reports for counties in a number of states.

Set it's Key property to the same column as the bursting group. You are now ready to run and test your report. The frame in the Content slot is the detail row for the detail report. The trick in this report is that you need two group sections to represent the group you want to burst. inside this. Create the report as a single ROI. the report structure is much different. 9. Create a Before and After frame for your inner group that will be the Before and After frame for the detail report. this example uses a single query in which the data for each group resides in a different ROI file. 1. 2. Drag a report section from the palette into the one just created. and to put the reports for each state in a separate folder. To do this. you should consider spreading the files out among multiple folders. The following are detailed instructions. 5. 8. Override SuggestRoiName( row ) of the inner report to determine the ROI file name. Drag and drop. Instead of requiring a new query for each detail report like the above example. Change its name to "DetailReport".GetValue( "state" ) & "/" & row. However. and its Before slot contains the summary entry for the group. the page list from the outer report onto the inner report. using the Control & Shift keys. For example to create reports for counties in a number of states. you place a second group section that has the same key as the one in the master report. Decide which group will determine bursting.GetValue( "county" ) & ". DISTRIBUTING DETAIL REPORTS TO FOLDERS If your report will create a large number of ROI files. Choose "Make a reference" from the dialog.roi" End Function . The frame in this Before slot will appear in the Master report.\BurstSubreports\BurstSubreports. And.rod example: a master report with hyperlinks to a set of detail reports. The first group will be inside the master report. Use the same ROI name created above. simply include a folder name as part of the name you return from SuggestRoiName( ). do something like the following: Function SuggestRoiName( row As AcDataRow ) As String SuggestROIName = row. Drag the item from the Scratch Pad into the Content slot of the new group section. 7. The frames in the Before and After slots of this inner group section will appear in the detail report. and will represent the Before and After frames for that file. Drag a group section from the palette into the Content slot of the AcReport subclass. 4. Open the Scratch Pad. 3. Drag the component from the Content slot of your group onto the Scratch Pad. Inside this group you put the nested AcReport subclass.. 6. Getting it working as you want. Create hyperlinks from the detail frames in your master report to the matching detail report..

A nested report section is called a subreport.Subreport example This example shows how you can nest one report section inside another. . A report section that contains a subreport is called a parent report.

For each customer. You can refer to a static variable from anywhere in a report by using its scoped name. You can define a parameter as hidden using Parameter Editor. You can also use a multiple-input filter to accomplish this task. followed by a summary of products ordered. you can create designs with multiple levels of nested subreports. the scoped name of the parameter that controls the subreport’s query is ProductsOrderedQuery::CustomerId. grouped by product category. Subreports are primarily used to create complex report layouts that show data from different queries in different sections. The subreport’s query has a hidden parameter variable called CustomerId that specifies a single customer.Subreports have their own queries. In this case. In this example. The CustomerId parameter is hidden because its value is supplied automatically by an overridden method. The query in a subreport is almost always linked to a value in its parent report. orders and order lines. "Customers_CustomerId" ) End If BuildFromRow = Super::BuildFromRow( row ) End Function . You can see a parameter’s scoped name in Parameter Editor. Another use of subreports is to report on related data from two different databases. You can see this variable in the Variables page of Properties and in Parameter Editor. If your report layout requirements are very complex. using a query parameter. In this example. Parameters are static variables. The After slot of the customer group section in the parent report section contains a subreport. the output displays a list of orders. In order to set the value of ProductsOrderedQuery::CustomerId to the correct value for each customer in turn. This subreport lists products ordered by a customer. the BuildFromRow( ) method of the subreport section has been overridden as follows: Function BuildFromRow( row As AcDataRow ) As AcBuildStatus If Not row Is Nothing Then ProductsOrderedQuery::CustomerId = GetValue( row. the parent report's query gets data from one database and the subreport's query gets data from another database. the parent report section lists customers.