Home Component Writing
New Blog Posts: Merging Reports - Part 1 and Part 2

Custom component rendering on subreports

Greetings,

I have a custom component that uses TCollection and TCollectionItems. It renders just fine in the designtime and runtime print previewers on a one page report with thumbnails visible. It won't render on the print previewers if it is on a subreport unless I set the previewformsettings.singlepageonly to true. This, of course, does not allow thumbnails in the previewer. It renders just fine to the printer in any case.

What steps must I take in order for the component to render on a subreport in the previewrs with thumbnails?

Best Regards,
Tommy

Comments

  • Hi Tommy,

    Subreports are simply virtual containers and do not have a role in page rendering. Generally if something works with SinglePageOnly but doesn't without, it is a threading issue. The fact that the component is in a subreport is likely a coincidence.

    The multi-page screen device uses what we call the threaded page cache to generate pages in a background thread. If your component is not thread-safe or is perhaps accessing data from the main thread, problems can arise.

    I suggest working through your component's code and simplifying it to see where the problem might lie. Start with something that just displays static information then move forward from there to isolate the issue.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hi Nico,

    Thank you very much.

    Best Regards,
    Tommy
  • Hi Nico,

    I fixed the problem.

    I had one line of code in my components DrawCommandClass unit that was incorrect (synaptic breakdown in my brain). In its Assign procedure I was loading the component from its stream rather than saving it to its stream. Once corrected the component renders correctly in and on all reports and subreports without error.

    I'm always appreciative of your help and support.

    Best Regards,
    Tommy
Sign In or Register to comment.