Variables on mobile reports
- ChrisCookDev
- Posts: 41
- Joined: Sun May 20, 2012 7:07 pm
- Location: UK
Variables on mobile reports
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
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
Design, Develop, Deliver! :: App development for smartphones, tablets, the desktop and the web
Re: Variables on mobile reports
Hello.
You should use GetReportData event to get data for variables requested by user. Here is a sample code of this event:
Also you should add next code to the aspx page:
Thank you.
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);
}
Code: Select all
OnGetReportData="StiMobileViewer1_GetReportData"
- ChrisCookDev
- Posts: 41
- Joined: Sun May 20, 2012 7:07 pm
- Location: UK
Re: Variables on mobile reports
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
Thanks
- Attachments
-
- ParametersSelectingCountry.png (200.56 KiB) Viewed 3103 times
Chris Cook :: Software Development Manager :: www.genesisit.co.uk
Design, Develop, Deliver! :: App development for smartphones, tablets, the desktop and the web
Design, Develop, Deliver! :: App development for smartphones, tablets, the desktop and the web
Re: Variables on mobile reports
Hello.
Here is a video where you could find out how to create such report. Creating Report with Parameters: Selecting Country
Thank you.
How do yo do it in web version? What doesn't work in mobile version? Could you provide us any example?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.
Here is a video where you could find out how to create such report. Creating Report with Parameters: Selecting Country
Thank you.
- ChrisCookDev
- Posts: 41
- Joined: Sun May 20, 2012 7:07 pm
- Location: UK
Re: Variables on mobile reports
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
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 (252.89 KiB) Viewed 3080 times
-
- webViewer.png (236 KiB) Viewed 3080 times
Chris Cook :: Software Development Manager :: www.genesisit.co.uk
Design, Develop, Deliver! :: App development for smartphones, tablets, the desktop and the web
Design, Develop, Deliver! :: App development for smartphones, tablets, the desktop and the web
Re: Variables on mobile reports
Hello.
Please, try to download the latest prerelease build that is available on our site.
Thank you.
Please, try to download the latest prerelease build that is available on our site.
Thank you.