Hello,
I am wondering if there is a way to change the page that appears in a sub-report component.
I have a sample report attached that has 3 pages:
- a main page with a sub-report component
- page subReport_1 for the sub-report contents
- page subReport_2 for alternate sub-report components
The report also has a picklist with the following values: Page 1 and Page 2.
If a user chooses Page 1 from the list, I would like Page subReport_1 to be displayed in the sub-report control.
If a user chooses Page 2 from the list, I would like Page subReport_2 to be displayed in the sub-report control.
I've tried adding the following code to the BeginRender event of the report, but I don't have the syntax right
for setting the sub-report page
if (varPage == "Page 1")
{
SubReport1.subReportPage = subReport_1;
}
else
{
SubReport1.subReportPage = subReport_2;
}
Can you provide some guidance on how this might be acccomplished - if it even can be accomplished?
Note that there are no data sources in the report, as I am just interested in figuring out the functionality if possible.
I'm currently working with Version 2021.1.1 from 15 January 2021, ASP.NET, JS
Thank you,
Carl
Change page for a sub report
Change page for a sub report
- Attachments
-
- TestSubReportChange.zip
- (2.27 KiB) Downloaded 101 times
-
- Posts: 6374
- Joined: Tue Mar 20, 2018 5:34 am
Re: Change page for a sub report
Hello,
You can add two SubReports components and hide one of them by Condition with the "Component Is Enabled" option depending on the variable value.
Thank you.
You can add two SubReports components and hide one of them by Condition with the "Component Is Enabled" option depending on the variable value.
Thank you.
Re: Change page for a sub report
Thank you for the suggestion Lech.
I will actually have about 20 pages in the report which would mean adding 20 sub-reports. I'd like to avoid that if I can - hence
my desire to add one sub-report and then change the page that appear in the sub-report. Is this possible with some modifications
to the code I included in the original post?
Thanks,
Carl
I will actually have about 20 pages in the report which would mean adding 20 sub-reports. I'd like to avoid that if I can - hence
my desire to add one sub-report and then change the page that appear in the sub-report. Is this possible with some modifications
to the code I included in the original post?
Thanks,
Carl
Re: Change page for a sub report
Hello,
Do you have any additional thoughts on changing the page that appears in a sub-report control?
Thank you,
Carl
Do you have any additional thoughts on changing the page that appears in a sub-report control?
Thank you,
Carl
-
- Posts: 6374
- Joined: Tue Mar 20, 2018 5:34 am
Re: Change page for a sub report
Hello,
Unfortunately, directly in the report, it is not possible.
Thank you.
Unfortunately, directly in the report, it is not possible.
Thank you.
Re: Change page for a sub report
Ok - Thank you Lech. Your sub-report suggestion will work just fine.
Carl
Carl
-
- Posts: 821
- Joined: Tue Sep 07, 2021 10:11 am
Re: Change page for a sub report
Hello,
You are welcome!
You are welcome!