You can also externalize a connection profile name for a data source by binding it to a report parameter. The next example shows how to create a report design that uses a CSV file as a data source, using Actuate BIRT Designer Professional. At design time, the report design uses the CSV file in the folder, C:\ConnProfile\Testing. Typically, the design time CSV file contains only a few records. In the production environment, the CSV file, which contains more records, is in the folder, C:\ConnProfile\Production. You create two connection profiles, one for the testing database and one for the production database, and pass the name of the connection profile as a parameter at run time. In this way, the report runs as expected in development and production environments.
2 In Data Sources, create a new data source and choose Create from a connection profile in the profile store. Choose Next.
5 In New Connection Profile, choose Flat File Data Source and enter Products-testing as a profile name.
7 In New Flat File Data Source Profile, choose Enter File URI:, and choose Browse to select the testing database file, which is C:\ConnProfile\Testing\csvTestODA.csv, in this example.Products-testing profile appears in the Create a Connection Profile Store list, as shown in Figure 27-17.
Figure 27-17
9 In Create a Connection Profile, choose New to create a connection profile for the production database.
10 In New Connection Profile, choose Flat File Data Source and enter Products-Production as a connection profile name.
11
15 In Select the connection profiles, select Products-testing and Products-production, as shown in Figure 27-18.
Figure 27-18
17
Figure 27-19 Select Connection Profile appears, as shown in Figure 27-20, prompting you to select a connection profile for the data source.
20 In Connection Profile select the testing database connection profile, Products-testing, as shown in Figure 27-20.
22
Figure 27-20
25 Add the Products data set to the layout and preview the report, as shown in Figure 27-21. In the example the report displays only six rows of data.
Figure 27-21
Figure 27-22
31 Choose Property Binding, as shown in Figure 27-23, and enter the expression:
32
33 Select Preview. In Parameters, enter Products-production to choose the production database as a data source. The report displays a large set of data, as shown in Figure 27-24.
Figure 27-24
|
|
Copyright Actuate Corporation 2012 |