Prepare hide dialog

Hi,

Is there a way to hide/not show any of the dialogs when printing or exporting?

When calling report.prepare(), a dialog is shown (progress dialog), even though its really quick.

report.PrintSettings.ShowDialog=false, is the only settings I could find, but that dont seem to have any effect on report.prepare();

var report = new Report();
report.Load(@"sample.frx");
report.PrintSettings.ShowDialog = false;
report.Prepare();    // show progress dialog
using (var ms = new MemoryStream())
{
    var pdfExport = new PDFExport
    {
        Name = "Exported",
        Background = true
    };
    report.Export(pdfExport, ms);
    
    File.WriteAllBytes(pdfExport.Name + ".pdf", ms.ToArray());
}

Cheers

Comments

  • Hello!

    To completely suppress all windows and dialogue boxes during `Prepare()` and `PDFExport`, disable the `ShowProgress` flag in `Config.ReportSettings` and in the exporter:

    FastReport.Utils.Config.ReportSettings.ShowProgress = false; // hides the window during `Prepare()`
    report.PrintSettings.ShowDialog = false;
    report.Prepare();
    using var pdfExport = new FastReport.Export.Pdf.PDFExport
    {
    ShowProgress = false, // hides the progress window during export
    Background = true
    };
    report.Export(pdfExport, ms);
    
This discussion has been closed.