momer123:Q1. Is there any way to skip that pop up window(Printer Option) and just display print preview screen instead?
what is actually being displayed after the Printer Option window > is your report exported in PDF format (as print preview).
you can have a button and in its client event you can export the report in pdf format and display in another window. this would behave same as Print Preview (which is they also doing in the same way > exporting the report to PDF to show print preivew).
below is code to export report docuement in PDF:
//set the export options to PDF
ExportOptions exportOpts = doc.ExportOptions;
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
exportOpts.DestinationOptions = new DiskFileDestinationOptions();
// Set the disk file options.
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
((DiskFileDestinationOptions)doc.ExportOptions.DestinationOptions).DiskFileName = Server.MapPath("~/DesktopModules/OnlineForm/OnlineForm.pdf");
//export the report to PDF rather than displaying the report in a viewer
doc.Export();
//force download dialog to download the PDF file at user end.
//Set the appropriate ContentType.
Response.ContentType = "Application/pdf";
//Get the physical path to the file.
string FilePath = Server.MapPath("~/DesktopModules/OnlineForm/OnlineForm.pdf");
//Write the file directly to the HTTP content output stream.
Response.WriteFile(FilePath);
Response.End();
Referenced Link > Create PDF files on-the-fly in ASP.NET (Using Crystal Report!)
hope it helps./.
नमस्ते,
[KaushaL
] ||
BloG ||
MS MVP"I would love to change the world, but they won’t give me the source code"
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and mark your thread as Resolved for the sake of Future Readers.