Multithreading
Hello there,
we want to process some document generation requests in a parallel manner, using more than one thread to generate pdf files via FastReport. I did not find many facts to that, neither in this forum nor in the documentation.
Basically, i call this method inside my started Task instances:
At first, i got some Nullpointer exceptions in my tests (basically 10 threads running that code) deep down inside the FastReport methods.
I found out that you have to turn ShowProgress / ShowPerformance to False.
It seems to work with that, but i would like to be sure. Do I also have to do something else, or is this really all if trying to use FastReports with multiple threads? Are there any other caveats that should be mentioned?
Thanks in advance for any hints. [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Best regards Udontknow[/img]
we want to process some document generation requests in a parallel manner, using more than one thread to generate pdf files via FastReport. I did not find many facts to that, neither in this forum nor in the documentation.
Basically, i call this method inside my started Task instances:
      public void GenerateDocument(Stream targetStream, FastReportEngineConfiguration configuration, DataSet dataset)
      {       Â
        using (var report = new Report())
        {
            report.Load(configuration.ReportTemplatePath);
            report.RegisterData(dataset);
            report.Prepare();
            using (var export = new PDFExport())
            {             Â
              report.Export(export, targetStream);
            } Â
        }
      }
At first, i got some Nullpointer exceptions in my tests (basically 10 threads running that code) deep down inside the FastReport methods.
I found out that you have to turn ShowProgress / ShowPerformance to False.
        Config.ReportSettings.ShowProgress = false;
        Config.ReportSettings.ShowPerformance = false;
It seems to work with that, but i would like to be sure. Do I also have to do something else, or is this really all if trying to use FastReports with multiple threads? Are there any other caveats that should be mentioned?
Thanks in advance for any hints. [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Best regards Udontknow[/img]