Hi pals,
I am asking you for your wisdom: When user click to:
/ReportServer?/test/This+Is+Test&rs:ClearSession=true&rs:Format=PDF&OrderID=532
I want to:
1. define the name of PDF, I have always "This Is Test.pdf" and I want to
change it
let say "Document 532.pdf"
2. open PDF in new window, I don't want open/save dialog
I s there any guide how to do this ?
Thanks a lot, first point is more important to me.
--
BranoIng. Branislav Gerzo wrote:
> Hi pals,
> I am asking you for your wisdom: When user click to:
>
/ReportServer?/test/This+Is+Test&rs:ClearSession=true&rs:Format=PDF&OrderID=532
> I want to:
> 1. define the name of PDF, I have always "This Is Test.pdf" and I
> want to change it
> let say "Document 532.pdf"
> 2. open PDF in new window, I don't want open/save dialog
> I s there any guide how to do this ?
> Thanks a lot, first point is more important to me.
I've done the following:
Create an aspx-page. Put a reference of the reportserver-webservice into
your aspx-page, render the report in the page-load-event and write the data
(byte()-type)
into the response-object. So you can see your report as html
Put another button on your webpage wich will open the same page in another
window, render the report with the needed format (i.e. pdf) and set the
right response.AddHeader settings.
Code-Snippet in my page-load
Dim rservice as New ReportingService
rservice.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim outputdata as byte()
outputdata = rservice.render(all params and settings include
rendering-format etc.)
Dim fileout as string = your needed-filename with extension
Response.Clear
Response.ContentType = 'set here the right mimetype!!!
If mimeType <> "text/html" Then
Response.AddHeader("Content-Disposition", "attachment; filename=" &
fileout)
End If
Response.BinaryWrite(outputdata)
regards
frank
www.xax.de
No comments:
Post a Comment