none
How, Print only current page of reportviewer RRS feed

  • Question

  • I have a reportviewer in my project.

    When client click to print button all of the pages go to printing. I want to program repotviewer for only current page printing. How can i do that. My reportviewer code is below

        Private Sub rapor1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load 
            Me.raportabloTableAdapter.Fill(Me.myDataSet.raportablo) 
            Me.reportViewer1.RefreshReport() 
     
        End Sub 

    Thanks
    Sunday, October 26, 2008 5:24 PM

All replies

  • my quick answer would be to tell your client to slow down, tell them to do the one extra mouse click it takes them to print only the current page. 
    Living my life at 123mph in 11.15 seconds
    Monday, October 27, 2008 12:14 AM
  • Did you ever figure out a way to do this? My reports dont even give the option to print current page in the print dialog. And given there are 400 some pages in the report, having to find the report, then remember the report number just to put in the page number seems a tad cumbersome
    Tuesday, June 8, 2010 6:07 PM
  • Hello,

     

    Yes, I have the same problem, and the customer has already told me that it was out of question to click on print and type the nuber of the current page to print it.

    He wants a Print current page button.

     

    Thank you

     

    Thursday, June 17, 2010 1:10 PM
  • You can implement a custom print button, which, when clicked, renders only the current page (ReportViewer.CurrentPage) using LocalReport.Render(), then prints that page.

    This walkthrough should get you started in printing programmatically.


    Cephas Lin This posting is provided "AS IS" with no warranties.
    • Proposed as answer by Marc_Allard Thursday, July 1, 2010 11:33 AM
    Thursday, June 17, 2010 5:35 PM
    Moderator
  • Hello,

     

    Thank you very much, I will work like that as soon as I have the time.

     

    Marc

    Friday, June 18, 2010 6:10 AM
  • Hello,

     

    One more question if you still follow the thread.

    I have a report that takes a few minutes to print. (500-600 pages).

    When I click on my "Print current page" button, the Render renders all the pages (500-600 pages so a few minutes ) and I print only the current page.

    Is there a way to use the information from before instead of having to do the rendering again? (or at least a way to say to the render to stop at page XXX so if I want to print page 50 I only render 50 pages (no need to wait for the 600 pages)

     

    Thank you

    Marc

    Tuesday, August 3, 2010 11:50 AM
  • The device information settings contain two settings: StartPage and EndPage. See http://msdn.microsoft.com/en-us/library/ms155373(SQL.105).aspx.

    You can play around with that and see if that gives you what you need. Otherwise, you can also just keep all the rendered pages around in some private property and use it to print the requested pages.


    Cephas Lin This posting is provided "AS IS" with no warranties.
    Tuesday, August 3, 2010 5:29 PM
    Moderator
  • A very old thread, but this is stil an issue after 8 years. Could you be so nice to provide a sample code where you print out only one page ? Article describes how to print all pages, not just one. Thank you !
    Wednesday, March 14, 2018 3:34 PM