Is there a way to add a Print button to the ReportViewer control in an .aspx page when using .rdlc file
Would the Print button displayed and enabled if I use remote reports(.rdl) instead of local ones(.rdlc)
Response is very much appreciated.
Thanks,
S

How to? : (ReportViewer + asp.net + .rdlc + print button)
RonSchlegel
I am in a desperate condition to solve the problem that u were talking about. Could u please give sample code for converting to temp EMF file and the javascript code.
Thanks in advance.
yunyuaner
Yes, here is is:
http://msdn2.microsoft.com/en-us/library/ms252091(VS.80).aspx
Or, just google "print from reportviewer control"
Karthik.N.Rao
This is for window app, what I am looking for is in web app...
But I am trying to convert it to JPG as CTGUY67 said in the earlier post.
Charles Chung
The report viewer web control does not have built in print functionality when in local mode. A print button is available in remote mode.
The problem isn't the ability to generate EMF files for printing, it's in the availablity of the ActiveX control. In server mode, the viewer sends the ActiveX control from the report server to browser. You can implement your own print functionality and print button by programmatically rendering to EMF (ReportViewer.LocalReport.Render()).
DesperadoMike
Thanks for your quick reply
I will try it.
Stefan Burwitz
RobertMahon
reybhoie
Jonathan Lo
zaxxys
jet su
Yeah I was affraid it was going to be that one. I found that one too. It has 2 problems. It creates a temparary EMF file which brings security into play. Secondly, it's server code, so if you're project runs on on a remote server, even though the report runs local, the list of available printers is what's installed on the server.
The solution I came up with does not create a temp emf file, it converts the memory stream into a jpg. Then Transfer control to a page with a asp:image control. Server code loads the asp:image with the newly created jpg file, and javascript onload does a window.print(); which pops up the local windows printer dialog box.
The only thing I don't like about my solution is it creates a temp jpg file. I just found the emf files too hard to work with.
Thanks anyway.
TarPista
kimoz
The information is at this link:
http://msdn2.microsoft.com/en-us/library/ms252091(VS.80).aspx
Or, just google "print from reportviewer control"
I have no javascript code.
J
scottd_arch
I figured it out on a whim, by playing with it.
MS has a print routine on the MSDN site that prints to the MS Office Document Image Writer as the name of the printer set to a Const variable.
What I did was comment out the constant, comment out the portion of the code that assigns the constant to the printername property of the printdocument, because then the object will take the default printer that is set on the local computer. Because I commented out the set printer portion, I also commented out the portion that checks to see if the printer exists on the local computer (yeah, I know, commenting out error-checking code is not the best practice, but if the default printer is used, well...)
I left the addhandler of the printpage event, and the addressof portion, then called the print method. What do you know, it worked like a charm!
I'm not claiming to understand why it works, but hey, it works.
Hope this helps you out!