Page 1 of 1

Variables on mobile reports

Posted: Wed Feb 06, 2013 11:52 am
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

Re: Variables on mobile reports

Posted: Thu Feb 07, 2013 9:43 am
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.

Re: Variables on mobile reports

Posted: Fri Feb 08, 2013 4:11 pm
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

Re: Variables on mobile reports

Posted: Mon Feb 11, 2013 7:35 am
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.

Re: Variables on mobile reports

Posted: Tue Feb 12, 2013 11:57 am
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

Re: Variables on mobile reports

Posted: Wed Feb 13, 2013 10:27 am
by HighAley
Hello.

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

Thank you.