如何在Visual Studio 2010的工具箱中取消隐藏Crystal Report Viewer?

时间:2012-08-30 08:38:57

标签: visual-studio-2010 crystal-reports toolbox

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

2 个答案:

答案 0 :(得分:0)

转到项目/属性,然后在Target Framework上的下拉列表中选择.NET Framework 4。

答案 1 :(得分:0)

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

[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中的

是可见的......