Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Crystal Report in Asp.net

Crystal Report in Asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasehelp
4 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Udayaraju
    wrote on last edited by
    #1

    Hi Dudes, Plz Solve these I am trying to implement a sample report in asp.net using crystal reports10.0. But i get an error of Object reference not set to an instance of an object Here's my code

    public void btn_Click(object sender, EventArgs e)
    {
    frmPreview Preview = new frmPreview();
    rptInformation Info = null;

            TableLogOnInfo logOnInfo = DBManager.getCrystalLogInfo(); //CorrectStatment
            Info = new rptInformation();
    
            Info.Database.Tables\[0\].ApplyLogOnInfo(logOnInfo); //Correct
    
            formulaFieldDefs = Info.DataDefinition.FormulaFields;
    
            formulaFieldDef = formulaFieldDefs\["CompanyName"\];
            formulaFieldDef.Text = "'" + Global.CompanyName + "'";
    
            Preview.crystalRptViewer.ReportSource = Info; //Error
             
        }
    

    Here I placed CrystalReportViewer in frmPreview

    A 1 Reply Last reply
    0
    • U Udayaraju

      Hi Dudes, Plz Solve these I am trying to implement a sample report in asp.net using crystal reports10.0. But i get an error of Object reference not set to an instance of an object Here's my code

      public void btn_Click(object sender, EventArgs e)
      {
      frmPreview Preview = new frmPreview();
      rptInformation Info = null;

              TableLogOnInfo logOnInfo = DBManager.getCrystalLogInfo(); //CorrectStatment
              Info = new rptInformation();
      
              Info.Database.Tables\[0\].ApplyLogOnInfo(logOnInfo); //Correct
      
              formulaFieldDefs = Info.DataDefinition.FormulaFields;
      
              formulaFieldDef = formulaFieldDefs\["CompanyName"\];
              formulaFieldDef.Text = "'" + Global.CompanyName + "'";
      
              Preview.crystalRptViewer.ReportSource = Info; //Error
               
          }
      

      Here I placed CrystalReportViewer in frmPreview

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      It seems that you are doing this in Winforms... I think this is not the right section to post this. :mad: On this ... you didnt mentioned where exactly the error you are getting...?

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Simplify Code Using NDepend
      Basics of Bing Search API using .NET
      Microsoft Bing MAP using Javascript

      U 1 Reply Last reply
      0
      • A Abhishek Sur

        It seems that you are doing this in Winforms... I think this is not the right section to post this. :mad: On this ... you didnt mentioned where exactly the error you are getting...?

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        U Offline
        U Offline
        Udayaraju
        wrote on last edited by
        #3

        I am trying to Implement in Asp.net itself. I tried in these way.. Is there any better approach I have specified the error Preview.crystalRptViewer.ReportSource = Info; //Error: Object reference is not set to an instance of an object

        A 1 Reply Last reply
        0
        • U Udayaraju

          I am trying to Implement in Asp.net itself. I tried in these way.. Is there any better approach I have specified the error Preview.crystalRptViewer.ReportSource = Info; //Error: Object reference is not set to an instance of an object

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          Did you bind the data source properly? Are you trying this in your Development environment or in Production server. Generally this sort of error comes when Crystal report is not found in the server. :confused:

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Simplify Code Using NDepend
          Basics of Bing Search API using .NET
          Microsoft Bing MAP using Javascript

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups