I have a report with 2 Database in the dictionary: SQLDatabase (filled from SQLserver ) and XMLDatabase (loaded from XMLfile)
...
Stimulsoft.Report.StiReport stiRpt = Stimulsoft.Report.StiReport.GetReportFromAssembly(compiledReportFile); //included SQLconnection
stiRpt["lngInvoiceID"] = InvoiceID; // set SQLparameter
DataSet dsLabels = new DataSet();
dsLabels.ReadXml(strXMLFileName); // load xmlfile
SaveXML(); // Save XMLData to text file for checking. CORRECT
stiRpt.RegData("XMLDatabase", dsLabels);
stiRpt.Dictionary.Synchronize();
stiRpt.Render(false);
stiRpt.Show(true);
Data loaded from SQLserver are correct, but XMLdata are empty.
What i do wrong?
SaveXML()
{
using (System.IO.StreamWriter sw = System.IO.File.CreateText("rptBagLabels.txt"))
{
for (int i = 0; i < dsLabels.Tables[0].Columns.Count; i++)
{
sw.WriteLine(dsLabels.Tables[0].Columns.ColumnName + " = " + dsLabels.Tables[0].Rows[0].ToString());
}
sw.Flush();
sw.Close();
}
}
How to RegData from XML
How to RegData from XML
Solved.
stiRpt.Dictionary.Databases.RemoveAt(1);
stiRpt.RegData("XMLDatabase", dsLabels);
stiRpt.Dictionary.Databases.RemoveAt(1);
stiRpt.RegData("XMLDatabase", dsLabels);
How to RegData from XML
Great!