divyakrishnan 20 Junior Poster

Hi...

I have a problem on my project which is done in VS2005.In which I am creating crystal report and i want to export it to a pdf on an export button click. But an error is showing as 'Missing Parameter Value'. The code i used is shown below:-

protected void btnExport_Click(object sender, EventArgs e)
{

System.IO.FileStream fs = null;
long FileSize = 0;

DiskFileDestinationOptions oDest = new DiskFileDestinationOptions();

string ExportFileName = Server.MapPath("\\Rpt_Disbursement_search.rpt") + "Export";
Rpt.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
Rpt.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
oDest.DiskFileName = ExportFileName;
Rpt.ExportOptions.DestinationOptions = oDest;
Rpt.Export();--ERROR IS SHOWN HERE
Response.Clear();
Response.Buffer = true;
Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("Content-Disposition", "attachment;filename=Disbursement.pdf;");
fs = new System.IO.FileStream(ExportFileName, FileMode.Open);
FileSize = fs.Length;
byte[] bBuffer = new byte[Convert.ToInt32(FileSize) + 1];
fs.Read(bBuffer, 0, Convert.ToInt32(FileSize));
fs.Close();
Response.BinaryWrite(bBuffer);
Response.Flush();
Response.Close();

}

Error is shown on line no _15(Rpt.Export();).
I am passing a parameter to the report.There's no problem in viewing the crystal report.Any body knows please help me.Its very urgent for project.