Page 1 of 2

Sent report to the printer directly, is it possible?

Posted: Tue Apr 26, 2011 2:43 am
by jpascual
Hi, I have a report that I sent to the printer directly.
I do not want to display a pdf document (PrintToPdf event) or a new window with the report (event PrintToDirect).
Is it possible to send the report directly to the printer to print?

My code:
report.RegData(DataSet)
StiWebViewer1.Report = report
StiWebViewer1.PrintToDirect()
'StiWebViewer1.PrintToPdf()

Thanks.

Sent report to the printer directly, is it possible?

Posted: Tue Apr 26, 2011 6:09 am
by Alex K.
Hello,

It is impossible to print a report without a WebViewer on a page. You can implement it this way: you need to put the WebViewer with width and height of 1px on a page, and use its PrintToDirect(), PrintToPdf(), PrintToPopupWindow() methods.

Thank you.

Sent report to the printer directly, is it possible?

Posted: Tue Apr 26, 2011 9:31 am
by jpascual
ok thanks, I used PrintToPDF but I have a problem. The exported file is called "report.pdf". How I can rename the file? thanks.

Sent report to the printer directly, is it possible?

Posted: Wed Apr 27, 2011 3:18 am
by Alex K.
Hello,

You can change report name for this task.

Code: Select all

StiReport report = new StiReport();
report.Load();
report.ReportName = "FileName";
StiWebViewer1.Report = report;
StiWebViewer1.PrintToPdf();
Thank you.

Sent report to the printer directly, is it possible?

Posted: Thu Apr 28, 2011 10:22 am
by jpascual
I have a new problem. Internet explorer 8 does not show the popup to download the pdf. If I use Internet Explorer 9 or Mozilla works.

Can you help me solve this problem?

I make a call to the popup to download the pdf:
Dim popupScript1 As String = "open('docums.aspx?doc=VtaFull','NewWindow','top=0,left=0,width=1,height=1,status=yes,resizable=yes,scrollbars=yes');"
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "DetalleFact", popupScript1, False)
This is the load event code to display the PDF file download
Select Case Request("doc")
Case "FacturaVtaFull"
StiWebViewer1.Width = 1
StiWebViewer1.Height = 1
Dim report As New StiReport
Dim DSDataset As New DataSet
Dim savePath As String = MapPath("....")
report.Load(savePath)
report.ReportName = "REPORTNAME "
report.RegData(DSDataset )
StiWebViewer1.Report = report
StiWebViewer1.PrintToPdf()
end select

Sent report to the printer directly, is it possible?

Posted: Fri Apr 29, 2011 6:44 am
by Vladimir
Hello,

We could not reproduce the error on IE8. Could you please send us a test project, which reproduces the bug?

Thank you.

Sent report to the printer directly, is it possible?

Posted: Mon May 02, 2011 2:35 am
by jpascual
I attach a Visual Studio 2008 project with the code. This code I download 2 pdf files in Internet Explorer or Mozilla Firefox 9. But IE 8 I do not see the pictures to download.

Sent report to the printer directly, is it possible?

Posted: Tue May 03, 2011 7:13 am
by Jan
Hello,

In progress now...

Thank you.

Sent report to the printer directly, is it possible?

Posted: Wed May 04, 2011 1:37 am
by Vladimir
Hello,

We understand the problem, the reason is in the security settings. Please set the following option in IE8:

Main Menu - Tools - Internet Options
Security Tab
Custom level...
Automatic prompting for file downloads - set to Enable

Thank you.

Sent report to the printer directly, is it possible?

Posted: Wed May 04, 2011 2:00 am
by jpascual
Thanks for your answer but the problem is not the configuration.
If I throw the code from a button I download the files work in IE8. But I need to throw in the load event and then does not work in IE8.

Anyway I could fix this by grouping the two reports. Could help me with this issue, I said that I can combine two reports into one report and this could be a solution for me.

I put the link to the topic that I wonder about it.
http://forum.stimulsoft.com/Default.aspx?g=posts&t=4593

Thanks.