.Net Framework - print a report without user interface

Hi,

I am using VS2022 to print a report (or create a PDF) from an app without a user interface - it will run twice a day (using task scheduler), get data from an SQL DB, generate a report, export it to PDF and send it by email.

I managed to do this, however, when I call FastReport.Prepare a windows is shown briefly.

Is there any way that FastReport.Prepare runs without any user interface?

TIA,

Carlos

Comments

  • Carlos,

    Try adding the line below BEFORE making the call to prepare the report.

    FastReport.Utils.Config.ReportSettings.ShowProgress = False

    FastReport.Prepare()

  • yes, somethig like this,

    exportpdf = new PDFExport();

    exportpdf.ShowProgress = false;

    exportpdf.Compressed = true;

    exportpdf.Background = false;

    exportpdf.TextInCurves = false;

    exportpdf.PrintOptimized = true;

    exportpdf.ImagesOriginalResolution = false;

    exportpdf.ColorSpace = PDFExport.PdfColorSpace.RGB;

    exportpdf.JpegCompression = true;

    exportpdf.EmbeddingFonts = true;

    FastReport.Utils.Config.ReportSettings.ShowProgress = false;


    ResultFile = new MemoryStream();

    fastReportObject.Prepare();

    fastReportObject.Export(exportpdf, ResultFile);// export fastreport object to pdf   


    Best Regard

    Jai

Leave a Comment