.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

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.