This is a migrated thread and some comments may be shown as answers.

without saving the pdf file showing the print preview

0 Answers 112 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
vinayak.v
Top achievements
Rank 1
vinayak.v asked on 29 Sep 2010, 11:07 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..

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
vinayak.v
Top achievements
Rank 1
Share this question
or