I would expect a box showing up, asking me either to open or save the
PDF document. But nothing happens, no errors, no nothing?
private void Button1_Click(object sender, System.EventArgs e)
{
Reportservice.ReportingService rs = new
Reportservice.ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
//rs.Url = "http://localhost/ReportServer/ReportingService.asmx";
Reportservice.ParameterValue [] Parameter;
Reportservice.Warning [] Warnings;
string [] StreamIDs;
string Encoding, MimeType;
rs.Render("/Report Project3/Report1", "PDF", null, "", null, null,
null, out Encoding, out MimeType, out Parameter, out Warnings, out
StreamIDs);
}
Please help, im really stuck!
JimboFrom your code it looks like you are writing windows application. Call to
rs.Render returns you byte array with PDF document in it. You ignore return
value, hence no errors or anything. It is your responsibility to take this
byte array and put it in a file. You may change your code to
byte[] result = rs.Render(...
and then use result as you like.
If you want more automation, you can open web browser and point it at
http://localhost/ReportServer?/Report Project3/Report1&rs:Format=PDF
that way you'll see "Save..." dialog without programming it.
--
Dmitry Vasilevsky, SQL Server Reporting Services Developer
This posting is provided "AS IS" with no warranties, and confers no rights.
--
---
"Jimbo" <jimbo_vr5@.hotmail.com> wrote in message
news:1126178576.968569.12620@.z14g2000cwz.googlegroups.com...
>I would expect a box showing up, asking me either to open or save the
> PDF document. But nothing happens, no errors, no nothing?
>
> private void Button1_Click(object sender, System.EventArgs e)
> {
> Reportservice.ReportingService rs = new
> Reportservice.ReportingService();
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
> //rs.Url = "http://localhost/ReportServer/ReportingService.asmx";
> Reportservice.ParameterValue [] Parameter;
> Reportservice.Warning [] Warnings;
> string [] StreamIDs;
> string Encoding, MimeType;
> rs.Render("/Report Project3/Report1", "PDF", null, "", null, null,
> null, out Encoding, out MimeType, out Parameter, out Warnings, out
> StreamIDs);
> }
> Please help, im really stuck!
> Jimbo
>|||Its actually in a web page, but i got it to work now.
Now i have another problem, ive posted it in this group:
<http://groups.google.dk/group/microsoft.public.sqlserver.reportingsvcs/browse_frm/thread/8de9666b2df2bdc1/6b895696b710b2c0?hl=da#6b895696b710b2c0>
Thanks
Regards
Jimmy
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment