We are starting to use RDLC reports for an application that is deployed to hundreds of client sites. The application is written in .Net 4.0 with Visual Studio 2010. The clients use difference versions of SQL Server so we use RDCL reports with objects for the data source.
We need to be able to show the PageNumber and TotalPages in the footer so it says “Page 1 of 3”. When printing a batch of multiple invoices, those numbers need to be reset on each individual invoice. It looks like the TotalPages cannot be reset using the 2008 Schema. However, the 2010 Schema can do this according to this post http://blogs.msdn.com/b/robertbruckner/archive/2010/04/25/report-design-reset-page-number-on-group.aspx.
Is there a timeframe when the new 2010 Schema can be used in Visual Studio to create RDLC reports? If not a timeframe, are there even plans to do it?
We are also seriously questioning if we should be using SSRS since we would have to use RDLC reports. I believe SQL Server 2008 R2 and Visual Studio 2010 have been out for a year and there is still no way to create RDLC reports with the 2010 Schema. Does that mean the RDLC option is seldom used? Why go through the work of upgrading the produce and then not give it to everyone?
The Schema Version of RDLC report in Visual Studio is 2008 RDL, so your requirement is just like implementing Reseting Page Number On Group in SSRS 2008, there is no build-in feature to achieve this just like SSRS 2008 R2.
To work around the issue, you can track group breaks in a shared variable and then subtract off the page offset of the first page of the group from the current page number. For detail steps, please see below:
1. Drag a textbox on the report, type in the group expression
2. Add shared variables to track the current group and page offset
Shared offset as Integer
Shared currentgroup as Object
3. Add a custom code to set the shared variables and retrieve the group page number, code like below:
Public Function GetGroupPageNumber(group as Object, pagenumber as Integer) as Object
If Not (group = currentgroup)
offset = pagenumber - 1
currentgroup = group
Return pagenumber - offset
4. Use the function in the page header or footer
If you have any question, please feel free to ask.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
I have seen this code before to show "Page 1" on a report. However, it does not enable me to print "Page 1 of 3" which is what I need. I have not seen a solution for getting the TotalPages for the group.
Do you know if there is a timeframe when the new 2010 Schema can be used in Visual Studio to create RDLC reports?