Crystal Report Template - Insert Sub-Report

This section describes how to add a sub-report to an existing report.

Step 01> Right-Click the details b section of the report and select Selection Expert. The selection expert form will open with the details b section already selected.

Step 02> Click Insert on the Section Expert form. Details b will be broken into Details b and c.

Step 03> Click OK.

Step 04> From the top menu, Click Insert then subreport.

Step 05> Enter a New report name (this will be the name of the sub-report) and Click Report Wizard

Step 06> Select the  Data sources that contains the data for your sub-report. Use an existing Data source, or define a new Data source.

Step 07> Drag the table you wish to use in your sub-report into the Selected Tables field and Click next.

Step 08> Select the fields you wish to use in your sub-report and drag them into the Fields to Display. Click Finish, Click OK.

Step 09> Click section Details c of the report to drop the new sub-report into that location.

 

 

 

PLEASE NOTE: In Crystal Reports, any parameters used in the XML  Data sources in the main report must be defined as parameters in the sub-report. Dekho requires XML  Data sources contain two parameters named sessionid and layers

 

 

 

Step 10> Open the sub-report in Crystal.

Step 11> Right-Click Parameter Fields in the Field Explorer and select New to open the Create a New Parameter form.

Step 12> Enter 'sessionid' into the Name field, Click OK.

Step 13> Again, Right-Click Parameter Fields in the Field Explorer and Select New.

Step 14> Enter 'layers' into the Name field, Click OK.

Step 15> Click the Design tab and return to the main report.

Step 16> Right-Click Subreport and Select Change Subreport Links.

Step 17> In the Available Fields list, Expand Report Fields then Select, Drag and Drop '(?)sessionid' into the Fields to link to list. Do the same for '(?)layers'.'

Step 18> In the Subreport parameter field to use, Select '?sessionid'.

Step 19> Select, Drag and Drop '(?)layers' into the Fields to link to list.

Step 20> In the Subreport parameter field to use, Select '?layers'.

Step 21> Click OK.

Filter values in the sub-report by the current record in the main report, filter the sub-report using the objectid of the selected feature in the main report.

Step 22> Open the sub-report.

Step 23> Right-Click Parameter Fields in the Field Explorer and select New.

Step 24> Type 'subreportlink' in the Name field.

Step 25> Select 'number' in the Type drop-down list, Click OK.

 

Step 26> From the top menu, Select Report, then Selection Formulas, then Record.

Step 27> From the available fields, drag the objectid field into the text area.

Step 28> In the text area, add ' = '.

Step 29> From the report fields, drag the (?)subreportlink parameter into the text area. Use this syntax as a guide:

{MYSUBREPORTTABLE.ID} = {?subreportlink}

Step 30> Click Save and Close.

Step 31> Click the Design Tab to return to the main report.

Step 32> Right-Click subreport and Select Change Subreport Links.

Step 33> Select the field that contains the value to be passed to the sub-report (for example; objectid, propertview.pid) and drag it to the Fields to link to list.

Step 34> In the Subreport parameter field to use drop-down list, Select '?subreportlink', Click OK.

Step 35> Save the report.

Generate a Crystal sub-report Report

Step 01> Open Dekho in a web browser and Click Generate Report to open the Reports form.

Step 02> In the Reports form, Select a Report from the Reports drop-down list and Click Generate.

Verify the Report contains the data and maps configured in the Crystal Report Template. The multipage report with maps and attributes including a sub-report section related to the selection will open in a new window.


Crystal Report Template - Insert FIQ