Unable to use crystalreport OCX control in C# Win App

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • budhajit
    New Member
    • May 2012
    • 1

    Unable to use crystalreport OCX control in C# Win App

    I had added crytal32.ocx control, but it showing an error

    System.Runtime. InteropServices .COMException was unhandled
    Message="Except ion from HRESULT: 0x800A501B"
    Source="Interop .Crystal"
    ErrorCode=-2146807781

    Code:
    //code sniffet--
    IDataReader IDR;
    SqlConnection CN = new SqlConnection("Data source= BJ-PC\\SQlEXPRESS;User ID= sa; Password=sa1; Initial Catalog=Bakery");
    CN.Open();
    SqlCommand Cmd = new SqlCommand("Select * from Tax", CN);
    IDR = Cmd.ExecuteReader();
    crpt.Reset();
    crpt.DiscardSavedData = true;
    crpt.ReportFileName = "D:\\DSA\\Reports\\Audit.rpt";
    crpt.SetTablePrivateData(0,3, IDR);
     crpt.Action = 1;
    Help me out

    Thanks
    BJ
    Last edited by PsychoCoder; May 18 '12, 09:48 PM. Reason: Code tags added
Working...