Home General

RB17 - Need example for Rest with Parameter

edited November 2015 in General
Hi

I'm using RB17 Server

i don't found an updated example for Rest ( RB Rest Server > RB fmx
client ) with Parameter.

Are there any updated wiki link?




Mauro Botta

Comments

  • edited November 2015
  • edited November 2015

    rbRestClient_Tablet.BaseURL :=
    http://localhost:8080/RBServices?typecode="name, age";


    don't work
  • edited November 2015
    Hi Mauro,

    While it is possible to update report parameter values directly with the
    REST server call, it is best to use the TrbRestClient object to handle
    this. The client's DocumentService now has a ReportParameters property
    which is populated once a report is assigned. This is generally handled
    by the Mobile Explorer but can also be done in code.

    Client.DocumentService.SelectReport(ReportName); //Select a report

    Client.DocumentService.ReportParameters.ItemByName['MyParam'].Value :=
    'ParamValue'; //Assign a param value

    lURL := Client.DocumentService.GetDocumentURL; //Get the resulting URL

    I suggest spending some time with the installed REST demos to
    understand how it is meant to be used.

    We added a number of parameter enabled examples in the Report Files
    server example. You could start by running this server demo, then
    running one of the client demos (Tablet, or Phone) to see how the Client
    object interacts with the server.

    You will notice that each report in the example now has a "search"
    counterpart which includes report parameters.


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2015

    in rb client example i have this:



    i need here login my customers

    // rbMobileExplorer_Tablet.param.add('login=xxxxx'); ?????
    // rbMobileExplorer_Tablet.param.add('password=qqqqqq');

    rbMobileExplorer_Tablet.Execute;

    on server side i need read these parameters.


    My customers can send to my cloud server their reports pdf,( 100
    customers = 100 directories ) then from App-RB-REST i must know my
    customer login for resend only their reports files.


    how do it ?









    Nico Cizik (Digital Metaphors) ha scritto:
  • edited November 2015
    Hi Mauro,

    The current release supports the manipulation of Report Parameters
    (TppReport.Parameters) only. This gives the client the ability to alter
    and update the report output based on parameter values sent to the
    server which is similar to the AutoSearch feature in ReportBuilder and
    RB Server.

    Server specific parameters, or what are known as "Session" parameters in
    RB Server, are not yet implemented. These would allow you to set up
    specific parameters on the server such as login information etc.

    Session parameters for the FMX REST Server feature will be added for a
    later release of ReportBuilder.

    Currently you could create a separate root directory for each user and
    set up the Client to only access that directory for each specific user.
    Do this by assigning the Client.DocumentService.DirectoryName property.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.