How to run the report?

Stimulsoft Reports.NET discussion
Post Reply
programmer
Posts: 7
Joined: Fri Jun 20, 2008 1:33 am

How to run the report?

Post by programmer »

Hi All,

I use the trial version of stimulReport. I try to run the report but no data prompt out. i do not know what's the problem. May need your help.

Here's how i create my report
=====================
A) StimulReport
-------------------
1) Create databand
2) Under Dictionary Tree, click on Action, import xml schema and select stimul default xml schema from "C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\Demo.xml"
3) Drag 2 columns Category Name and Description from Categories table into the Databand.


B) .Net code
==============
1) Create a win form, add a button event as below
private void button1_Click(object sender, System.EventArgs e)
{
DataSet myData = new DataSet();
myData.ReadXml(@"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\Demo.xml");

StiReport rpt = new StiReport();
rpt.Load(@"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\stiReport1.mrt");
rpt.Show();
}

The report prompt out but without a any data. May i know what's wrong with my code?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to run the report?

Post by Edward »

Hello.

Please change you code a little bit:

Code: Select all

private void button1_Click(object sender, System.EventArgs {
DataSet myData = new DataSet("Demo");
myData.ReadXmlSchema(@"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\Demo.xsd");
myData.ReadXml(@"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\Demo.xml");
			
StiReport rpt = new StiReport();
rpt.Load(@"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\stiReport1.mrt");
rpt.RegData("Demo",myData);
// this string will synchronize the content of the Dictionary and the DataStore and usually this command executes automatically
rpt.Dictionary.Synchronize();
rpt.Show();
}
If you still do not see the data, then call instead of rpt.Show(); the following method: rpt.Design(); and make sure that the name of the Connection in the Dictionary is "Demo" (or what you have assigned.)

Thank you.
programmer
Posts: 7
Joined: Fri Jun 20, 2008 1:33 am

How to run the report?

Post by programmer »

Hi Edward,

Thanks and it works now. I think the only thing i need to do is rpt.Dictionary.Synchronize(). This is a great product, the only thing is lack of documentation on how the things work. In fact, i read the entire user manual provided but found no solutions on this simple issue.

Instead of replying thru forum, probably stimulsoft should think of providing a step by step ebook on how to create a report. Probably someone can have a blog on this reporting tools.

Just my humble opinion.

Edward wrote:Hello.

Please change you code a little bit:

Code: Select all

private void button1_Click(object sender, System.EventArgs {
DataSet myData = new DataSet("Demo");
myData.ReadXmlSchema(@"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\Demo.xsd");
myData.ReadXml(@"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\Demo.xml");
			
StiReport rpt = new StiReport();
rpt.Load(@"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\stiReport1.mrt");
rpt.RegData("Demo",myData);
// this string will synchronize the content of the Dictionary and the DataStore and usually this command executes automatically
rpt.Dictionary.Synchronize();
rpt.Show();
}
If you still do not see the data, then call instead of rpt.Show(); the following method: rpt.Design(); and make sure that the name of the Connection in the Dictionary is "Demo" (or what you have assigned.)

Thank you.
programmer
Posts: 7
Joined: Fri Jun 20, 2008 1:33 am

How to run the report?

Post by programmer »

Hi Edward,

Just for curiosity, i have try to create another report with the same step. Now it works. i didn't assign anything. I just repeat the same steps as i did previously. but it works with the code below.


private string _path = @"C:\Program Files\Stimulsoft Reports.Net 2007.2 Trial\.Net 1.1\Bin\Data\";

private void button1_Click(object sender, System.EventArgs e)
{
DataSet ds = new DataSet();
ds.ReadXml(_path + "Demo.xml");

StiReport rpt = new StiReport();
rpt.Load(_path + "stiReport3.mrt");
rpt.RegData(ds);
rpt.Show();
}
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

How to run the report?

Post by Edward »

Hello.

You need assign "Name In Source" property as well. This name must be the same as the name of the registered DataSet.

Thank you.
Post Reply