|
Subject:
|
problem in Exporting Crystal report to PDF
|
|
Posted By:
|
cat_net
|
Post Date:
|
10/3/2005 11:49:05 PM
|
Hi Everyone!
I m really stuck with Crystal reports for VS.NET 2003 . I have created a report using DataSet and now trying to export report to PDF.It exports report to PDF but with Blank fields.However there is data in the report.I have tried each and every thing.Its completion of reporting module and i have to give it functionality to Export to desired format.
Heres my code for exporting report
private void Button3_Click(object sender, System.EventArgs e) // this is the code for exporting REport to desired format
{
this.fileName = Server.MapPath("/NewQCDS/Project/ReportsFile/test.pdf"); // this is destination file
string strrptfile=Server.MapPath("/NewQCDS/Reports/rptAllocatedEmployee.rpt").ToString(); // rpt file
this.crDiskFileDestinationOptions = new DiskFileDestinationOptions();
this.crDiskFileDestinationOptions.DiskFileName = this.fileName;
rpt.SetDataSource(objReportForm.fnGetRptAllocatedEmployee(int.Parse(Request.QueryString["ProjectID"].ToString()),int.Parse(Request.QueryString["Cmonth"].ToString()),int.Parse(Request.QueryString["ProjectID"].ToString())));
this.crExportOptions = this.rpt.ExportOptions;
this.crExportOptions.DestinationOptions = this.crDiskFileDestinationOptions;
this.crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
this.crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
if(rpt.IsLoaded==true)
{
this.rpt.Export();
}
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.WriteFile(this.fileName);
Response.Flush();
Response.Close();
}
}
}
Please some one help me on this.
Thanks in advance,
Regards
cat_net
|
|