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

Session Process and Changing Databases

edited April 2003 in Server
Hello,

I have a multi-database mysql system that I'm having some trouble with and
am hoping someone can help me out.

The application only has one form and one datamodule. The application is
running over a brower using the rsWebTier along with Custom Parameters to
send the rsServer the name of the Database that the end user needs to view.
I am able to read the database value in using the
rsServerValidateSessionParameters event. From there I can set a global
variable that is read in the onCreate event when the datamodule is loaded
which allows me to set the mysqldatabase.databasename :=
global_variable_database. The report goes through and I get the reports I
want.

My problem occurs when there are 2 users. Here is what is happening

1. First user comes in and has the explorer up and running but doesn't open
a report.
2. Second user comes in and runs a report for a different database.
3. Now when the first user runs a report they receive the database
information from User 2.

I need to be able to manage multiple sessions so that each person can view
there own data. I have no idea at how to do this. Are the sessions managed
from the webtier side or the rsServer side? How do I open a single
datamodule in multiple session with unique database connections? Any help
would be greatly appreciated.

Thanks,

Bill

Comments

  • edited April 2003

    The client's session parameters are passed to the ReportVolume events. The
    ReportVolume resides on the DataModule thus enabling event-handler code to
    be implemented to perform the type of operations that you are describing.

    Use the ReportVolume.BeforePublishReport event if need to apply the database
    params just before running the report. As described in the online help, the
    signature of this event looks like

    procedure (Sender: TObject; aEventParams:
    TrsBeforePublishReportEventParams)

    The aEventParams object provides access to the SessionParameters and
    ReportParameters, etc. (again see the online help)

    For an example, see RBServer\Demos\Server\Custom Parameters. Open the
    rbReportTemplateVolume.pas unit.



    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2003
    Reading and applying the session parameters in the
    ReportVolume.BeforePublishReport event worked perfectly.

    Thank you,

    Bill

This discussion has been closed.