Previously we had implemented the report writer and viewer for exporting reports. Although since then these methods of exporting reports have been creating files of 0 bytes that no longer have any content. When rendered through the report viewer the report is displayed properly with all of the proper data, but when using the built in save feature we get similar results with no exception being raised in the code. We make reference to Syncfusion Report Controls, Viewer, Writer, and Core. Any thoughts on getting this working?
Below is a sample of our fairly straightforward Report to Pdf method
public void PDF()
{
IList results = _printQuery.Search(_criteriaViewModel.Criteria);
Assembly assembly = _printQuery.GetType().Assembly;
Stream reportSourceStream = _maintenanceReportFinder.GetReportSourceStream(assembly, ReportType);
if (reportSourceStream == null)
{
_frameworkWindowManager.ShowMessageBox(new MessageBoxParameters("Unable to locate report resource."));
return;
}
var reportWriter = new ReportWriter(reportSourceStream);
reportWriter.DataSources.Add(new ReportDataSource("Dataset", results));
var printDialog = new SaveFileDialog
{
FileName = "Report_" + DateTime.Now.ToString("MM_dd_yyyy") + ".pdf",
Filter = ".pdf|.pdf"
};
var fileName = printDialog.FileName;
reportWriter.Save(fileName, WriterFormat.PDF);
Process.Start(fileName);
}