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. String doesnot have a definition for ApplycurrentValues

String doesnot have a definition for ApplycurrentValues

Scheduled Pinned Locked Moved C#
help
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

    i copy this code from an article which is use to take a run time parameters when i run it,it show an error "String doesnot have a definition for ApplycurrentValues" i think i miss a directive for it plz help as i m novice in crystal report reporting. i use only one directive which is

    using CrystalDecisions.Shared;

    ParameterValues ParamCurrentValues = new ParameterValues();

        ParameterRangeValue p\_OrderDate\_Value = new ParameterRangeValue();
    
        p\_OrderDate\_Value.StartValue = this.txtOrderDateFrom.Text;
    
        p\_OrderDate\_Value.EndValue = this.txtOrderDateTo.Text;
    
        ParamCurrentValues.Add(p\_OrderDate\_Value);
    
        rep.DataDefinition.ParameterFields();
        ("Date1").**ApplyCurrentValues**(ParamCurrentValues);
    
    K 1 Reply Last reply
    0
    • H haleemasher

      i copy this code from an article which is use to take a run time parameters when i run it,it show an error "String doesnot have a definition for ApplycurrentValues" i think i miss a directive for it plz help as i m novice in crystal report reporting. i use only one directive which is

      using CrystalDecisions.Shared;

      ParameterValues ParamCurrentValues = new ParameterValues();

          ParameterRangeValue p\_OrderDate\_Value = new ParameterRangeValue();
      
          p\_OrderDate\_Value.StartValue = this.txtOrderDateFrom.Text;
      
          p\_OrderDate\_Value.EndValue = this.txtOrderDateTo.Text;
      
          ParamCurrentValues.Add(p\_OrderDate\_Value);
      
          rep.DataDefinition.ParameterFields();
          ("Date1").**ApplyCurrentValues**(ParamCurrentValues);
      
      K Offline
      K Offline
      Keith Barrow
      wrote on last edited by
      #2

      The code you have copy-and-pasted is almost certainly wrong. I don't know the 1st thing about Crystal Reports (thank higher-being of your choice), but a quick search on the web brought up this (which is similar to your code)

      public void SetParameter(string name, object value)
      {
      //Access the specified parameter from the parameters collection
      CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinition parameter = _reportDocument.DataDefinition.ParameterFields[name];
      // Now get the current value for the parameter and clear them
      CrystalDecisions.Shared.ParameterValues currentValues = parameter.CurrentValues; currentValues.Clear();
      // Create a value object for Crystal reports and assign the specified value.
      CrystalDecisions.Shared.ParameterDiscreteValue newValue = new CrystalDecisions.Shared.ParameterDiscreteValue();
      newValue.Value = value;
      // Now add the new value to the values collection and apply the
      // collection to the report.
      currentValues.Add(newValue);
      parameter.ApplyCurrentValues(currentValues);
      }

      So it looks like ApplyCurrentValues is a method on the parameter.

      CCC solved so far: 2 (including a Hard One!)

      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