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

Problem loading template with runtime created report

edited February 2016 in RAP
Hi,

I have one problem and I don't know how to solve it.
I have created rtm file and saved it to disk.
In delphi code I create report and all data-aware components runtime.
I set select for query, and load template to report.
When calling print, I get error in RAP code (Could not compile program:
varTimeOnCalc) where I access plPrint (data pipeline from design).

How to solve this? I understand, that RAP tries to access plPrint
component, but I gave name and username properties of datapipeline
"plPrint". And I think, that all components are connected.

Best regards, Tone

Comments

  • edited February 2016
    Hi Tone,

    1. The DataPipeline, Report etc need to be Owned by the Form/DataModule.

    myDataPipeline := TppDBPipeline.Create(Self);
    myReport := TppReport.Create(Self);

    etc...


    2. If you are using RB 17.01, make sure you download build 2. When it
    installed, the Designer Help | About will read Version 17.01 Build 65.






    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2016
    Hi,

    ok, that explains a lot. And it makes thing more complicated since I use
    this in service application (web server to be exact) and I need each
    report to run in it own thread.
    I'll create datamodule in each client thread.

    Thanks, Tone


  • edited February 2016
    Hi Tone,

    RB Server Edition implements a multi-threaded report service and a webtier.

    RB 17 Enterprise includes some REST Services and mobile Client components.

    For building multi-threaded Delphi applications the recommended architecture
    is to create a TDataModule descendant. Its simplest to do it at Delphi
    design-time. Create a TDataModule descendant, call it TMyReportModule. Put
    the Database Connection, Report components on the module. Add one or more
    public methods to do what you need.

    For each service request, create an instance of the TmyReportModule, call
    the public method(s), then free the module.

    lReportModule = TMyReportModule.Create(nil)

    try
    lResponse := lReportModule.ProcessMyRequest(some parameters here);

    finally
    lReportModule.Free

    end;



    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited February 2016
    Hi,

    yes, that is exactly what I did. And it's working without problem.
    Thanks.

    Best regards, Tone

This discussion has been closed.