1 Reply Latest reply on Jan 3, 2007 6:56 AM by Newsgroup_User

    variables stored in a database

    lenny2
      OK night owls, see if anyone has a solution for this mind bender!!

      I need to post a form to a Crystal reports csp page. The form variables need to be dynamic and are stored in a database. By that I mean: this is in a database cell: {myTable.myField} = #client.myVar# exactly as you see it. On my cfm page I loop over the result set and the hidden input form field looks like this:
      input type="hidden" name="selectionFormula" value = "#myQuery.userSF#" . What I WANT is if you view source on the cfm page I want the form field to look like this:
      input type="hidden" name="selectionFormula" value = "{myTable.myField} = 12345" where 12345 represents the evaluated form of #client.myVar# which is what was stored in the database.

      My problem is that when the cfm page renders the value for the selectionFormla hidden field is exactly what was in the database (i.e. NOT evaluated) as so: {myTable.myField} = #client.myVar#. This of course blows my crystal report up because it doesn;t know what #client.myVar# is.

      Any ideas on an elegant solution to this?

      Thanks tons!!!
        • 1. Re: variables stored in a database
          Level 7
          I want the form field to look like this:
          input type="hidden" name="selectionFormula" value =
          "{myTable.myField} = 12345" where 12345 represents the evaluated form of
          #client.myVar# which is what was stored in the database.

          Thus the inclusion of the evaluate() and de() [delay evaluate] functions
          in CF, see docs for full details. I can never remember when one use
          one, the other or both so some experimentation will be required, but one
          of these forms should work.

          input type="hidden" name="selectionFormula" value =
          "#evaluate(myQuery.userSF)#"

          OR

          input type="hidden" name="selectionFormula" value = "#de(myQuery.userSF)#"

          OR

          input type="hidden" name="selectionFormula" value =
          "#evaulate(de(myQuery.userSF))#"