-
formatting questions
I need to format a field (cell) the following way:
If the value is greater than 0, then the background color needs to be yellow and the font is red, otherwise the font remains black (or default). Also for this column the format has to be currency.
MC3 = "DSO60,bgcolor=yellow,<FONT COLOR=Red>#dso60#</font>;"
MyDb3.dbMagicCell = MC3
This gives me the correct colors, but doesn't validate the data.
MC3 = "DSO60,,(|GT|0|bgcolor=Yellow);"
MyDb3.dbMagicCell = MC3
Validates the data, but only my background changes color.
How can I combine the two? Or is there better way to do this?
-
-
-
You're close there. You're missing the field name in your second example though. You need to add: |#fldname# to the end of your magiccell (before the semicolon) to get the data to show up. So, your:
"DSO60,,(|GT|0|bgcolor=Yellow);"
Becomes:
"DSO60,,(|GT|0|bgcolor=Yellow|#DSO60#);"
Check out the numerous magiccell examples at www.ASPdbTest.com
Thanks,
John
Last edited by John; 03-10-2003 at 12:36 PM.
-
Yes, it gives me the yellow background if the value is > 0. Now if I can only have the font color in red if value > 0 and the format in currency for the same field would be fantastic.
-
Hi,
Did you checkout the examples as suggested? Rather than having us write your code for you, you'd be much better served by learning to answer this and future questions (which you'll undoubtably have) by checking out the examples and the manual.
Go to www.ASPdbTest.com and click on the ENTERPRISE link. Then check out example 4a. It's exactly what you're asking for. 4b through 4d are also very helpful.
If after studying those and trying out that syntax you still have questions, please feel free to come back for more assistance.
Thanks,
John
-
How about use the Designer to knock this out...on top of studying the examples. This is the purpose of the Designer - to avoid the "<;|" typos
FK
-
I haven't tried the Designer, but will try that option. Examples have answered many questions in the past. I didn't think that a color and formatting issue will be bunched in with column aggregate example. Also I don't have the enterprise version.
-
MMMnnn.. as I remember that Xtended MagicCell applies to EP+ version. Try the Designer... your'll development time will be much shorter.
FK
-
Try examples 2a-2d (not 4a-4d).
You are so close. Just add a <FONT> tag:
"DSO60,,(|GT|0|bgcolor=Yellow|<FONT COLOR=RED>#DSO60#</FONT>);"
-
I meant 2a/2b not 4a/4b. The title there is pretty obvious "Conditional formatting of cells using an enhanced dbMagicCell property"
The thing I'm confused about though is that if you don't have Enterprise, how the enhanced MC will work for you.
John
-
ASP-db Pro is all you need for Extended MagicCell. You do not need the Enterprise level. See the Product Matrix at:
http://www.usintertech.com/aspdb/matrix_aspdb.shtm
-
That worked. Thanks all, now I have to also format for currency?
-
Currency formatting is covered in the BASIC examples, A1 in fact!
You'll see where you replace the field name near the end of your line with "format=[currency]"
Thanks,
John
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|