Providing the ReportDesign.initialize code The following code in the ReportDesign.initialize method creates a file on your hard drive and adds one line to the file. importPackage( Packages.java.io ); fos = new java.io.FileOutputStream( "c:\\logFile.txt" ); printWriter = new java.io.PrintWriter( fos ); printWriter.println( "ReportDesign.initialize" ); The preceding code performs the following tasks: n Imports the Java package, java.io n Creates a file output stream for the file you want to create n Creates a PrintWriter object that every method can use to track method execution sequence How to provide code for the ReportDesign.initialize method You can provide code for the ReportDesign.initialize method by performing the following steps: 1 Choose the Script tab. 2 Choose the Outline view. 3 In Outline, select the top line, as shown in Figure 22‑2. Figure 22‑2 Selecting the report design 4 In Script, select the Initialize( ) method. 5 Type the code into the script editor. The BIRT Report Designer appears, as shown in Figure 22‑3. Figure 22‑3 Providing ReportDesign.initialize code
The following code in the ReportDesign.initialize method creates a file on your hard drive and adds one line to the file.
The preceding code performs the following tasks:
You can provide code for the ReportDesign.initialize method by performing the following steps:
The BIRT Report Designer appears, as shown in Figure 22‑3.