Showing posts with label url. Show all posts
Showing posts with label url. Show all posts

Friday, March 9, 2012

Possible to render direct to PDF instead of viewing the report on a webpage?

Is it possible to to render direct to PDF when viewing the report url?

Hello,

Try adding the part in red to your URL:

http://ServerName/Reportserver/Pages/Report.aspx?ItemPath=%2fReportPath%2fReportName&rs:Command=Render&rs:Format=PDF

Hope this helps.

Jarret

|||

Will check that out in the beginning of the next week.

Thanks!!!

|||

Jarret wrote:

Hello,

Try adding the part in red to your URL:

http://ServerName/Reportserver/Pages/Report.aspx?ItemPath=%2fReportPath%2fReportName&rs:Command=Render&rs:Format=PDF

Hope this helps.

Jarret

Jarret is right, however it is better not to render from http://servername/reportserver/?/ReportPath/ReportName&rs:Format=PDF

The server will automatically redirect you to the ./Pages/Report.aspx part, but that is really an implementation detail and could change in the future.

|||

Hi

I′ve tested to do it like this and it works if parameters needed for the report are passed in the the url-string.

The problem is if you would like the user to write in a parameter (eg. orderno) to the report, this solution won′t work.

It seems like it have to go through the standard way, via the HTML-page if orderno needs to be set.

Any Ideas how to solve this?

|||

private void CreatePDF()

{

try

{

Microsoft.Reporting.WebForms.Warning[] warn;

string[] streamids;

string mimeType = "application/pdf";

string encoding = string.Empty;

string extension = string.Empty;

byte[] byteViewer;

byteViewer = ReportViewerMain.ServerReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warn);

Response.Buffer = true;

Response.Clear();

Response.ContentType = "application/pdf";

Response.AddHeader("content-disposition", "inline; filename=myReport.pdf");

Response.BinaryWrite(byteViewer);

Response.Flush();

Response.End();

streamids = null;

byteViewer = null;

}

catch (Exception ex)

{

ExceptionManager.Sys(ex);

}

}

|||

Hi there

Should I put this code in custome code? Any references needed?

Possible to OPENXML() from URL?

Is it possible to get the XML Document for a call to OPENXML() from a URL
directly?
Example: I have a .NET web service that returns XML based on parameters
submitted to the URL. I'd like to be able to write a TSQL batch that gets
XML documents from this server and processes them using OPENXML to update
rows in a SQL table.
Anyone ever done something like this?
TIA
Paul
Have you considered using an XML template? Templates accept parameters, much in the same way as stored procedures.
I've written an article on this topic, which you can find at the following URL:
http://www.sqljunkies.com/Article/53...3C8ECACDC.scuk
Hope this helps!
Denise.
Denise E. White
Technical Director
The Next Version UK
www.thenextversion.com
www.denisewhite.co.uk