none
How to programmatically print a databound & refreshed() rdlc RRS feed

  • Question

  •  

    I imagine that my answer resides buried within the WalkThrough: "Printing a LocalReport without Preview."   ... http://msdn.microsoft.com/en-us/library/ms252091.aspx

    However, my delima with this sample is that it calls for creating a dataSet DataTable and populating it via XML.  I don't need to do this overhead and i'm certain it would sink my ship.  In my application, i have the ReportDefinition created, populated with bound Data Regions that are updated as my application is moved along by the user.  I have the ReportViewer on the app's Form so that the user can demand a report at any point along the process.  This all works good.  My ultimate goal is to have the said report print automatically upon the user's completion of using the application (best-effort at ensuring a hardcopy); programming that i would add to do such.

    I suspect that applying only the needed functionality as may be within the said walkthrough will resolve my issue, however, i'm hoping someone provides a "cut to chase" summary for me as to save me this "pruning" work.

    Thanks,
    GlennXS


    Glenn of xSyLent
    Monday, November 24, 2008 7:53 PM

Answers

  • I (sort-of) resolved this.  Actually, it is resolved but not in a manner as i originally sought.  That is, i originally wanted the report to go to the printer upon completion of the application process.   An inference could b drawn: "directly to the system's default printer (do not pass go)".

    After spending the afternoon on this, i learned that:

    1.  As long as the app does a "ReportViewer.RefreshReport()" as appropriate and during the app's processing, the report is rendered and "ready to go".
    2.  By invoking "ReportViewer.PrintDialog()" upon the app's closing moment, the user need only need hit <Enter> and the app' prints the report and then moves along.
    3.  The user has to respond to the PrintDialog() as it retains exclusive focus while it's up.  This way, the user can deal with "what if the printer's not ready" or "i wanna use a different print" or ...


    So actually, using PrintDialog() is the ultimate solution for my situation (and it only took one line of code).


    Glenn of xSyLent
    • Marked as answer by GlennXS Monday, November 24, 2008 11:01 PM
    Monday, November 24, 2008 11:00 PM

All replies

  • I (sort-of) resolved this.  Actually, it is resolved but not in a manner as i originally sought.  That is, i originally wanted the report to go to the printer upon completion of the application process.   An inference could b drawn: "directly to the system's default printer (do not pass go)".

    After spending the afternoon on this, i learned that:

    1.  As long as the app does a "ReportViewer.RefreshReport()" as appropriate and during the app's processing, the report is rendered and "ready to go".
    2.  By invoking "ReportViewer.PrintDialog()" upon the app's closing moment, the user need only need hit <Enter> and the app' prints the report and then moves along.
    3.  The user has to respond to the PrintDialog() as it retains exclusive focus while it's up.  This way, the user can deal with "what if the printer's not ready" or "i wanna use a different print" or ...


    So actually, using PrintDialog() is the ultimate solution for my situation (and it only took one line of code).


    Glenn of xSyLent
    • Marked as answer by GlennXS Monday, November 24, 2008 11:01 PM
    Monday, November 24, 2008 11:00 PM
  • DIDN'T GET IT - WHAT LINE OF CODE AND WHERE EXACTLY?!
    Thursday, January 21, 2010 11:06 AM