Asynchronous Rendering

Tool: Crystal Report 2016

I have created a report with 20 sub reports using 20 stored procedure. Everything is good except performance.

query1: Please help me with clarification. How Crystal processes and render the report.

  1. Run all SP in sequence
  2. Once all Query is completed then after it starts writing the data to canvas of the report.

query2: It is possible that Crystal Reports writes the data one by one to canvas of reports without waiting for completing all queries in the report.


rakeshs13 :india: (BOB member since 2006-08-23)

Crystal reports process the report in different stages. Its easy to understand with the functions we have

  1. BeforeReadingRecords (Prepass1)
  2. WhileReadingRecords(Pass1,Prepass2)
  3. WhilePrintingRecords(Pass2,Pass3)

The database retrieval happens at Pass1. Go through below URL.


anil.ganga1 :us: (BOB member since 2007-07-04)

Another thing to remember, Depending on where the 20 sub-reports are (Page Header, Group Header, Detail, etc.). They may be called multiple times (especially at the detail level). This can greatly affect performance.


kevlray :us: (BOB member since 2010-06-23)

And each time a subreport is rendered, it does it’s own query to the database. Subreport processing happens in pass 2 of the report processing.

Are you using “Page N of M” or “TotalPages” in your report? If you are, try removing it because that will make the report run faster as well. When you use either of those, Crystal has to render ALL of the pages in a report before it can show the first one. If they’re not used, Crystal will render a page at a time, which means that each of the subreport queries probably won’t run until the page where the specific subreport starts.

-Dell


hilfy :us: (BOB member since 2007-04-16)

When I was working for Crystal I ended up writing a UFL that built a text file based on the processing sequence of a report (results were confirmed by the dev team).

A report renders top to bottom, section by section and will process objects in the sequence that they are placed in the section (not the sequence that they actually appear), but subreports run last. Subreports will process in the sequence they were placed too.

Like Hilfy says, removing page N of M will help as it then invokes page on demand and only renders the pages you request.

Crystal will send SQL statements concurrently too (if it can!).


ABILtd :uk: (BOB member since 2006-02-08)