Binding to a different CSV file
Posted: Tue Mar 29, 2016 4:03 pm
Hi,
I've created a report in the designer (2016.1), based on a CSV file that was located in a given folder and with a givenname.
If I use the following code a PDF is created as expected...
string folder = @"c:\AxyCodeGen\ASR\Export\";
using (StiReport report = new StiReport())
{
// This is the report template that was created using the Designer. Data in there was bases on NotaData160101000005.csv and from within the Designer I can create a
// beautifull report...
report.Load(Path.Combine(folder, "NotaTemplate.mrt"));
report.Render();
report.ExportDocument(StiExportFormat.Pdf, Path.Combine(folder, "OK.Pdf"));
}
What I want to do however is connect the report to a different CSV file (with of course the exact same structure), but I can't get it to work...
using (StiReport report = new StiReport())
{
report.Load(Path.Combine(folder, "NotaTemplate.mrt"));
string newCsvFileName = "NotaDataNew.csv";
// How do I bind My NotaDataNew.CSV file (of course the same structure as the one that the report was created with)?
//....
report.Render();
report.ExportDocument(StiExportFormat.Pdf, Path.Combine(folder, "NewData.Pdf"));
}
Can someone help me with this please?
Thx in advance & kind regards,
Patrick
I've created a report in the designer (2016.1), based on a CSV file that was located in a given folder and with a givenname.
If I use the following code a PDF is created as expected...
string folder = @"c:\AxyCodeGen\ASR\Export\";
using (StiReport report = new StiReport())
{
// This is the report template that was created using the Designer. Data in there was bases on NotaData160101000005.csv and from within the Designer I can create a
// beautifull report...
report.Load(Path.Combine(folder, "NotaTemplate.mrt"));
report.Render();
report.ExportDocument(StiExportFormat.Pdf, Path.Combine(folder, "OK.Pdf"));
}
What I want to do however is connect the report to a different CSV file (with of course the exact same structure), but I can't get it to work...
using (StiReport report = new StiReport())
{
report.Load(Path.Combine(folder, "NotaTemplate.mrt"));
string newCsvFileName = "NotaDataNew.csv";
// How do I bind My NotaDataNew.CSV file (of course the same structure as the one that the report was created with)?
//....
report.Render();
report.ExportDocument(StiExportFormat.Pdf, Path.Combine(folder, "NewData.Pdf"));
}
Can someone help me with this please?
Thx in advance & kind regards,
Patrick