Page 1 of 1

Report.RegData()

Posted: Wed Jul 07, 2010 8:57 am
by beso
Hello,
I use Stimulsoft Reports.Ultimate 2010.1

It is My code.:

Dim Report As StiReport = New StiReport()
Report.RegData("A", DS)
StiWebDesigner1.Design(Report)

and result is ... see attach please..

"A" - hev error .... And the report not work ....

This code correqtli working in StiRep. 2008 release...
Why... and can i do something ? Thank you.

Report.RegData()

Posted: Thu Jul 08, 2010 3:13 am
by Vladimir
Hello,

There are two ways to preview a report that would work correctly:

1. Add a new connection to the database. Please use the following code:

Code: Select all

string connString = "Data Source=127.0.0.1;Initial Catalog=master;Integrated Security=True";
StiSqlDatabase database = new StiSqlDatabase(dataset.DataSetName, connString);
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(database);
2. Connect data directly to the report in the GetPreviewDataSet event:

Code: Select all

protected void StiWebDesigner1_GetPreviewDataSet(object sender, StiWebDesigner.StiPreviewDataSetEventArgs e)
{
    string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);

    DataSet data = new DataSet();
    data.ReadXml(appDirectory + "\\Data\\Demo.xml");
    data.ReadXmlSchema(appDirectory + "\\Data\\Demo.xsd");

    e.PreviewDataSet = data;
}

Thank you.