Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal report is empty - dynamic dataset

Status
Not open for further replies.

cathiec

Programmer
Oct 21, 2003
139
IE
i create a dataset and at runtime i fill it depending on what the user selected ie what the parameters are. the dataset works fine and is returned as i tested it using a datagrid. when i export the dataset to a pdf application the report appears but is blank. help!
da.Fill(ds1, "dbo.SSRFFVR");

........
in first method:
DataGrid1.DataSource = ds1;
DataGrid1.DataBind();
ExportPDF(ds1);



private void ExportPDF(DataSet ds1)
{
crReportDocument = new rptGETASSETS();
crReportDocument.SetDataSource(ds1);
CrystalReportViewer1.ReportSource = crReportDocument;



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();

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top