none
C# and Crystal Reports

    Question

  • My Object is to call Crystal Reports XI class library including crystal Reports viewer.

    What I did:

    I create a class library with a window form and added crystal reports viewer. The following code is used.

    [code under the window form]

    public long init(object ReportObject, string strTitle, bool isMaximized)

            {

                Cursor.Current = Cursors.WaitCursor;

                this.Text = strTitle;

     

                this.crystalReportViewer1.ReportSource = ReportObject;            

                this.crystalReportViewer1.PrintReport();      

           

                if (isMaximized == true )

                {

                    this.WindowState = FormWindowState.Maximized;

                }

     

     

                this.crystalReportViewer1.Zoom(100);

                Cursor.Current = Cursors.Default;       

                return (1);          

     

     

            }

    [code under the .cs file]

    public void ShowReport(ref object ReportObject, string strTitle, bool isMaximized)

            {

    Crystal_Report_Viewer.Net.Report_Viewer Obj = new Crystal_Report_Viewer.Net.Report_Viewer();           

                Obj.Show();

                Obj.init(ReportObject, strTitle, isMaximized);

     

            }

    This code seems to be ok but when I call a method ShowReport() from third party application, a meessage get appeard : invalid Report Source, can any expert help me out to resolve this issue. The following code I used in third party application after regersting assembly.

    Obj = new CrystalViewer.Crystal();

    Obj.ShowReport(CRReport,ReportTitle,false);

    What should I do?

    Friday, April 10, 2009 10:12 AM

All replies

  • Hello,

    I recommend you to consult the third-party vendor of the method that you are using for some better support. 

     

    Best Regards,
    Lingzhi


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, April 14, 2009 8:33 AM
    Moderator