Wednesday, March 28, 2012

PDF Printing example

Does anyone have a good example of printing to a PDF file using the web
service?
The one in the documentation does not stream the file back to the browser.
Thanks in advance.this is just a snippet, i'm assuming you already have the basics of using the
web service and getting a report, but just need to know the pdf portion:
report =rs.Render(reportPath,format,historyID,devInfo,parameters,credentials,showHideToggle,out
encoding, out mimeType, out optionalParams, out optionalWarnings, out
streamIDs);
Response.ClearContent();
Response.AppendHeader("content-length", report.Length.ToString());
Response.ContentType = "application/pdf";
Response.BinaryWrite(report);
Response.Flush();
Response.Close();
"RichieRich" wrote:
> Does anyone have a good example of printing to a PDF file using the web
> service?
> The one in the documentation does not stream the file back to the browser.
> Thanks in advance.|||Thanks much. The last time I tried the code from the documentation, I got a
401 error...Authorization required. Do I need to give write rpermissions on
a folder? And which user gets it.
Thanks again.
"mike" wrote:
> this is just a snippet, i'm assuming you already have the basics of using the
> web service and getting a report, but just need to know the pdf portion:
> report => rs.Render(reportPath,format,historyID,devInfo,parameters,credentials,showHideToggle,out
> encoding, out mimeType, out optionalParams, out optionalWarnings, out
> streamIDs);
> Response.ClearContent();
> Response.AppendHeader("content-length", report.Length.ToString());
> Response.ContentType = "application/pdf";
> Response.BinaryWrite(report);
> Response.Flush();
> Response.Close();
>
> "RichieRich" wrote:
> > Does anyone have a good example of printing to a PDF file using the web
> > service?
> >
> > The one in the documentation does not stream the file back to the browser.
> >
> > Thanks in advance.

No comments:

Post a Comment