This one is actually quite simple: Crystal Reports supports exporting to a PDF. Exporting can be done to disk, or to a stream. And a stream can be written to the Repsonse property of a page. And there you go 😉


// Variable declaration
   CrystalTest crystalTest;
   MemoryStream memoryStream;

// Create a new instance of the report you want to display as a PDF
   crystalTest = new
CrystalTest();
// TODO: Add some stuff here to fill the report with data

// Export the report to a stream with the PDF format
   memoryStream = (MemoryStream)crystalTest.ExportToStream(ExportFormatType.PortableDocFormat);
// Set the ContentType to pdf, add a header for the length
// and write the contents of the memorystream to the response
   Response.ContentType = “application/pdf”;
   Response.AddHeader(“content-length”, Convert.ToString(memoryStream.Length));
   Response.BinaryWrite(memoryStream.ToArray());
//End the response
   Response.End();