Sent report to the printer directly, is it possible?

Stimulsoft Reports.WEB discussion
jpascual
Posts: 68
Joined: Mon Jul 12, 2010 6:45 am
Location: Palencia

Sent report to the printer directly, is it possible?

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Sent report to the printer directly, is it possible?

Post 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.
jpascual
Posts: 68
Joined: Mon Jul 12, 2010 6:45 am
Location: Palencia

Sent report to the printer directly, is it possible?

Post 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Sent report to the printer directly, is it possible?

Post 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.
jpascual
Posts: 68
Joined: Mon Jul 12, 2010 6:45 am
Location: Palencia

Sent report to the printer directly, is it possible?

Post 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
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Sent report to the printer directly, is it possible?

Post 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.
jpascual
Posts: 68
Joined: Mon Jul 12, 2010 6:45 am
Location: Palencia

Sent report to the printer directly, is it possible?

Post 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.
Attachments
954.PruebaPDF.rar
(1.95 MiB) Downloaded 240 times
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Sent report to the printer directly, is it possible?

Post by Jan »

Hello,

In progress now...

Thank you.
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Sent report to the printer directly, is it possible?

Post 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.
jpascual
Posts: 68
Joined: Mon Jul 12, 2010 6:45 am
Location: Palencia

Sent report to the printer directly, is it possible?

Post 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.
Post Reply