.net app to render SSRS report C#

I needed to write a c# app to render a SSRS report in PDF.

Found sample code here and customized it:

        protected void ExportReport(object sender, EventArgs e)
            Microsoft.Reporting.WinForms.Warning[] warnings;
            string[] streamids;
            string mimeType;
            string encoding;
            string extension;

            byte[] bytes = this.reportViewer1.LocalReport.Render(
               "Excel", null, out mimeType, out encoding,
                out extension,
               out streamids, out warnings);

            FileStream fs = new FileStream(@"c:\output.xls",
            fs.Write(bytes, 0, bytes.Length);


Works great!  Just need to try PDF now.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Thoughts to Ponder