The report you have just created is a reusable part and requires information from your BusinessExpenseView part to run properly:
If you want to test the report from its own Composition Editor, you will need to provide test data. A convenient way of doing this is to override the instance method finalInitialize and set values for the host variable and the ordered collection at that point.
Note: | You can copy this block of code from the online version of this book and paste it into the Script Editor. |
finalInitialize "Provide information to the report for testing" ((self subpartNamed: 'Multiple Row Query1') valueOfAttributeNamed: 'name' selector: #'IS_name') == nil ifTrue: [(self subpartNamed: 'Multiple Row Query1') valueOfAttributeNamed: 'name' selector: #'IS_name' ifAbsent: [] put: 'Graham']. (self subpartNamed: 'Expenses') value: (Array with: (BusinessExpense new date: (Date today); reason: 'Sales call'; airfare: 200; room: 100; meals: 50; misc: 10; yourself) with: (BusinessExpense new date: ((Date today) addDays: 1); reason: 'Sales call'; airfare: 0; room: 100; meals: 75; misc: 0; yourself) with: (BusinessExpense new date: ((Date today) addDays: 2); reason: 'Sales call'; airfare: 0; room: 100; meals: 65; misc: 5; yourself)).
It should look similar to the following:
Your report will run in a report viewer that is embedded in a report tester window. From the Report menu in this window, you can select Preview to display a printer-formatted preview of the report or Print to print the report.