I use Quartz.NET to run a task every 4 hours. So I created a class library with the job. In this job I need to create a report and export it as pdf.
Output type: Class library
Target framework: .NET 4.0
Referenced assemblies:
- Stimulsoft.Base
- Stimulsoft.Editor
- Stimulsoft.Report
- Stimulsoft.Report.Check
- Stimulsoft.Report.Design
- Stimulsoft.Report.Helper
Here my code to create the StiReport Object:
Code: Select all
//Create Report
StiReport report = new StiReport();
//load report layout
if (File.Exists(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "GasOrderLayout.mrt")))
{
report.Load(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "GasOrderLayout.mrt"));
}
else
{
logger.Error("Unable to load report layout");
}
//Load datasource
report.RegBusinessObject("Orders", orders);
report.Dictionary.SynchronizeBusinessObjects();
//Create report
report.Render(false);
Code: Select all
StiReport report = new StiReport();

Isn't it possible to create a report in a class library?
Thanks for any help!
Mike Hachen