vinayak kulkarni

vinayak kulkarni

  • NA
  • 20
  • 92.8k

without saving the pdf file showing the print preview

Sep 29 2010 6:06 AM
hi ...

i've created one crystal report in windows form and one crystalreportviewer ..

the following is my code..

in form1.cs file

try
{
ExportOptions CrExportOptions;
DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
CrDiskFileDestinationOptions.DiskFileName = "c:\\csharp.net-informations.pdf";
CrExportOptions = cryRpt.ExportOptions;
{
 CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
 CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
 CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
 CrExportOptions.FormatOptions = CrFormatTypeOptions;
}
 cryRpt.Export();
}
the above code is saving the file into pdf into specified path..

but i dont want to save a file i should get direct print preview and 

have a option to print ..



As we do in web application using crystal report viewer clicking print

and report will be opened in pdf.. and the click print..



i want the same function as we do in web application...

i'm writing code in c#.net 

hope the above explaination will be understood clearly..


Answers (1)