dcsimg
Results 1 to 7 of 7

Thread: dbGridHideFlds

  1. #1
    Dennis Gaul Guest

    dbGridHideFlds


    How can I include a field in dbGridHideFlds and also refer to the field in a magic cell javascript (summing the values in the hidden field)? All of my efforts so far result in a zero sum, as if the hidden field wasn't included in the select statement.


  2. #2
    John Guest

    dbGridHideFlds (reply)

    Hi Dennis,

    If you hide a field with dbGridHideFlds, but it's still included in your SELECT statement, then you can refer to it in a magic cell statement.

    For example, if you select f1,f2,f3 from table1. Then you can hide f2 and f3 with:

    x.dbGridHideFlds = "f2,f3"

    But your Magiccell can be:

    x.dbMagicCell = "f1,,#f1# #f2# #f3#"

    This will output only one column (f1) but it will contain all three fields in it. This is a technique we use all the time to put "firstname middle lastname" in one column for example.

    There's no reason your JavaScript can't use the same values. Here's how to troubleshoot it:

    Just output as shown above so that you actually SEE the values and the output in your cells. Then create your javascript and hard code the values and get that piece to work with fake hard coded values. Finally, combine the two substituting your magic cell values for your hard coded values. Watch your delimiters (both quotes, semicolons, and commas) as they can trip you up if you're not careful.

    Hope this helps,
    John


    ------------
    Dennis Gaul at 3/20/01 9:29:58 PM


    How can I include a field in dbGridHideFlds and also refer to the field in a magic cell javascript (summing the values in the hidden field)? All of my efforts so far result in a zero sum, as if the hidden field wasn't included in the select statement.


  3. #3
    Dennis Gaul Guest

    dbGridHideFlds (reply)


    The code works so long as I am displaying all fields. When I hide fields, the code stops working. Is there any other property the could be interacting with dbGridHideFlds? The following are the dbGridHideFlds and dbMagicCell statements I'm using.

    MyDb.dbGridHideFlds="AmtFinance"
    MyDb.dbMagicCell=&#34;AmtFinance,align=right,<Scri pt Language=&#34;&#34;JavaScript&#34;&#34;>amtFinance d=#AmtFinance#</Script>format=[Currency]&#34;&_

    Thanks for your help!

    ------------
    John at 3/20/01 11:48:43 PM

    Hi Dennis,

    If you hide a field with dbGridHideFlds, but it&#39;s still included in your SELECT statement, then you can refer to it in a magic cell statement.

    For example, if you select f1,f2,f3 from table1. Then you can hide f2 and f3 with:

    x.dbGridHideFlds = &#34;f2,f3&#34;

    But your Magiccell can be:

    x.dbMagicCell = &#34;f1,,#f1# #f2# #f3#&#34;

    This will output only one column (f1) but it will contain all three fields in it. This is a technique we use all the time to put &#34;firstname middle lastname&#34; in one column for example.

    There&#39;s no reason your JavaScript can&#39;t use the same values. Here&#39;s how to troubleshoot it:

    Just output as shown above so that you actually SEE the values and the output in your cells. Then create your javascript and hard code the values and get that piece to work with fake hard coded values. Finally, combine the two substituting your magic cell values for your hard coded values. Watch your delimiters (both quotes, semicolons, and commas) as they can trip you up if you&#39;re not careful.

    Hope this helps,
    John


    ------------
    Dennis Gaul at 3/20/01 9:29:58 PM


    How can I include a field in dbGridHideFlds and also refer to the field in a magic cell javascript (summing the values in the hidden field)? All of my efforts so far result in a zero sum, as if the hidden field wasn&#39;t included in the select statement.


  4. #4
    Mark Guest

    dbGridHideFlds (reply)

    Dennis,

    Just curious ... Why are you doing a MagicCell to reformat a field you can&#39;t see anyway? What&#39;s the purpose? If you tell us what you are trying to accomplish, we can suggest a solution.

    What do you mean by &#34;the code stops working&#34;?? How do you know that? There is nothing to see if the field is hidden.

    Mark.


    ------------
    Dennis Gaul at 3/21/01 1:27:15 PM


    The code works so long as I am displaying all fields. When I hide fields, the code stops working. Is there any other property the could be interacting with dbGridHideFlds? The following are the dbGridHideFlds and dbMagicCell statements I&#39;m using.

    MyDb.dbGridHideFlds=&#34;AmtFinance&#34;
    MyDb.dbMagicCell=&#34;AmtFinance,align=right,<Scri pt Language=&#34;&#34;JavaScript&#34;&#34;>amtFinance d=#AmtFinance#</Script>format=[Currency]&#34;&_

    Thanks for your help!

    ------------
    John at 3/20/01 11:48:43 PM

    Hi Dennis,

    If you hide a field with dbGridHideFlds, but it&#39;s still included in your SELECT statement, then you can refer to it in a magic cell statement.

    For example, if you select f1,f2,f3 from table1. Then you can hide f2 and f3 with:

    x.dbGridHideFlds = &#34;f2,f3&#34;

    But your Magiccell can be:

    x.dbMagicCell = &#34;f1,,#f1# #f2# #f3#&#34;

    This will output only one column (f1) but it will contain all three fields in it. This is a technique we use all the time to put &#34;firstname middle lastname&#34; in one column for example.

    There&#39;s no reason your JavaScript can&#39;t use the same values. Here&#39;s how to troubleshoot it:

    Just output as shown above so that you actually SEE the values and the output in your cells. Then create your javascript and hard code the values and get that piece to work with fake hard coded values. Finally, combine the two substituting your magic cell values for your hard coded values. Watch your delimiters (both quotes, semicolons, and commas) as they can trip you up if you&#39;re not careful.

    Hope this helps,
    John


    ------------
    Dennis Gaul at 3/20/01 9:29:58 PM


    How can I include a field in dbGridHideFlds and also refer to the field in a magic cell javascript (summing the values in the hidden field)? All of my efforts so far result in a zero sum, as if the hidden field wasn&#39;t included in the select statement.


  5. #5
    Dennis Gaul Guest

    dbGridHideFlds (reply)


    The hidden field is one that doesn&#39;t appear in the body of the report, but is included in a summary(non-ASPdb) that is written at the end of the report, where it is included with totals of data in the body of the report.

    ------------
    Mark at 3/21/01 1:59:25 PM

    Dennis,

    Just curious ... Why are you doing a MagicCell to reformat a field you can&#39;t see anyway? What&#39;s the purpose? If you tell us what you are trying to accomplish, we can suggest a solution.

    What do you mean by &#34;the code stops working&#34;?? How do you know that? There is nothing to see if the field is hidden.

    Mark.


    ------------
    Dennis Gaul at 3/21/01 1:27:15 PM


    The code works so long as I am displaying all fields. When I hide fields, the code stops working. Is there any other property the could be interacting with dbGridHideFlds? The following are the dbGridHideFlds and dbMagicCell statements I&#39;m using.

    MyDb.dbGridHideFlds=&#34;AmtFinance&#34;
    MyDb.dbMagicCell=&#34;AmtFinance,align=right,<Scri pt Language=&#34;&#34;JavaScript&#34;&#34;>amtFinance d=#AmtFinance#</Script>format=[Currency]&#34;&_

    Thanks for your help!

    ------------
    John at 3/20/01 11:48:43 PM

    Hi Dennis,

    If you hide a field with dbGridHideFlds, but it&#39;s still included in your SELECT statement, then you can refer to it in a magic cell statement.

    For example, if you select f1,f2,f3 from table1. Then you can hide f2 and f3 with:

    x.dbGridHideFlds = &#34;f2,f3&#34;

    But your Magiccell can be:

    x.dbMagicCell = &#34;f1,,#f1# #f2# #f3#&#34;

    This will output only one column (f1) but it will contain all three fields in it. This is a technique we use all the time to put &#34;firstname middle lastname&#34; in one column for example.

    There&#39;s no reason your JavaScript can&#39;t use the same values. Here&#39;s how to troubleshoot it:

    Just output as shown above so that you actually SEE the values and the output in your cells. Then create your javascript and hard code the values and get that piece to work with fake hard coded values. Finally, combine the two substituting your magic cell values for your hard coded values. Watch your delimiters (both quotes, semicolons, and commas) as they can trip you up if you&#39;re not careful.

    Hope this helps,
    John


    ------------
    Dennis Gaul at 3/20/01 9:29:58 PM


    How can I include a field in dbGridHideFlds and also refer to the field in a magic cell javascript (summing the values in the hidden field)? All of my efforts so far result in a zero sum, as if the hidden field wasn&#39;t included in the select statement.


  6. #6
    John Guest

    dbGridHideFlds (reply)

    Hi Dennis,

    The problem is that you have to use a field in MagicCell that is not hidden. If it&#39;s hidden (dbGridHideFlds) then it won&#39;t ever get &#34;executed&#34;.

    All you have to do is to put your code to do the Javascript variable assignment in a different (displayed) field.

    For example, you&#39;re doing:

    select f1,f2,f3 and you&#39;re hiding field f1

    Then you&#39;re doing a magicell on f1. No good. Instead do magiccell on f2 like this:

    x.dbMagicCell = &#34;f2,,#f2#<script language=&#34;&#34;javascript&#34;&#34;>myf1=#f1#</script>&#34;

    This way, when the f2 field is output, it will show its normal value, but the JS code executes and assigns your variable for field f1.

    This should do it!

    John


    ------------
    Dennis Gaul at 3/21/01 3:08:06 PM


    The hidden field is one that doesn&#39;t appear in the body of the report, but is included in a summary(non-ASPdb) that is written at the end of the report, where it is included with totals of data in the body of the report.

    ------------
    Mark at 3/21/01 1:59:25 PM

    Dennis,

    Just curious ... Why are you doing a MagicCell to reformat a field you can&#39;t see anyway? What&#39;s the purpose? If you tell us what you are trying to accomplish, we can suggest a solution.

    What do you mean by &#34;the code stops working&#34;?? How do you know that? There is nothing to see if the field is hidden.

    Mark.


    ------------
    Dennis Gaul at 3/21/01 1:27:15 PM


    The code works so long as I am displaying all fields. When I hide fields, the code stops working. Is there any other property the could be interacting with dbGridHideFlds? The following are the dbGridHideFlds and dbMagicCell statements I&#39;m using.

    MyDb.dbGridHideFlds=&#34;AmtFinance&#34;
    MyDb.dbMagicCell=&#34;AmtFinance,align=right,<Scri pt Language=&#34;&#34;JavaScript&#34;&#34;>amtFinance d=#AmtFinance#</Script>format=[Currency]&#34;&_

    Thanks for your help!

    ------------
    John at 3/20/01 11:48:43 PM

    Hi Dennis,

    If you hide a field with dbGridHideFlds, but it&#39;s still included in your SELECT statement, then you can refer to it in a magic cell statement.

    For example, if you select f1,f2,f3 from table1. Then you can hide f2 and f3 with:

    x.dbGridHideFlds = &#34;f2,f3&#34;

    But your Magiccell can be:

    x.dbMagicCell = &#34;f1,,#f1# #f2# #f3#&#34;

    This will output only one column (f1) but it will contain all three fields in it. This is a technique we use all the time to put &#34;firstname middle lastname&#34; in one column for example.

    There&#39;s no reason your JavaScript can&#39;t use the same values. Here&#39;s how to troubleshoot it:

    Just output as shown above so that you actually SEE the values and the output in your cells. Then create your javascript and hard code the values and get that piece to work with fake hard coded values. Finally, combine the two substituting your magic cell values for your hard coded values. Watch your delimiters (both quotes, semicolons, and commas) as they can trip you up if you&#39;re not careful.

    Hope this helps,
    John


    ------------
    Dennis Gaul at 3/20/01 9:29:58 PM


    How can I include a field in dbGridHideFlds and also refer to the field in a magic cell javascript (summing the values in the hidden field)? All of my efforts so far result in a zero sum, as if the hidden field wasn&#39;t included in the select statement.


  7. #7
    Dennis Guest

    dbGridHideFlds (reply)

    John,
    Thanks a lot for the help. Your suggestion solved my problem

    Dennis Gaul
    eAutoTrac.com


    ------------
    John at 3/22/01 4:14:45 PM

    Hi Dennis,

    The problem is that you have to use a field in MagicCell that is not hidden. If it&#39;s hidden (dbGridHideFlds) then it won&#39;t ever get &#34;executed&#34;.

    All you have to do is to put your code to do the Javascript variable assignment in a different (displayed) field.

    For example, you&#39;re doing:

    select f1,f2,f3 and you&#39;re hiding field f1

    Then you&#39;re doing a magicell on f1. No good. Instead do magiccell on f2 like this:

    x.dbMagicCell = &#34;f2,,#f2#<script language=&#34;&#34;javascript&#34;&#34;>myf1=#f1#</script>&#34;

    This way, when the f2 field is output, it will show its normal value, but the JS code executes and assigns your variable for field f1.

    This should do it!

    John


    ------------
    Dennis Gaul at 3/21/01 3:08:06 PM


    The hidden field is one that doesn&#39;t appear in the body of the report, but is included in a summary(non-ASPdb) that is written at the end of the report, where it is included with totals of data in the body of the report.

    ------------
    Mark at 3/21/01 1:59:25 PM

    Dennis,

    Just curious ... Why are you doing a MagicCell to reformat a field you can&#39;t see anyway? What&#39;s the purpose? If you tell us what you are trying to accomplish, we can suggest a solution.

    What do you mean by &#34;the code stops working&#34;?? How do you know that? There is nothing to see if the field is hidden.

    Mark.


    ------------
    Dennis Gaul at 3/21/01 1:27:15 PM


    The code works so long as I am displaying all fields. When I hide fields, the code stops working. Is there any other property the could be interacting with dbGridHideFlds? The following are the dbGridHideFlds and dbMagicCell statements I&#39;m using.

    MyDb.dbGridHideFlds=&#34;AmtFinance&#34;
    MyDb.dbMagicCell=&#34;AmtFinance,align=right,<Scri pt Language=&#34;&#34;JavaScript&#34;&#34;>amtFinance d=#AmtFinance#</Script>format=[Currency]&#34;&_

    Thanks for your help!

    ------------
    John at 3/20/01 11:48:43 PM

    Hi Dennis,

    If you hide a field with dbGridHideFlds, but it&#39;s still included in your SELECT statement, then you can refer to it in a magic cell statement.

    For example, if you select f1,f2,f3 from table1. Then you can hide f2 and f3 with:

    x.dbGridHideFlds = &#34;f2,f3&#34;

    But your Magiccell can be:

    x.dbMagicCell = &#34;f1,,#f1# #f2# #f3#&#34;

    This will output only one column (f1) but it will contain all three fields in it. This is a technique we use all the time to put &#34;firstname middle lastname&#34; in one column for example.

    There&#39;s no reason your JavaScript can&#39;t use the same values. Here&#39;s how to troubleshoot it:

    Just output as shown above so that you actually SEE the values and the output in your cells. Then create your javascript and hard code the values and get that piece to work with fake hard coded values. Finally, combine the two substituting your magic cell values for your hard coded values. Watch your delimiters (both quotes, semicolons, and commas) as they can trip you up if you&#39;re not careful.

    Hope this helps,
    John


    ------------
    Dennis Gaul at 3/20/01 9:29:58 PM


    How can I include a field in dbGridHideFlds and also refer to the field in a magic cell javascript (summing the values in the hidden field)? All of my efforts so far result in a zero sum, as if the hidden field wasn&#39;t included in the select statement.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •