This is a migrated thread and some comments may be shown as answers.

Bulk Report Generation

4 Answers 162 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 16 Aug 2013, 03:43 PM
I'm doing a proof of concept where I'm switching out RDLCs for Telerik Reporting in a server-side bulk report generation system. The output is PDFs.

The system is currently multi-threaded to take advantage of the fact most customers run this on servers with 16+ cores.

I'm looking for guidance as to what parts of Telerik reporting are thread safe. Specifically, can I cache a single instance of ReportProcessor and use that across multiple threads?

Are there any best practices related to this type of deployment?

In my case, there is a single report (which ahs 7 sub-reports) that makes up the output of the process. The report itself never varies - only the data for the report.

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 21 Aug 2013, 02:52 PM
Hello Robert,

Telerik Reporting is thread safe, so you should not experience issues when rendering reports in batch process. Test on your end and let us know if you notice any problems.

Regards,
Peter
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

0
Thales
Top achievements
Rank 1
answered on 28 Mar 2017, 03:01 PM

I'm having some problem with Telerik Reporting when I'm using the Parallel.ForEach to generate the reports.

If I use one ReportBook with 200 reports inside, it usually takes 2 minutes to generate the report. But when I use 200 ReportBooks with Parallel.ForEach, It usualy takes 20 seconds (and merge the result with iTextSharp), it takes like 20 seconds.

My problem is that sometimes I get a null pointer inside the RenderReport method. Here is the call stack:

at Telerik.Reporting.Processing.Common.FontContainer.GetFontDef(String fontName, FontStyle fontStyle)
   at Telerik.Reporting.Processing.Common.FontContainer.FillBuffer(Font gdiFont, Byte[]& buffer)
   at Telerik.Reporting.Pdf.Fonts.TrueType.FontReader.GetFontData(Font font, Boolean& isTTC)
   at Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeDescriptor..ctor(Font gdiFont)
   at Telerik.Reporting.Pdf.PdfFontTable.GetDescriptor(PdfFont font)
   at Telerik.Reporting.Pdf.PdfFontDictionary..ctor(PdfDocument document, PdfFont drawingFont)
   at Telerik.Reporting.Pdf.PdfFontType0Dictionary..ctor(PdfDocument document, PdfFont font)
   at Telerik.Reporting.Pdf.PdfFontTable.GetFont(PdfFont font)
   at Telerik.Reporting.Pdf.PdfPageDictionary.GetFontName(PdfFont font, PdfFontDictionary& fontDictionary)
   at Telerik.Reporting.Pdf.Rendering.PdfRendererGraphicsState.Update(PdfFont font, Brush brush, Int32 renderMode)
   at Telerik.Reporting.Pdf.Rendering.PdfRenderer.Update(PdfFont pdfFont, Brush brush, Int32 renderMode)
   at Telerik.Reporting.Pdf.Rendering.PdfRenderer.DrawString(String text, PdfFont pdfFont, Brush brush, RectangleF rect, Boolean rightToLeft)
   at Telerik.Reporting.ImageRendering.CanvasPdf.DrawRegularChunk(String text, Font font, Brush brush, RectangleF rect, TextFormat textFormat)
   at Telerik.Reporting.ImageRendering.CanvasBase.DrawStringMultiline(String s, Font font, Brush brush, RectangleF rect, TextFormat format, Boolean isFinalTextChunk)
   at Telerik.Reporting.ImageRendering.DocumentBase.WriteText(String text, RectangleF bounds, IFont font, Color foreground, TextFormat format, Matrix transform, Boolean isFinalTextChunk)
   at Telerik.Reporting.Writing.TextBoxWriter.WriteContent(DocumentWriter writer, TextBox textBox, ElementPageInfo pageInfo)
   at Telerik.Reporting.Writing.ProcessingContentElementWriter`1.WriteContent(T element, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.ProcessingElementWriter`1.Write(T element, ElementPageInfo pageInfo, DocumentWriter writer)
   at Telerik.Reporting.Writing.WriteOperationsDispatcher.Visit(TextBox textBox)
   at Telerik.Reporting.Processing.ProcessingElementVisitor.Visit(LayoutElement element)
   at Telerik.Reporting.Writing.DocumentWriter.Telerik.Reporting.BaseRendering.IWriter.WriteStartElement(LayoutElement element, ElementPageInfo pageInfo)
   at Telerik.Reporting.Paging.PageElementLayer.AddToPage(IPageHandler handler)
   at Telerik.Reporting.Paging.PageElementManager.AddToPage(IPageHandler handler)
   at Telerik.Reporting.Paging.PageCompositionBase.SendPhysicalPages()
   at Telerik.Reporting.Paging.PageCompositionBase.OutputPage()
   at Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(LayoutElement root, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback, PageSettings pageSettings)
   at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback)
   at Telerik.Reporting.Processing.ReportProcessor.RenderCore(ExtensionInfo extensionInfo, IList`1 reports, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo)
   at WebHistoricoEscolar.WebHistoricoEscolarLoteGraVisualizacao.ExportToPDF(ReportBook reportBook)
   at WebHistoricoEscolar.WebHistoricoEscolarLoteGraVisualizacao.<>c__DisplayClass3.<Page_Load>b__1(AlunoGra alunoBuscado, ParallelLoopState state)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object )
0
Thales
Top achievements
Rank 1
answered on 28 Mar 2017, 03:03 PM
locking this method I don't get the exception, but I lose part of the performance gain. So i'm looking into other solutions.

reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo);
0
Katia
Telerik team
answered on 29 Mar 2017, 11:41 AM
Hello Thales,

Check an update in support ticket #1100773 you opened on the same question. For other community members experiencing the same issue, below is the reply from the ticket:

"This was a known issue introduced with private fonts feature in R3 2016 release. We have already provided a fix in the latest internal build (11.0.17.323).
You can download in from your Telerik account - Downloads - Reporting. After installing this build, make sure you have updated Telerik Reporting references with Upgrade Wizard."


Regards,
Katia
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Peter
Telerik team
Thales
Top achievements
Rank 1
Katia
Telerik team
Share this question
or