This article guides you through adding a query report as a subreport to any existing report. To this end, follow the steps listed below.
1. Go to the Report page by clicking Lasernet, and then clicking Reports under Common.
2. Locate the report to which you want to add a query report, and then click its record to open it.
3. On the left panel, you can see the report structure which is actually its XML structure. So, locate the section to which you want to add a query report, and then click it.
4. Afterwards, under the Fields section, click the New button.
5. Within the new record that appears, specify a field name and output. Once you are done, click the sign with two pluses in the Expression field. As a result, the combo box shows. Select SubReport in it.
6. Once the SubReport value is added to the Expression field, click the sign with two pluses once again to select the query report you have created and want to add is to the current report as a subreport. As a result, the Settings panel opens.
7. From the Report name drop-down combo box, select the report.
8. Once you have selected the query report, click the Filter button to set a link between the subreport and the main report by defining a table and its field(s). Thus, you can receive one post letter back when running the main report.
9. On the query panel that shows, click the tools button.
10. On the Range panel that shows, first, click the Delete all button to remove any existing expressions, and then click the plus button. As a result, the Segment panel opens. Click the sign with two pluses for the first time to add a table. Once you have selected a table from the combo box, click the sign with two pluses once again to add a field of this table.
Once you are done, click the OK button on both panels to close them and save the changes.
11. After adding a filter, verify that the link between the subreport and the main report has been added. As a result, you can see the corresponding value (the table and its field) in the Customer account text box at the bottom of the Settings panel.
12. Once you have added the subreport, click the Save button to save changes.
The next time the report is used, the section to which you have added a subreport (it is Demo in our example) is added to the resulted XML with the content of this subreport.