How to detect if the-user pressing PRINT button at PRINT DIALOG?
How to detect if the-user pressing PRINT button at PRINT DIALOG?
Hello to you,
I'm newbie using VB.NET 2005, Stimulsoft Report 2010 for .NET Winform
As we know, when report showing on viewer, Viewer have a print button, when clicked then the PRINT DIALOG show, If user pressing PRINT button, then report printing on printer.
How to detect it, when PRINT button pressed then msgbox("PRINTING")
Please guide me and show me by code in VB.NET
Thanks in advance
Regards,
Steven
I'm newbie using VB.NET 2005, Stimulsoft Report 2010 for .NET Winform
As we know, when report showing on viewer, Viewer have a print button, when clicked then the PRINT DIALOG show, If user pressing PRINT button, then report printing on printer.
How to detect it, when PRINT button pressed then msgbox("PRINTING")
Please guide me and show me by code in VB.NET
Thanks in advance
Regards,
Steven
How to detect if the-user pressing PRINT button at PRINT DIALOG?
Hello,
Please check the following article in our knowledgebase:
http://stimulsoft.helpserve.com/index.p ... icleid=104
Please check the following article in our knowledgebase:
http://stimulsoft.helpserve.com/index.p ... icleid=104
Thank you.You should use the static PrintingDocument event of the StiPreviewControl class.
See a code below for processing printing of a rendered report:
Code: Select all
AddHandler StiPreviewControl.PrintingDocument, New EventHandler(AddressOf Form1.OnPrintingDocument)
Code: Select all
Private Shared Sub OnPrintingDocument(ByVal sender As Object, ByVal e As EventArgs) ' Show your messagebox here Dim Report As StiReport = TryCast(sender, StiReport) Report.Print() End Sub
How to detect if the-user pressing PRINT button at PRINT DIALOG?
Hi Ivan,
Thanks for yr reply.
Yr solution is just detected pressing PRINT button at ReportViewer Control, that is not my point.
My point is : After pressing PRINT button at ReportViewer Control, then The PRINT DIALOG Window showing, this window contains 2 buttons [OK] and [CANCEL].
I just want to detected if pressing/clicking [OK] button.
I'm existing user of DataDynamics, Now GrapeCity Active Report. They have knowledge base/documentation about this.
Please advice and show by code
Thanks for yr reply.
Yr solution is just detected pressing PRINT button at ReportViewer Control, that is not my point.
My point is : After pressing PRINT button at ReportViewer Control, then The PRINT DIALOG Window showing, this window contains 2 buttons [OK] and [CANCEL].
I just want to detected if pressing/clicking [OK] button.
I'm existing user of DataDynamics, Now GrapeCity Active Report. They have knowledge base/documentation about this.
Please advice and show by code
How to detect if the-user pressing PRINT button at PRINT DIALOG?
Hello,
Please check the following article in our knowledgebase:
http://stimulsoft.helpserve.com/index.p ... ticleid=27
Please check the following article in our knowledgebase:
http://stimulsoft.helpserve.com/index.p ... ticleid=27
Thank you.How to know which buttons press user in print dialog box?
You can check property - report.PrinterSettings.PrintDialogResult. See sample below.
Code: Select all
if (report.CompiledReport != null) return report.CompiledReport.PrinterSettings.PrintDialogResult else return report.PrinterSettings.PrintDialogResult;
How to detect if the-user pressing PRINT button at PRINT DIALOG?
Hello Ivan,
Great!, that's what I want.
I want to code, when After pressing [OK] button at PRINT DIALOG window, then immediately to showing msgbox("PRINTING to PRINTER")
What event should I coded in?
Please advice & show me how?
Thanks
Great!, that's what I want.
I want to code, when After pressing [OK] button at PRINT DIALOG window, then immediately to showing msgbox("PRINTING to PRINTER")
What event should I coded in?
Please advice & show me how?
Thanks
How to detect if the-user pressing PRINT button at PRINT DIALOG?
Hello,
You can use the following code:
Thank you.
You can use the following code:
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
StiReport report = new StiReport();
report.Load("D:\\Sample Report.mrt");
report.Compile();
report.CompiledReport.Printed += new EventHandler(report_Print);
report.Show();
}
private void report_Print(object sender, EventArgs e)
{
StiReport report = sender as StiReport;
if ((report.PrinterSettings.PrintDialogResult == DialogResult.OK))
{
MessageBox.Show("PRINTING to PRINTER");
}
}
How to detect if the-user pressing PRINT button at PRINT DIALOG?
Hi Aleksey,
Thanks for yr answer, You fullfil what I want.
One more questions, from yr code :
report.compile()
Should always have this line? (because, If not put report.compile seems report also work)
When report.compile needed?
Thanks in advance
Steven
Thanks for yr answer, You fullfil what I want.
One more questions, from yr code :
report.compile()
Should always have this line? (because, If not put report.compile seems report also work)
When report.compile needed?
Thanks in advance
Steven
How to detect if the-user pressing PRINT button at PRINT DIALOG?
Hello,
In this case the report.compile() method is used to assign the report.CompiledReport.Printed += new EventHandler(report_Print); event.
Thank you.
In this case the report.compile() method is used to assign the report.CompiledReport.Printed += new EventHandler(report_Print); event.
Thank you.