我對C#相對較新,我從來沒有使用過水晶報表,所以我道歉如果我使用不正確的術語。我試圖顯示一個由某些C#代碼調用的報告。通過遵循這裏的很多線程,我設法得到了構建調試的以下代碼。但是,代碼運行時,它不會顯示報告。顯示使用c的水晶報告#
下面是代碼:
private void forAllQualitiesToolStripMenuItem_Click(object sender, EventArgs e) {
CrystalReportViewer rv = new CrystalReportViewer();
string reportPath = @"C:\Documents and Settings\rp\Desktop\StockByStatus.rpt";
ReportDocument r = new ReportDocument();
r.Load(reportPath);
rv.Visible = false; // i put this in because when i ran the code without it, it said the report must not be visible and the program would fall down
rv.ReportSource = r;
rv.InitReportViewer();
ShowDialog(rv);
}
我處理了SAP的大約6個星期試圖讓一些水晶報告在.NET 4.5下穩定工作。當我繼續遇到問題並建議我們的公司可能更適合使用SSRS時,SAP的技術支持人員認爲這對我們來說可能是更好的解決方案。 Crystal是SAP的紅頭髮的繼子女。支持是可怕的。除非您的公司已經將大筆資金投入到SAP的口袋中,否則您可能會獲得更好的支持解決方案。 – Pete 2013-04-25 17:58:15