how to print from a preview button

Stimulsoft Reports.NET discussion
Post Reply
miguels
Posts: 27
Joined: Tue Jun 23, 2009 5:05 pm

how to print from a preview button

Post by miguels »

hello .. I hope I can help

I need to print the contents of a control StiViewerControl already loaded with information, from a button outside the control and not the default button that brings the print ...

I need to do is give it a process of printing but if I put the code you need within the print control method Wiewer .. I printed ... the content. I do not want to reload the printed information to


I hope I is explained
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

how to print from a preview button

Post by Alex K. »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

As a way, you can use the following code:

Code: Select all

report.Render();
report.Print();
Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

how to print from a preview button

Post by Alex K. »

Hello,

As a a way you can use the following code:

Code: Select all

    ...
    StiReport report = new StiReport();
    StiOptions.Engine.GlobalEvents.PreviewingReportInDesigner += new EventHandler(GlobalEvents_PreviewingReportInDesigner);
    ...

void GlobalEvents_PreviewingReportInDesigner(object sender, EventArgs e)
{
    ((StiDesignerControl)sender).Report.Print();
}
Thank you.

Post Reply