1

我有带有 SAP Crystal Report 的 Visual Studio 2010,但在 Visual Studio 的工具箱中看不到 Crystal Report Viewer 项。如何取消隐藏或添加该工具箱项?

4

2 回答 2

0

转到 Project/Properties 并在 Target Framework 上的下拉列表中选择 .NET Framework 4。

于 2012-08-30T09:05:05.830 回答
0

您需要首先将您的框架更改为 .net Framwork 4.0 链接http://www.aspsnippets.com/Articles/Crystal-Report-Viewer-missing-from-ToolBox-in-Visual-Studio-2010.aspx您也可以创建运行时的水晶报表...

[In VB.Net]

Imports CrystalDecisions.Windows.Forms

Private Sub CrystalView_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Try
        Dim crv As New CrystalReportViewer
        With crv
            .Dock = DockStyle.Fill
        End With
        Me.Controls.Add(crv)
    Catch ex As Exception
        MsgBox(ex.Message)
    End Try
End Sub

[In C#]
using CrystalDecisions.Windows.Forms;
public class CrystalView
{
    private void CrystalView_Load(System.Object sender, System.EventArgs e)
    {
        try {
            CrystalReportViewer crv = new CrystalReportViewer();
             crv.Dock = DockStyle.Fill;
            crv.EnableDrillDown = false;
            this.Controls.Add(crv);
        } catch (Exception ex) {
            MessageBox.Show(ex.Message,"Hello");
        }
    }
    public CrystalView()
    {
        Load += CrystalView_Load;
    }
}

在您的 WinForm Crystal Report Viewer 中是可见的...

于 2016-05-23T06:09:53.577 回答