Generate report as PDF and save

mohanarajmohanaraj 600001
edited 3:16PM in FastReport .NET
Dear all,

How can we Generate report as .PDF file without view the report and save to default location (user can not select the location ie the save dialog popup is absent file saved in programmer given location in code itself in asp.net )

Please advise.

Thanks in advance.

Comments

  • edited 3:16PM
    Hello,

    Please look at Demos\C#\ExportToPDF demo.
  • mohanarajmohanaraj 600001
    edited November 2009
    AlexTZ wrote: »
    Hello,

    Please look at Demos\C#\ExportToPDF demo.

    Dear Alex,

    I create report and save successfully with the reference of above mentioned demo.
    But i want to add the header, summary band to this report how i can achieve?
    I tried like

    Report FReport = new Report();
    ReportPage page = new ReportPage();
    page.Name = "page1";
    FReport.Pages.Add(page);

    page.ReportTitle = new ReportTitleBand();
    page.ReportTitle.Height = Units.Millimeters * 63;
    page.ReportTitle.CreateUniqueName();

    But the title band and others are not add to the created pdf report page.


    Please advise.

    Thanks in advance.
  • edited 3:16PM
    It should work. Could you send me the code of your project?
  • mohanarajmohanaraj 600001
    edited 3:16PM
    AlexTZ wrote: »
    It should work. Could you send me the code of your project?


    Dear Alex,

    Hear with i attach my application in this please run the application as website and then click the mail icon it will create the report .pdf file in this there is no header and summary band occurs i wrote the code for it please investigate my code and advice me where it goes wrong.
  • edited 3:16PM
    Hello,

    Here is the corrected code:
        protected void imgEmail_Click(object sender, ImageClickEventArgs e)
        {
            Report FReport = new Report();
            // comment this
            //ReportPage page = new ReportPage();
            //page.Name = "page1";
            //FReport.Pages.Add(page);             
           
    
            #region Register Data
            FReport.Load(Server.MapPath("~\\App_Data\\AllCallDetailHeaderDetail.frx"));
            // add this
            ReportPage page = FReport.Pages[0] as ReportPage;
    ...
    
  • edited July 2013
    i think we can find a way to generate and save at the same time
  • edited 3:16PM
    here is some samples you can use to generate pdf in vb.net, you can also use some windows pdf viewer to check and edit you pdf reports.
    Dim pdf As New RasterEdgePdfCreator()
    Dim xml As New RasterEdgeXmlDocument()
    Dim xslt As New RasterEdgeXmlDocument()
    xml.Load(@C/1.xml)
    xslt.Load(@C:/1.xslt)
    doc.BindFO(xml, xslt)
    doc.IsTruetypeFontMapCached = true

    doc.TruetypeFontMapPath = (@d:/pdf/)
    doc.Save(@C:/"T.pdf", SaveType.OpenInAcrobat,Response)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.