number of subreports rendered pages

Stimulsoft Reports.NET discussion
Post Reply
Albatros
Posts: 7
Joined: Thu Oct 23, 2008 5:30 am
Location: Slovenia

number of subreports rendered pages

Post by Albatros »

How can i get number of subreports pages.

Here i my code:
StiReport report = new StiReport();
report.SubReports.Add(report1);
report.SubReports.Add(report2);
report.Render(true);

I need count renderedPages from report2 in report.

Thank you.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

number of subreports rendered pages

Post by Edward »

Hi, Albatros.

In which place do you need this information? Do you plan to receive it in Designer or in application?
Which report engine are you using? I mean EngineV1 or EngineV2 and the date of the build.

Thank you.
Albatros
Posts: 7
Joined: Thu Oct 23, 2008 5:30 am
Location: Slovenia

number of subreports rendered pages

Post by Albatros »

Hi,

I plan to update a text object in report1 after render whole report.
I need to put a number of rendered pages of report2 in report1 page.
I use Engine V1 because I have problems with engine V2 and subreports.

Do you have any code for that.

Thanx.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

number of subreports rendered pages

Post by Vital »

Hello,
Albatros wrote:How can i get number of subreports pages.

Here i my code:
StiReport report = new StiReport();
report.SubReports.Add(report1);
report.SubReports.Add(report2);
report.Render(true);

I need count renderedPages from report2 in report.

Thank you.
You can use following code:

Code: Select all

report1.Render(false);
int pagesCount = report1.RenderedPages.Count;

StiReport report = new StiReport();
report.SubReports.Add(report1);
report.SubReports.Add(report2);
report.Render(true);

pagesCount = report.RenderedPages.Count - pagesCount;
Thank you.
Albatros
Posts: 7
Joined: Thu Oct 23, 2008 5:30 am
Location: Slovenia

number of subreports rendered pages

Post by Albatros »

Vital wrote:Hello,


You can use following code:

Code: Select all

report1.Render(false);
int pagesCount = report1.RenderedPages.Count;

StiReport report = new StiReport();
report.SubReports.Add(report1);
report.SubReports.Add(report2);
report.Render(true);

pagesCount = report.RenderedPages.Count - pagesCount;
Thank you.

But this means double rendering and need more time.
Is there any other direct solution.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

number of subreports rendered pages

Post by Edward »

Hi Albatros,

It is impossible to know number of pages in the subreport without rendering of the subreport. That is why double rendering is required.

Thank you.
Post Reply