CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2006
    Location
    India
    Posts
    107

    Lightbulb Query in Exporting Report to PDF

    Hi All,

    In my web application I want to programatically export the rdlc file to PDF & save it to the specified destination.

    Below is the code to export the rdlc file:

    Code:
    string mimeType;
    string encoding;
    string fileNameExtension;
    string[] streams;
    Microsoft.Reporting.WebForms.Warning[] warnings;
    byte[] pdfContent = ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out fileNameExtension, out streams, out warnings);
                ////Return PDF
     this.Response.Clear();
     this.Response.ContentType = "application/pdf";
     this.Response.AddHeader("Content-dispostion", "attachment;   filename=SampleExportReport.pdf"); 
     this.Response.BinaryWrite(pdfContent);
     this.Response.End();
    The problem that this code prompts me to Open, Save or Cancel. What modifications are required so that I can save the file without prompting the user to a specific location ...?

    Thanx in advance

  2. #2
    Join Date
    Jan 2008
    Location
    Atlanta, Georgia - United States
    Posts
    75

    Re: Query in Exporting Report to PDF

    You need to use a io.write if you're looking to save it on the web server.
    Consider rating any helpful responses. I do not provide line level response for C#. Get your C# help in the C# forum!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured