I would like to print the report at client side printer. I have gone through those threads but none of those help.
This is my scenario,
I have 10 pages report, when the user gets into this page and click on a button.
The report will be printed directly into the client side printer. I don't want to show up the report in the page which mean there is only a button in the page.
It's ok whether to pop up the printer dialog or not.
Thanks.
KC
14 Answers, 1 is accepted
Attached you will find a sample web site solution which shows a possible approach how to achieve this functionality. In general you can use the ReportViewer control hidden in a div element and call the PrintReport method of the client side object.
Hope this helps.
Greetings,
Steve
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks!
I've attached modified project according to your description. Give it a spin and let me know how it goes.
Greetings,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I also have tried using the PrintAs("PDF") function, but what I get there is the PDF opens up and when I select print the viewer window remains. My goal is to have no windows remain after they print. Any thoughts? I thought I read that PrintReport() would use the PDF plugin. I am using version 2.8.8.925 of Reporting.
Thanks!
Are you by any chance trying this with Firefox? If this is the case apply the following styles to the div around the report viewer instead: <div style="visibility:hidden;width:1px;height:1px;overflow:hidden;">
Greetings,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
This is in IE 7, but the problem is not with the report viewer being visible in the div. There are 2 issues I see.
1. PrintReport() is not using the Adobe plugin. It is trying to print the html report and it is printing a blank page. I want it to use the adobe plugin.
2. Using PrintAs("PDF") opens up the adobe reader and leaves it open after printing.
Thanks!
It seems that there is a problem with the adobe plug-in on your end, as this is working perfectly fine on ours in both cases. I've tested it on two machines and prepared two movies to show you how it behaves on our end.
Best wishes,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Adobe PDF Reader versions are different on both machines we tested - 8.1.3 and 9.0.0. Works fine on both as mentioned in my previous reply. However we do not believe that the version is the actual issue, rather a corrupted plug-in, which you might want to completely remove and then install latest available version. Also make sure you do not have other PDF handling programs installed, such as FoxIt Reader.
All the best,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
For example, if I update the files you attached to fake some complexity, the print dialog never comes up (the window closes without any hint of printing). I just updated the Report1.vb class and added this code:
Sub FakeDelay(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailSection1.ItemDataBound |
'Add a 3 second delay to fake report complexity |
System.Threading.Thread.Sleep(3000) |
End Sub |
Any suggestions?
I've tried attaching JavaScript event handlers to the PreviewFrame IFRAME so that I only do the window.close() after the printable report is loaded, but even that didn't seem very reliable because sometimes the Adobe plugin takes a while to load and display the print window even after the IFRAME has finished loading.
Thanks for any help,
-Stephen
Various reports can have various exporting/printing times required. Currently the only way is to set the timeout to the time needed for the largest report to print and add a couple of seconds on top of it, just to be on the safe side. This is not very reliable, but is currently the only option as there is no way to tell, when the export/print has finished.
All the best,
Steve
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
<telerik:ReportViewer ID="ReportViewer1" runat="server" style="display:none" />
protected void Page_Load(object sender, EventArgs e)
{
string printScript = string.Format("{0}.PrintReport(); ", this.ReportViewer1.ClientID);
ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", printScript, true);
.....
to auto print some reports. Since the Reportviewer is not displayed which is what I want, the generating report progress bar does not display. Is there a way to show the Generating Reports progress bar.
Thanks
Rose
I used the similar approach for printing in client side from my application.
I m using Version=3.2.9.1104 of report viewer
this.ReportViewer1.Report = oReport;
string print = string.Format("{0}.PrintReport();", this.ReportViewer1.ClientID);
this.ClientScript.RegisterStartupScript(this.GetType(), "PrintReport", print, true);
It worked well in dev environment but when deployed in Prod the print failed and showed err message
"ReportViewer1 is null"
Does anyone faced this issue and any solution to it. Does this PrintReport() script works with 3.2.9.1104 version?
Thanks