This is a multi-part message in MIME format.
------=_NextPart_000_000E_01C59852.F76E5330
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I'm trying to display a report created in RS in my ASP.NET app via the =
web service call. HTML and CSV formats return fine, however, if it's =
Excel or any other binary format, it can't seem to encoded correctly. =
The following is the code in my ASPX page. Though I specified content =
disposition, it still displays the scrumbled text in the browser rather =
than promoting for saving the file.
private void Page_Load(object sender, System.EventArgs e) {
ReportingService rs =3D new ReportingService();
s.Credentials =3D System.Net.CredentialCache.DefaultCredentials;
Byte[] rpt
string encoding;
string mimeType;
ParameterValue[] reportHistoryParameters =3D null;
Warning[] warnings =3D null;
string[] streamIDs =3D null;
rpt=3D rs.Render("/Report Project1/LCC Test 1", "EXCEL", null, =
null
null,null, null, out encoding, out mimeType, out =
reportHistoryParameters,
out warnings, out streamIDs);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; =
filename=3Dfoo.xls");
Response.ContentType =3D mimeType;
Response.BinaryWrite(rpt);
Response.End();
}
------=_NextPart_000_000E_01C59852.F76E5330
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>I'm trying to display a report created in RS in my ASP.NET app via =
the web=20
service call. HTML and CSV formats return fine, however, if it's =
Excel or=20
any other binary format, it can't seem to encoded correctly. =
The=20
following is the code in my ASPX page. Though I specified content=20
disposition, it still displays the scrumbled text in the browser rather =
than=20
promoting for saving the file.</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>private void Page_Load(object sender,=20
System.EventArgs =
e) {<BR> =20
ReportingService rs =3D new=20
ReportingService();<BR> =
s.Credentials=20
=3D System.Net.CredentialCache.DefaultCredentials;</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2> Byte[]=20
rpt<BR> string=20
encoding;<BR> string=20
mimeType;<BR> ParameterValue[] =
reportHistoryParameters =3D =
null;<BR> =20
Warning[] warnings =3D =
null;<BR> =20
string[] streamIDs =3D null;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2> rpt=3D=20
rs.Render("/Report Project1/LCC Test 1", "EXCEL", null,=20
null<BR>  =
;=20
null,null, null, out encoding, out mimeType, out=20
reportHistoryParameters,<BR> &nb=
sp; =20
out warnings, out streamIDs);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2> =20
Response.Clear();<BR> =20
Response.AddHeader("Content-Disposition", "attachment;=20
filename=3Dfoo.xls");<BR> =20
Response.ContentType =3D =
mimeType;<BR> =20
Response.BinaryWrite(rpt);<BR> =
Response.End();<BR>}</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_000E_01C59852.F76E5330--