Today, I want to tell you and demonstrate how to pass values from a subreport to the main report. We will be creating a simple report from scratch so that you can see each step and notice any potential pitfalls that you might encounter.
For example, we will create a new report named IQ000001.rpx. This will be our main report, where we will display the OrderNbr of Sales Orders pages. Additionally, for demonstration purposes, we will display the OrderQty of all SOLines in the same report and the CuryExtPrice in a separate subreport.
- let's create the report IQ000001.rpx.
We need to add the DAC that will be used.
Also create a relationship between the tables:
Then add the parameter by which we will display the Order we want to use.
Warning: I've set the Default Value to the OrderNbr that exists in my system. Please be attentive and replace it with your own number.
And finally, let's add a filter based on our parameter. I will hardcode the parameter for the sake of simplicity in this implementation.
Once the work with the Build Schema is complete, we should add the necessary fields to the layout. We will also add SubReports to the layout, but we will implement them a bit later. Then, we can save the report.
We can see the result using the designer.