2013-10-09 64 views

回答

0

如果你想打印您可以將其轉換爲PDF水晶報表,然後用戶可以從PDF打印

rpt.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, "ExportedReport"); 

您還可以打印到打印機,並提供

rpt.PrintToPrinter(2, true, 1, 2); 

您可能還printeroption請參閱this教程

Fror打印對話框您可能會看到thisthis教程

+0

我們已經做到了這一點......我們想要的打印,而不顯示PDF文件。我們也想要打印對話框。是否可以通過按鈕單擊事件打開打印對話框。 – jyothis

+0

看到我更新的答案 – Tassadaque

0

您可以直接打印水晶報表而無需打開它使用CrystalReport.PrintToPrinter() 方法。

您還可以使用設置紙張尺寸CrystalReport.PrintOptions.PaperSize = PaperSize.PaperA4。

0

你可以試試這個方法...

ReportDocument oDocument = new ReportDocument(); 
oDocument.Load(Application.StartupPath + "//ReportPath//ReportName.rpt"); 
oDocument.SetDataSource(new DataSet()); // Added report data as dataset. 

crviewer.ReportSource = oDocument; 
crviewer.PrintReport();