Chọn Cho dù các báo cáo sẽ được hiển thị, in, hoặc xuất khẩu Sử dụng Visual Basic NET Mã. Tôi biết tôi có thể sử dụng Crystal Report Viewer để in ấn và xuất khẩu báo cáo của tôi, nhưng tôi muốn để có thể có quyền kiểm soát trên đó, và có thể thậm chí không bao gồm các Viewer trong một số trường hợp | Select Whether the Report Will Be Displayed Printed or Exported Using Visual Basic .NET Code I know I can use the Crystal Report Viewer to print and export my reports but I want to be able to have control over that and maybe not even include the Viewer in some cases. Technique For this How-To you will use a Tab control to display the three options for the user Print Export and View see Figure . Figure . You have flexibility when it comes to letting your users work with reports. The first tab Print allows you to specify the number of copies to print along with the starting and ending pages. Printing Using the Report Document This page will use the PrintToPrinter method shown here False The PrintOptions object found on the ReportDocument is very useful. The PrintOptions object has the following properties PaperOrientation PaperSize PaperSource PrinterDuplex and PrinterName. You can set these properties either at design time using the property sheet or at runtime using code. Exporting Using the Report Document When you re exporting using the Report document you will be using the ExportOptions object. The ExportOptions object is made up of four other properties objects DestinationOptions. This is made up of one of three possible objects DiskFileDestinationOptions ExchangeFolderDestinationOptions or MicrosoftMailDestinationOptions. ExportDestinationType. This gets or sets the export destination type. This will be DiskFile ExchangeFolder MicrosoftMail or NoDestinationType. ExportFormatType. This gets or sets the export format type. It can be one of the following Excel HTML32 HTML40 NoFormat PortableDocFormat RichText or WordForWindows. FormatOptions. This gets or sets the FormatOptions. It can be ExcelFormatOptions HTMLFormatOptions or PdfRtfWordFormatOptions. To execute the export you use the Export method of the DocumentReport object. You can see the page for .