2012-01-11 55 views
4

我在Visual Studio 2010.中使用SAP Crystal Reports。我想定製Crystal Report Viewer 導出選項。也就是說,我想只顯示出口到PDF,並在我的水晶報表查看器中出類拔萃。
我怎麼能在13.0.x使用做到這一點在Crystal Report Viewer中自定義導出選項

+0

可能重複 - 以編程方式限制文件格式選項](http://stackoverflow.com/questions/2380956/crystal-report-viewer-programmatically-restricting-file-format-options) – 2013-05-29 09:16:49

回答

4

你可以限制的ReportViewer:

ReportViewer.AllowedExportFormats = (int)(ViewerExportFormats.ExcelFormat | ViewerExportFormats.PdfFormat); 
1

this.crystalReportViewer1.AllowedExportFormats =(INT)CrystalDecisions.Shared.ViewerExportFormats.PdfFormat;

3

首先包括下面的代碼背後的頂部命名空間:using CrystalDecisions.Shared

;

那麼,下面寫的代碼在你的頁面加載事件爲:

保護無效的Page_Load(對象發件人,EventArgs的)水晶報表查看器的 {

 CrystalReportViewer2.AllowedExportFormats = (int) (ViewerExportFormats.ExcelRecordFormat | ViewerExportFormats.PdfFormat); 

    }