Thursday, March 29, 2012

Directly printing Report from RS without previewing

Hi All,
Is there a way to send a report from Reporting service directly to the printer without previewing in VS 2005 web application? I tried out an example which exports the report into a pdf and then sends it over to the printer but apparently it did not print. It stopped working after saving the reoprt on the client machine. The article is located at

http://www.codeproject.com/vb/net/RSPrintLandscape.asp

Thanks for the help in advance.

Sanat

what version ? 2000 or 05 ?

printer on the server or on the client ?
if you look at the samples there is a printer delivery sample.

in rs 2000 I hacked that up some to output to a printer w/o the subscription stuff.
basicly when Render() is called it makes a windows EMF file that can then be sent to a printer as a page of output.

do that in a loop and you get printed copy.

just set the page up at the start with the right settings...

|||

and, you know how send the emf correctly to a printer?...

mm.. or how to construct a Printer Settigs or PrinterDocument?...

what should i do?

this is a part of code, and


PrinterSettings printerSettings = new PrinterSettings();
printerSettings.MaximumPage = m_numberOfPages;
printerSettings.MinimumPage = 1;
printerSettings.PrintRange = PrintRange.SomePages;
printerSettings.FromPage = 1;
printerSettings.ToPage = m_numberOfPages;
printerSettings.PrinterName = "Hp Dj 550"; //here goes printer's name.
PrintDocument pd = new PrintDocument();

pd.PrinterSettings = printerSettings;

pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

pd.Print();

Inside of pd_PrintPage method, i don't have anything about the printer, just code to conver a byte[] into a graphics file... what ever, nothing goes to the printer... thanks in advance for your attention.

|||Have you taken a look at http://www.gotreportviewer.com/? There is a sample called "Print a report from a console app" that uses the ReportViewer control to do this.|||

Thanks for the link Brian - this is almost exactly what I need to do (automatically print local reports).

My ADO.NET skills are not quite up to par - how would I modify the Run method of this example to execute an existing server based report that I have? I have managed to convert the report from an RDL to an RDLC, and added it to my Console Project with VB.NET. In addition, I created a new Data Set within this project that returns the data from the original stored procedure that was used for the RDL file. I now need to associate this new Data Set with the RDLC report, as well as pass some parameters to it, but I am not sure how to proceed.

Any suggestions/direction would be greatly appreciated.

Thanks!

sql

No comments:

Post a Comment