Page 1 of 1

Problem: Cannot load Report in Viewer

Posted: Wed Apr 09, 2014 9:54 am
by VAL
Hello

I hope you can help me. I'm trying out Stimulsoft because we want to replace Crystal Reports with a new engine.
I made a report with the designer and I'm trying to add it to a ASP.NET-Page. I added a StiWebReport to the page and connected my report with it. Also I added a StiWebViewer, where I connect the viewer with the report:

StiReport report = StiWebReport1.GetReport();
report.Load(Server.MapPath("~/Reports/Testreport.mrt"));
StiWebViewer1.Report = report;

Until now everything works. But when I open the page, give in the values of the report parameters and click on "Submit" the page starts to load and doesn't stop with it. The report keeps empty. In the report I added a datasource and it works properly. What do I have to do that my report works?

P.S: This also didn't work:
DataSet ds = new DataSet("AName");
ds.ReadXml(Server.MapPath("~/App_Data/DataSet.xsd"));
report.RegData(ds);
StiWebViewer1.Report = report;

Re: Problem: Cannot load Report in Viewer

Posted: Wed Apr 09, 2014 1:36 pm
by VAL
OK, I found the problem, but I still don't know how to solve it.

When I just give a number parameter, the report works. As soon as I add the date fields, the report doesn't work anymore.
In the designer, the report works also with the date parameter. Can someone help me?

Re: Problem: Cannot load Report in Viewer

Posted: Thu Apr 10, 2014 10:01 am
by HighAley
Hello.

Please, describe in details how do you add the date field and how do you set its value.
Could you send us any sample which reproduces the issue.
Please, try also to read the Defining Data section of the Programming Manual.

Thank you.

Re: Problem: Cannot load Report in Viewer

Posted: Wed Apr 16, 2014 6:24 am
by VAL
The date fields are variables in the report and I add the value for them on the webpage with the insert-fields. The data is already added to the report.

When I add the report parameters before I add the report to the WebViewer, the report works. What am I doing wrong that it does not work with the insert fields from the WebViewer?

StiReport report = StiWebReport1.GetReport();

report.Compile();
report["Employee"] = 1003;
report["DateFrom"] = new DateTime(2013, 03, 01);
report["DateTo"] = new DateTime(2014, 03, 01);
StiWebViewer1.Report = report;

EDIT: I changed the render mode from "Ajax" to "Ajax with Cache". Now it seems to work properly, thanks for your helpfulness

Re: Problem: Cannot load Report in Viewer

Posted: Wed Apr 16, 2014 11:44 am
by HighAley
Hello.

It's very strange. What event do you use to set variable values. Could you send us sample project which reproduces the issue in the Ajax mode?

Thank you.

Re: Problem: Cannot load Report in Viewer

Posted: Wed Apr 16, 2014 12:38 pm
by VAL
I don't really get what you're asking me, sorry. I don't set the report variables in the code, I set them on the page in the StiWebViewer. When I set render mode to "Ajax", it keeps loading forever. When I set it on "Ajax with Cache", it works. I'm not able to send you more code because there isn't really more of it. Its a very simple page with just the StiWebReport and StiWebViewer on it.

I'm sorry if I cause confusion, I don't have much experience at coding with reports.

Re: Problem: Cannot load Report in Viewer

Posted: Thu Apr 17, 2014 12:26 pm
by HighAley
Hello.

Could you send us any sample project that reproduces the issue in the AJAX mode?
Please, create a simple project for analysis.

Thank you.