I am creating a dataset in ASP.NEt dynamically based on two dates that a user selects. The dates are then passed as parameters to a stored procedure and the dataset is created with rows that have a date column between the values of the two dates that have been chosen.
My problem is that i now want to display the information in a report using crystal.
Here is the function that i am using, but i get the a query engine error.
private void ExportPDF(DataSet ds)
{
rptASSETSDATES crReportDocument = new rptASSETSDATES();
crReportDocument.SetDataSource(ds);
string ExportPath;
ExportPath = Request.PhysicalApplicationPath;
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crExportOptions = crReportDocument.ExportOptions;
string fName = Session.SessionID.ToString() +".pdf";
crDiskFileDestinationOptions.DiskFileName = ExportPath + fName;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crReportDocument.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile(fName);
Response.Flush();
Response.Close();
}
i created a crystal report rptASSETSDATES using an empty dataset that has the same fields as the one that i am creating dynamically.
any suggestions??
My problem is that i now want to display the information in a report using crystal.
Here is the function that i am using, but i get the a query engine error.
private void ExportPDF(DataSet ds)
{
rptASSETSDATES crReportDocument = new rptASSETSDATES();
crReportDocument.SetDataSource(ds);
string ExportPath;
ExportPath = Request.PhysicalApplicationPath;
crDiskFileDestinationOptions = new DiskFileDestinationOptions();
crExportOptions = crReportDocument.ExportOptions;
string fName = Session.SessionID.ToString() +".pdf";
crDiskFileDestinationOptions.DiskFileName = ExportPath + fName;
crExportOptions.DestinationOptions = crDiskFileDestinationOptions;
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
crReportDocument.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile(fName);
Response.Flush();
Response.Close();
}
i created a crystal report rptASSETSDATES using an empty dataset that has the same fields as the one that i am creating dynamically.
any suggestions??