Showing posts with label total. Show all posts
Showing posts with label total. Show all posts

Wednesday, March 28, 2012

How To Determine Total Page Count For Report From VS.NET

I've got Reporting Services 2005. And I need to show reports in Delphi
(one page at a time).
I use web service written on VS.NET 2005 which calls
ReportingServices.Render(...), where
v_Format = "HTML4.0";
v_DeviceInfo = "<DeviceInfo><Toolbar>true</Toolbar><JavaScript>true</
JavaScript><LinkTarget>_top</LinkTarget><Section>" +
ReportRequest.RequestPage + "</Section></DeviceInfo>";
How can I determine total page count for report?On May 21, 8:33 am, Mary <mnem...@.gmail.com> wrote:
> I've got Reporting Services 2005. And I need to show reports in Delphi
> (one page at a time).
> I use web service written on VS.NET 2005 which calls
> ReportingServices.Render(...), where
> v_Format = "HTML4.0";
> v_DeviceInfo = "<DeviceInfo><Toolbar>true</Toolbar><JavaScript>true</
> JavaScript><LinkTarget>_top</LinkTarget><Section>" +
> ReportRequest.RequestPage + "</Section></DeviceInfo>";
> How can I determine total page count for report?
=Globals.TotalPages

How To Determine Total Number of Pages at Runtime?

It's no secret that the number of pages in a rendered report varies depending on the format. I have no problem getting the total number of pages for reports rendered in image formats from the web service, but I can't figure out how to get the number of pages for reports rendered in HTML.

I've always been under the impression that the Report Manager that ships with SSRS uses the same web service (reportservice.asmx) and IT can get the number of HTML pages, so it has to be possible.

Does anyone know how to do it?

Bump.|||

I now have a goofy workaround in place that I'll outline here, but I'd still like to know the "right" way to get the total number of pages from the web service.

In case someone is interested, my workaround is:

1. Add a textbox to the footer with the expression:

"***pages: " & Globals!TotalPages & "***"

2. Set the color of the textbox to match the background color (white, in this case).

3. Convert the byte array returned from the ReportingService.Render method to a string.

4. Pick out the number of pages with:

reportText.Substring(reportText.LastIndexOf("***pages: ")+10, reportText.LastIndexOf("***")-reportText.LastIndexOf("***pages: ")-10)

Like I said, goofy, but it will have to do for now.|||

If you would like to see an even goofier workaround, with somewhat more flexibility and potential, you may want to read this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1807270&SiteID=1

>L<

How To Determine Total Number of Pages at Runtime?

It's no secret that the number of pages in a rendered report varies depending on the format. I have no problem getting the total number of pages for reports rendered in image formats from the web service, but I can't figure out how to get the number of pages for reports rendered in HTML.

I've always been under the impression that the Report Manager that ships with SSRS uses the same web service (reportservice.asmx) and IT can get the number of HTML pages, so it has to be possible.

Does anyone know how to do it?

Bump.|||

I now have a goofy workaround in place that I'll outline here, but I'd still like to know the "right" way to get the total number of pages from the web service.

In case someone is interested, my workaround is:

1. Add a textbox to the footer with the expression:

"***pages: " & Globals!TotalPages & "***"

2. Set the color of the textbox to match the background color (white, in this case).

3. Convert the byte array returned from the ReportingService.Render method to a string.

4. Pick out the number of pages with:

reportText.Substring(reportText.LastIndexOf("***pages: ")+10, reportText.LastIndexOf("***")-reportText.LastIndexOf("***pages: ")-10)

Like I said, goofy, but it will have to do for now.|||

If you would like to see an even goofier workaround, with somewhat more flexibility and potential, you may want to read this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1807270&SiteID=1

>L<

sql

How To Determine Total Number of Pages at Runtime?

It's no secret that the number of pages in a rendered report varies depending on the format. I have no problem getting the total number of pages for reports rendered in image formats from the web service, but I can't figure out how to get the number of pages for reports rendered in HTML.

I've always been under the impression that the Report Manager that ships with SSRS uses the same web service (reportservice.asmx) and IT can get the number of HTML pages, so it has to be possible.

Does anyone know how to do it?

Bump.|||

I now have a goofy workaround in place that I'll outline here, but I'd still like to know the "right" way to get the total number of pages from the web service.

In case someone is interested, my workaround is:

1. Add a textbox to the footer with the expression:

"***pages: " & Globals!TotalPages & "***"

2. Set the color of the textbox to match the background color (white, in this case).

3. Convert the byte array returned from the ReportingService.Render method to a string.

4. Pick out the number of pages with:

reportText.Substring(reportText.LastIndexOf("***pages: ")+10, reportText.LastIndexOf("***")-reportText.LastIndexOf("***pages: ")-10)

Like I said, goofy, but it will have to do for now.|||

If you would like to see an even goofier workaround, with somewhat more flexibility and potential, you may want to read this thread:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1807270&SiteID=1

>L<