Variables on mobile reports

Stimulsoft Reports.WEB discussion
Post Reply
User avatar
ChrisCookDev
Posts: 41
Joined: Sun May 20, 2012 7:07 pm
Location: UK

Variables on mobile reports

Post by ChrisCookDev »

Hi please can you advise the best way to implement user input variables on mobile reports. For example http://mobile.stimulsoft.com/Default.as ... ingCountry

When I request user input variables using the StiWebViewer the user input works fine on the report. But when I try this using the mobile viewer the user inputs are not shown. Do I have to manually code the HTML input boxes and then request the report again using Ajax and passing the values in the URL? or is there a better method which is inbuilt into Stimulsoft?

Many thanks
Chris
Chris Cook :: Software Development Manager :: www.genesisit.co.uk
Design, Develop, Deliver! :: App development for smartphones, tablets, the desktop and the web
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Variables on mobile reports

Post by HighAley »

Hello.

You should use GetReportData event to get data for variables requested by user. Here is a sample code of this event:

Code: Select all

    private string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);

    protected void StiMobileViewer1_GetReportData(object sender, StiReportDataEventArgs e)
    {
        DataSet data = new DataSet();
        data.ReadXml(appDirectory + "\\Data\\Demo.xml");

        e.Report.RegData(data);
    }
Also you should add next code to the aspx page:

Code: Select all

OnGetReportData="StiMobileViewer1_GetReportData"
Thank you.
User avatar
ChrisCookDev
Posts: 41
Joined: Sun May 20, 2012 7:07 pm
Location: UK

Re: Variables on mobile reports

Post by ChrisCookDev »

Thanks for your reply. My question really was not how do i read data in. But how do I get the user input boxes to show on the mobile reports to enable me to filter data. For example a date box or a dropdown box. I can do this fine with the web version, but it is not working on the mobile version. Please find a screenshot attached which may help.

Thanks
Attachments
ParametersSelectingCountry.png
ParametersSelectingCountry.png (200.56 KiB) Viewed 3102 times
Chris Cook :: Software Development Manager :: www.genesisit.co.uk
Design, Develop, Deliver! :: App development for smartphones, tablets, the desktop and the web
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Variables on mobile reports

Post by HighAley »

Hello.
ChrisCookDev wrote:Thanks for your reply. My question really was not how do i read data in. But how do I get the user input boxes to show on the mobile reports to enable me to filter data. For example a date box or a dropdown box. I can do this fine with the web version, but it is not working on the mobile version. Please find a screenshot attached which may help.
How do yo do it in web version? What doesn't work in mobile version? Could you provide us any example?
Here is a video where you could find out how to create such report. Creating Report with Parameters: Selecting Country

Thank you.
User avatar
ChrisCookDev
Posts: 41
Joined: Sun May 20, 2012 7:07 pm
Location: UK

Re: Variables on mobile reports

Post by ChrisCookDev »

Using the Stimulsoft desktop designer I create a report, then I create two variables on the report "DateFrom" and "DateTo" I set the variables to be "Request from user" and "Allow User Values" as outlined in the video link you posted.

In my .aspx page
I have the following code

<%@ Register Assembly="Stimulsoft.Report.Mobile, Version=2012.3.1500.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a"
Namespace="Stimulsoft.Report.Mobile" TagPrefix="cc1" %>

<cc1:StiMobileViewer ID="StiMobileViewer1" oncreatereport="StiMobileDesigner1_CreateReport" onsavereport="StiMobileDesigner1_SaveReport" runat="server" />

And in the code behind I load the report.

thisReportName = Request.QueryString["report"].ToString();
report.Load(Request.ApplicationPath + "/Reports1/" + thisReportName + ".mrt");
report.Compile();
report.Render();
StiMobileViewer1.Report = report;

When I render the report is generated using the mobile viewer (<cc1:StiMobileViewer) the "DateFrom" and "DateTo" input boxes are not displayed
However if i change the report viewer to the web version (<cc1:StiWebViewer) the input boxes "DateFrom" and "DateTo" are displayed

When I looked at your demo http://mobile.stimulsoft.com/Default.as ... ingCountry i can see you are using Input boxes to filter data with the mobile version, so please can you advise the best way to do this?

Thanks
Attachments
MobileViewer.png
MobileViewer.png (252.89 KiB) Viewed 3079 times
webViewer.png
webViewer.png (236 KiB) Viewed 3079 times
Chris Cook :: Software Development Manager :: www.genesisit.co.uk
Design, Develop, Deliver! :: App development for smartphones, tablets, the desktop and the web
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Variables on mobile reports

Post by HighAley »

Hello.

Please, try to download the latest prerelease build that is available on our site.

Thank you.
Post Reply