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. General Programming
  3. C#
  4. Report not load

Report not load

Scheduled Pinned Locked Moved C#
helpdatabasequestion
2 Posts 2 Posters 0 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.
  • H Offline
    H Offline
    haleemasher
    wrote on last edited by
    #1

    Hi all i have a code in to show Date to Date report.When i compile and run it, it cannt show any error but when it run in browser it takes too much time to load and no result is shown. I take this code from an article and i want to implement it. Plz help y it even show parameters and reports???

    protected void btnShow_Click(object sender, System.EventArgs e)
    {

           ReportDocument cryRpt = new ReportDocument();
            cryRpt.Load("CrystalReport3.rpt");
    
            TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
            ConnectionInfo crConnectionInfo = new ConnectionInfo();
            Tables CrTables;
    
            ParameterFieldDefinitions crParameterFieldDefinitions ;
            ParameterFieldDefinition crParameterFieldDefinition ;
            ParameterValues crParameterValues = new ParameterValues();
            ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
    
            crParameterDiscreteValue.Value =txtFrom.Text;
            crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
            crParameterFieldDefinition = crParameterFieldDefinitions\["Date1"\];
            crParameterValues = crParameterFieldDefinition.CurrentValues;
    
            crParameterValues.Clear();
            crParameterValues.Add(crParameterDiscreteValue);
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
    
            crParameterDiscreteValue.Value = txtTo.Text;
            crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
            crParameterFieldDefinition = crParameterFieldDefinitions\["Date2"\];
            crParameterValues = crParameterFieldDefinition.CurrentValues;
    
            crParameterValues.Add(crParameterDiscreteValue);
            crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
      
            crConnectionInfo.ServerName = "Server1";
            crConnectionInfo.DatabaseName = "Coupon Management.mdf";
            crConnectionInfo.UserID = "";
            crConnectionInfo.Password = "";
    
            CrTables = cryRpt.Database.Tables;
            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
            {
                crtableLogoninfo = CrTable.LogOnInfo;
                crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                CrTable.ApplyLogOnInfo(crtableLogoninfo);
            }
    
            CrystalReportVie
    
    C 1 Reply Last reply
    0
    • H haleemasher

      Hi all i have a code in to show Date to Date report.When i compile and run it, it cannt show any error but when it run in browser it takes too much time to load and no result is shown. I take this code from an article and i want to implement it. Plz help y it even show parameters and reports???

      protected void btnShow_Click(object sender, System.EventArgs e)
      {

             ReportDocument cryRpt = new ReportDocument();
              cryRpt.Load("CrystalReport3.rpt");
      
              TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
              TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
              ConnectionInfo crConnectionInfo = new ConnectionInfo();
              Tables CrTables;
      
              ParameterFieldDefinitions crParameterFieldDefinitions ;
              ParameterFieldDefinition crParameterFieldDefinition ;
              ParameterValues crParameterValues = new ParameterValues();
              ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
      
              crParameterDiscreteValue.Value =txtFrom.Text;
              crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
              crParameterFieldDefinition = crParameterFieldDefinitions\["Date1"\];
              crParameterValues = crParameterFieldDefinition.CurrentValues;
      
              crParameterValues.Clear();
              crParameterValues.Add(crParameterDiscreteValue);
              crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
      
              crParameterDiscreteValue.Value = txtTo.Text;
              crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
              crParameterFieldDefinition = crParameterFieldDefinitions\["Date2"\];
              crParameterValues = crParameterFieldDefinition.CurrentValues;
      
              crParameterValues.Add(crParameterDiscreteValue);
              crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
        
              crConnectionInfo.ServerName = "Server1";
              crConnectionInfo.DatabaseName = "Coupon Management.mdf";
              crConnectionInfo.UserID = "";
              crConnectionInfo.Password = "";
      
              CrTables = cryRpt.Database.Tables;
              foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
              {
                  crtableLogoninfo = CrTable.LogOnInfo;
                  crtableLogoninfo.ConnectionInfo = crConnectionInfo;
                  CrTable.ApplyLogOnInfo(crtableLogoninfo);
              }
      
              CrystalReportVie
      
      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Do you have the vaguest idea what this code does ? Have you stepped through it to see where it gets stuck ? Are the values being passed in correct for your database, or did you just copy random code ? I am guessing you don't have a Coupon Management.mdf, or you have some other issue that's causing the database connection to time out, hence the wait. Either way, programming and copying random code off the web, THEN asking us to make it work for you ( without even giving us the info we need to try to work out why it's not running ), are two different things. If you're being paid for the latter, you should tell your client you don't know what you're doing. If you're trying to learn, you shouldn't start with random code snippets, you should start with a book.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      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