vinayak kulkarni

vinayak kulkarni

  • NA
  • 20
  • 92.8k

Converting the web application code in windows form application code

Oct 4 2010 1:38 AM
Good morning everybody...

the following code works well in .aspx page that is in
web application..
now the same thing i want to do in windows form application.. can anybody help me..

The code is for without saving the pdf file take a print.. 
it works well in .aspx page 
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("E:\\Report1\\over\\CrystalReport1.rpt");
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("E:\\Report1\\over\\CrystalReport1.rpt");
MemoryStream oStream; // using System.IO
oStream = (MemoryStream)
cryRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();

In windows form the Response .clear or response.buffer is not supported
error is missing namespace or directive is displaying...

Answers (1)