about pdf output and printing process with c#

edited 3:13PM in FastReport .NET
hello,

I can't get pdf output with fastreport. There are very few examples of this. Examples of all web projects. I dont understand. Can you share an example on this? Or tell me what to do? :angry:" border="0" alt="mad.gif" />" alt=">" />

Comments

  • edited 3:13PM
    It is realy simple

    FastReport.Export.Pdf.PDFExport export = new FastReport.Export.Pdf.PDFExport();
    YourReport.Export(export, PDFName);

    Thats it
  • Hello!

    A minimal working example for C# (WinForms / Console / Desktop) exporting a report to PDF and sending it to print:

    using var report = new FastReport.Report();
    report.Load(“report.frx”);
    report.RegisterData(myDataTable, “Data”);
    report.GetDataSource(“Data”).Enabled = true;
    
    report.Prepare();
    
    // 1. Export to PDF:
    using var pdf = new FastReport.Export.Pdf.PDFExport();
    report.Export(pdf, “output.pdf”);
    
    // 2. Print to a printer (set PrintSettings.ShowDialog = false if necessary):
    // report.PrintPrepared();
    
This discussion has been closed.