reference report globals in form? RRS feed

  • Question

  • Hello All,

      Is it possible to reference the report global variables like GetTotalPages in the form which has the reportveiwer control on it?  I put the following code in my form (after the report is defined) as a test and I get a messagebox showing "TOTAL PAGES= 0"

    MessageBox.Show("TOTAL PAGES= " & Me.ReportViewer1.LocalReport.GetTotalPages())
    Wednesday, October 22, 2008 4:52 PM

All replies

  • The LocalReport object needs to process the report with the data and render it before it knows how many pages there are.

    You can use the RenderingComplete event to know when the rendering has finished.

    Also, the GetTotalPages method is separate from the global variables of the report. Access to the Report variables and code is not available from the report viewer.
    Nick Allen, Microsoft SQL Server Reporting Services. This posting is provided "AS IS" with no warranties and confers no rights.
    Wednesday, October 22, 2008 5:55 PM
  • thank you for the response!!!

    what I am trying to do is add big "next page" and "previous page" buttons to the form that calls the report as this app is for touchscreens. 

    I cant seem to use the RenderingComplete in any way which I have tried... I keep getting renderingcomplete is not a member of ... with everything I try.
    Wednesday, October 22, 2008 6:15 PM