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

url parameters in asp.net webtier app

edited October 2005 in Server
l.s.

i am trying to pass a parameters thru the url to a report.
in the webtiercomserver i logged the contents of lParameters. It is filled
and passed to uWebTierModule.WebTier.ProcessWebRequest:

lwResponse := uWebTierModule.WebTier.ProcessWebRequest(lParameters, '');

In rsReportExplorerVolume1BeforePublishReport in dmvolume.pas of
Rboraclereportserver i tested
aEventParams.ReportParameters.Count and
aEventParams.sessionParameters.Count both are empty.

where and how can i access the parameters witch i passed to
uWebTierModule.WebTier.ProcessWebRequest?
i tried several things with your examples "customparameters" but i dont have
a form i want to access the report immediatly and pass an organisation id in
the url.

can you give me some hints?

thanx in advance

Ruud

Comments

  • edited October 2005

    The RBServer\Demos\WebTier\CustomParameters demo shows how to do this. (You
    need also run the RBServer\Demos\Server\CustomParameters server app).

    Here is a brief overview:

    1. Create a TrsWebRequest object. Pass the url parameters to the
    constructor.

    var
    lWebRequest: TrsWebRequest;
    begin

    {use the incoming request parameters to create a TrsWebRequest}
    lWebRequest := rsWebTier1.CreateWebRequest(Request.QueryFields,
    Request.Content);

    end;

    2. See the online help topic for TrsWebRequest. Note that its
    ContentParameters[] array property contains the url params received from the
    web browser (i.e. the ones you passed in the constructor).

    In your custom webtier logic you can read these parameters and use them to
    populate the WebRequest SessionParameters[], ServiceParameters[], and
    AutoSearchParameters[] arrays - which will be sent to the report server. The
    ServiceParameters[] array property can be used for custom report parameters.
    The SessionParameters[] array property can be used for custom session
    parameters. There is also an AutoSearchParameters property.

    3. The WebTier.ProcessWebRequest method is overloaded. You can pass it the
    WebRequest object

    myWebTier.ProcessWebRequest(myWebRequest);





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



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2005
    Hi Nard,

    thanx for the quick response: My problem is how to fit it in the
    webtiercomserver.
    It has a datamodule. The demo RBServer\Demos\Server\CustomParameters has
    a webmodule.
    So in webtiercomserver there is no action editor and i have no params like
    Request.QueryFields and Request.Content.

    Ruud


  • edited October 2005

    For the WebTierComServer example, the TRBWebTier.ProcessWebRequest method is
    being called rather than a web module action. The QueryString and
    ContentString parameters are parsed into a Parameter list. You can pass this
    list to the constructor of a WebRequest object.

    function TRBWebTier.ProcessWebRequest(const QueryString,
    ContentString: WideString): WideString;
    begin

    lParameters := TStringList.Create;

    lsQueryString := QueryString;
    lsContentString := ContentString;

    TrsWebRequestParser.ParseContent(lsQueryString, lParameters);
    TrsWebRequestParser.ParseContent(lsContentString, lParameters);

    {******use the incoming request parameters to create a TrsWebRequest}
    lWebRequest := rsWebTier1.CreateWebRequest(lParameters, nil);

    {*****add logic here to read the webrequest.ContentParameters and populate
    the webrequest SessionParameters and ServiceParameters }


    lsResponse := uWebTierModule.WebTier.ProcessWebRequest(lWebRequest);

    lwResponse := lsResponse;

    Result := lwResponse;

    finally
    lParameters.Free;
    end;



    end;



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


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited October 2005
    Nard,

    Thanx for your explanations,
    i was totaly on the wrong track (read lost) working too complicated.
    I added your code line:
    lWebRequest := rsWebTier1.CreateWebRequest(lParameters, nil);
    then added the parameter using
    lWebRequest.SessionParameters.Add('onderdeel',value);
    and that was all i needed.

    thanx again for your input efforts

    Ruud

This discussion has been closed.