Home Server

Customs Parameters

edited March 2003 in Server
Hello,

I would like someone to calrify something for me. After a lot of tinkering
with RBServer Edition, it seems that I have to set SessionParameters and
ReportParameters in their corresponding OnValidate Event? Example:

procedure TForm1.rsServer1ValidateSessionParameters(Sender: TObject;
aParameters: TppParameterList; var aIsValid: Boolean);
begin
{validate the parameter names}
aIsValid := (aParameters.InList('Parameter1') and
aParameters.InList('Parameter2'));
if aIsValid then begin
rsServer1.SessionParameters['Parameter1'].Value :=
aParameters['Parameter1'].Value;
rsServer1.SessionParameters['Parameter2'].Value :=
aParameters['Parameter2'].Value;
end
end;

Is this correct? It seems to be the only way it actually works.

Thank you,

Tracy McClarnon

Comments

  • edited March 2003


    Does anyone have a simple example of a report server that receives session
    parameters and report parameters from a client application? I know the demos
    do this, but I feel that they are a bit too complicated in getting the point
    across. Any help would be greatly appreciated. It would be even better if
    you included the server and client code.

    You can send your examples to tmcclarnon@mccallie.com.

    Thank you


  • edited March 2003

    Perhaps you are missing a conceptual understanding of the architecture.

    ---------------------------------------------------------------------
    Article: Overview of Custom Parameters Architecture
    ---------------------------------------------------------------------


    I. SessionParameters
    --------------------

    1. Each time a client communicates with the server, the client must send the
    session id.

    2. Each time the server receives a client request, it authenticates the
    request. These are the possible cases:

    a. No session id specified or invalid session id specified
    Validate the session parameters passed from the client. If valid, then start
    a new session and generate a new session id. The session id will passed
    back to the client.

    b. Existing session, no session parameters specified or same session
    parameters specified.
    Use the session parameters for the existing session.

    c. Existing session, new session parameters specified.
    Validate the new session parameters.

    3. The SessionParameters are always passed to the custom parameters related
    events.

    a. For the TrsServer events such as OnValidateSessionParameters, the session
    parameters are passed in the "aParameters" parameter.

    b. For the TrsReportVolume events, there is an "aEventParams" parameter that
    contains a SessionParameters property (i.e. aEventParams.SessionParameters).
    Note that the aEventParams object contains a different set of properties
    depending upon the report volume event. The specific properties are
    documented in the online help


    II. ReportParameters
    --------------------

    ReportParameters are only relevant to a request for a specific report. The
    relevant ReportVolumeEvents that are provided are: OnGetReportParameters,
    OnValidateReportParameters, and BeforePublishReport. Each of these events
    passes an "aEventParams" object to the event-handler that contains the
    SessionParameters, ReportParameters, and other information. Again, note that
    the aEventParams object contains a different set of properties depending
    upon the report volume event. The specific properties are documented in the
    online help.

    The ReportParameters passed from the client are automatically assigned to
    the TppReport.Parameters property. In the server custom parameters demo, the
    ReportTemplateVolume.BeforePublishReport event is implemented to add the
    session parameters to the TppReport.Parameters.



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2003
    Thank you for the response, but I am still encountering a few problems:

    1. Whenever I call GetReportParameters from the client, I always receive 4
    parameters named "ppParameter1".."ppParameter4" even though I have given
    totally different names to the TppReport.Parameters via the ParametersEditor
    on the server.

    2. GetSessionParameters returns exactly the same Parameter Names I gave in
    the SessionParametersEditor on the server. This is Fine, it just confuses me
    when #1 above doesn't work the same way.


  • edited March 2003
    Are these statements true?

    1. TrsServer.SessionParameters values aren't automatically set to the
    SessionParameters values received from the client.
    2. TppReport.Parameters values aren't automatically set to the
    ReportParameters values received from the client.

    Thanks again for your time...

  • edited March 2003

    1. True. TrsServer is a singleton - there is only one. There can
    simultaneously be many clients connected to the server. The
    SessionParameters sent from the client can only be accessed in the Server
    and ReportVolume events that I mentioned in the article. The Server events
    only fire when a new session id needs to be allocated. They do not fire for
    each client request received from the server. In other words, session
    authentication occurs only once - at the beginning of the session.

    2. False. The ClientReport.ReportParameters are assigned to the
    Report.Parameters prior to calling the ReportVolume.BeforePublish event.

    It would help me to know what you are trying to accomplish...



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2003
    What I am trying to do is run a report from an IntraWeb application.

    I need to pass parameters to the server (that is running as a service on a
    seperate machine) to initialize query parameters before they are opened for
    the report. I have placed a TrsWebTier inside my IntraWeb app and am trying
    view the report in my web browser. I can access the report perfectly using
    TrsClientReport, but I am having difficulty accessing the report via the
    TrsWebTier comp.

    Does this make sense?

  • edited March 2003

    I recommend that you try to approach this incrementally:

    1. Build a simple ClientReport application that uses custom parameters
    (sounds like you may have already have done this).

    2. Build a simple WebTier application using a Delphi WebDugger application.
    (i.e. no IntraWeb).

    3. The final step would be to introduce the IntraWeb piece.

    Keep in mind that the ClientReport is persistent - its property values
    reflect the current SessionID, SessionParameters, ReportParameters being
    used. The WebTier is more like a server. It simultaneously handles request
    for many "web sessions". A web session is NOT the same as a report session.
    Each web session can however cache information about the report session.

    report server
    sessions

    webtier
    web sessions


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited March 2003
    Thanks for all your help! One more question...

    Should I have 3 applications? A report server(Service), WebTier(ISAPI), and
    a client (IntraWeb)?

  • edited March 2003

    I honestly do not know whether you should have separate WebTier(ISAPI) and
    (IntraWeb) applications or just use the WebTier component within the
    IntraWeb application. I do not have any real experience with IntraWeb.

    Try to spend some time with the WebTier custom parameters demo. Read all of
    the comments in the code. You need to understand that there are hidden
    parameters used in the html forms. Run the example and perform a view
    source on the generated html forms.



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

    Best regards,

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