C# で ReportViewer を使用するのは初めてです。Crystal Reports を使って作成したレポートを表示しようとしています。
これは私のコードです:
private void button1_Click(object sender, EventArgs e)
{
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("C:Users\\Document\\CrystalReport1.rpt");
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();
}
これはエラーメッセージです:
'Microsoft.Reporting.WinForms.ReportViewer' does not contain a definition for 'ReportSource' and no extension method 'ReportSource' accepting a first argument of type 'Microsoft.Reporting.WinForms.ReportViewer' could be found (are you missing a using directive or an assembly reference?)
私はすでに参照Interop.CrystalActiveXReportViewerLib10を追加しています
どうすればこれを解決できますか?