Crystal Reports Viewer in Visual Studio 2010

前端 未结 4 1512
孤街浪徒
孤街浪徒 2020-12-11 13:10

I\'m using Visual Studio 2010 and already downloaded CR (Crystal Reports) but when I search for Crystal Reports viewerin the tool, does not exist, so how can I display my re

4条回答
  •  醉酒成梦
    2020-12-11 13:47

    You need to First Change Your Framwork to .net Framwork 4.0 Link http://www.aspsnippets.com/Articles/Crystal-Report-Viewer-missing-from-ToolBox-in-Visual-Studio-2010.aspx


    After the Change Framwork You Need to install Crystal Report Runtime http://scn.sap.com/docs/DOC-7824


    You Can Also Create Crystal Report at Runtime...

    [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;
        }
    }
    

    in Your WinForm Crystal Report Viewer is Visible...

提交回复
热议问题