Delaying loading of data
Re: Delaying loading of data
Sorry, here is the zip.
- Attachments
-
- StimulsoftBusinessObjectsTest.zip
- Project file
- (15.2 KiB) Downloaded 263 times
Re: Delaying loading of data
Hello.
You can't get columns with report.Dictionary.GetDataSet("LoanData"); method if there is no data.
But you could create new dataset and register it with the same name.
Thank you.
You can't get columns with report.Dictionary.GetDataSet("LoanData"); method if there is no data.
But you could create new dataset and register it with the same name.
Code: Select all
static public void LoadData(StiReport report)
{
//MessageBox.Show("DataProvider called");
if (report.CompiledReport != null)
report = report.CompiledReport;
//StiDataSource dataSrc = report.Dictionary.DataSources[0];
//DataSet dataSet = report.Dictionary.GetDataSet("LoanData");
DataSet dataSet = new DataSet("Test");
dataSet.ReadXmlSchema("TestData.xsd");
// This block attempted to add rows dynamically
DataRow newRow1 = dataSet.Tables[0].NewRow();
// An exception occurrs here because there are columns in datarow
newRow1[0] = "ABC0001";
newRow1[1] = new DateTime(2012, 3, 17);
dataSet.Tables[0].Rows.Add(newRow1);
DataRow newRow2 = dataSet.Tables[0].NewRow();
newRow2[0] = "XYZ9876";
newRow2[1] = new DateTime(1999, 5, 17);
dataSet.Tables[0].Rows.Add(newRow2);
dataSet.ReadXml("TestData.xml");
report.RegData(dataSet);
report.Dictionary.Synchronize();
// I then tried to read data from an xml into the dataset
// No data will appear when report is run or previewed
dataSet.ReadXml("TestData.xml");
}
Re: Delaying loading of data
Thanks, I will give it a try.
On a similar note, is there a method/event I can use to do the same thing when a user calls "View Data"?
On a similar note, is there a method/event I can use to do the same thing when a user calls "View Data"?
Re: Delaying loading of data
Hello.
Thank you.
Unfortunately, there is no such event.jmiller wrote:On a similar note, is there a method/event I can use to do the same thing when a user calls "View Data"?
Thank you.