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

Server explorer volume and loading a report

edited September 2003 in Server
I have modifed the rbMSSQLServerReportServer demo to point to our database
with no problems. I am new to the server side, but since it also has an
"item" pipeline and has a template field indicator, do I need to do anything
else for it to load the reports?

When trying to open a report I get:
Server Error: Processing request for report explorer database
blah\blah\blah/blah, ppReport2.OnstartPage: Invalid property value.

Where is this ppReport2 and what do i need to set on its OnStatrPage? What
am I missing? Is this explorer demo just for exploring and not for openning
a report?

Also, the folder and template information is in one database on our server
and the tables and fields that the reports feed off of are in a different
database. How do I tell/point the server to get the reports' data from
elsewhere once it loads the template of a report?

So close, yet so far away :)

Comments

  • edited September 2003

    I recommend that you first spend some time with the RBServer\Developers
    Guide\RBServer.pdf. There is a tutorial called "Building a Report Server
    Application for an Explorer Database".

    The DataModule that contains the ReportExplorerVolume component must
    provide a thread-safe environment for the execution of the reports.

    The report loading error that references Report.OnStartPage, indicates
    that the report contains an event-handler reference that cannot be
    resolved. Most likely, your end-user application contains some
    event-handlers. One solution is code the event-handlers in RAP so that
    the code is saved with the report. Another solution is to copy the
    event-handler code from the end-user solution to the datamodule
    containing the ReportExplorerVolume.






    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2003
    Hello again,

    I have read, reread, and read the documentation several times now and am no
    closer to an answer than before. I have looked at anything in the demos and
    tutorials that seemed related and I just didn't see anything that shows how
    to connect an event to a report.

    Sure I can find out what the events used to do and replicate them on the
    server, or try to at least, but I still have no clue how to connect an event
    handler to a report template saved in the database. In the non-server
    version, you put a ppReport on the form and use it. I see no talk of that
    in the server version. Seems like these report objects are created at run
    time and executed. If so, how do I set their even handlers??

    The most related thing I found in the documentation was "Registering Reports
    With The Server" which says to put a rsReportTemplateVolume on the
    datamodule in order the connect the events. I don't see nor understand how
    putting another volume component connects anything with anything else.
    Generally for an event handler, like OnStartPage, to be fired it needs to be
    set to a corresponding method.

    Where/how do I connect these event handlers in a server application??

    Thanks.



  • edited September 2003

    1. When you save a report template, the names of the report
    event-handler methods are saved as part of the report definition. When
    the report loads, the Delphi streaming system will try to resolve the
    reference by looking at the Report.Owner for a published method with the
    same name.

    In the case of the server, the TppReport object created by the report
    service is Owned by the DataModule that contains the ReportVolume
    component. Thus by defining the report event-handlers as published
    methods of the DataModule the event-handlers will be attached to the
    report automatically when it loads.

    There is an example of this in the RB Server tutorials.

    2. If you prefer to programmatically resolve the event-handler
    references after the report loads, you can do this as well.

    A. Use the ReportTemplateVolume.OnLoadReportEnd event. The Sender
    parameter is the TppReport object - you will need to typecast it.

    B. Use the ReportTemplateVolume.BeforePublishReport event. The
    aEventParams object provides access to the TppReport and to
    SessionParameters and ReportParameters. See
    TrsBeforePublishReportEventParams in the RBServer.hlp.









    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.