CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Display negative numbers in red

Print topic Send  topic

Author Message
grum

Posts: 42
Posted: 05/22/2006, 9:47 PM

I am displaying numbers from a database and went positive numbers to display in blue and Red'>negative in red. Can someone point me to ean example of how this would be done. I cant sem to find antythink in the manual.

Regards
View profile  Send private message
WKempees
Posted: 05/23/2006, 2:04 AM

http://forums.codecharge.com/posts.php?post_id=68718
http://forums.codecharge.com/posts.php?post_id=70228

Should get you on the way.
In the Before Show of a Form/Grid, set the default color you want.
In the Before Show of the Label do the specific/conditional colouring.

Walter


"grum" <grum@forum.codecharge> schreef in bericht
news:5447293d8d7746@news.codecharge.com...
>I am displaying numbers from a database and went positive numbers to
>display in
> blue and Red'>negative in red. Can someone point me to ean example of how this
> would be done. I cant sem to find antythink in the manual.
>
> Regards
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

grum

Posts: 42
Posted: 05/23/2006, 5:59 AM

Thanks for the feedback.

I have looked through the links but they deal with the whole row.

What I need is to either specify a class or somthing else to change the colour of a number in a cell depending on the value. If < 0 red else if > 0 blue.
Each row's values will be different and I need the colour to change.

I have tried custom code with some limited success.

Hope this makes sense.



View profile  Send private message
WKempees
Posted: 05/23/2006, 7:36 AM

Grum,

It doesn't matter if it's a row or a label, technique can be the same.
You can also do it with a class.
In ProjectExplorer, Files open the .css you are using, add a class just as
you want it.
In the HTML of your page (using the technique in the various posts) add
class='yourclass' to the <td> in which your label is.
If you want to make it dynamic use the text from the posts and substitue
'yourclass'with a FormLabel.
Then programmatically set the content of YourLabel to contain 'yourclass' or
another class.

Walter

"grum" <grum@forum.codecharge> schreef in bericht
news:54473071b87521@news.codecharge.com...
> Thanks for the feedback.
>
> I have looked through the links but they deal with the whole row.
>
> What I need is to either specify a class or somthing else to change the
> colour
> of a number in a cell depending on the value. If < 0 red else if > 0
> blue.
> Each row's values will be different and I need the colour to change.
>
> I have tried custom code with some limited success.
>
> Hope this makes sense.
>
>
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

DonB
Posted: 05/24/2006, 11:42 AM

Here's the easy way:

Put this in the Format property:

#.#;[Red]#.#

You get Red'>negative values in Red (or choose any color you want, that HTML
'understands'). Change the format strings if you wnat, too (I chose a float
format).

#.#[Blue];[Red]#.#

would also display positive numbers in Blue.

The complete format property breakdown is:

positive number format;Red'>negative number format;zero number format;Null number
format;decimal separator;group separator

This is in the Help, under "Number Format"

--
DonB

http://www.gotodon.com/ccbth


"grum" <grum@forum.codecharge> wrote in message
news:5447293d8d7746@news.codecharge.com...
> I am displaying numbers from a database and went positive numbers to
display in
> blue and Red'>negative in red. Can someone point me to ean example of how this
> would be done. I cant sem to find antythink in the manual.
>
> Regards
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

grum

Posts: 42
Posted: 05/24/2006, 1:50 PM

Thanks alot for the help - have those both working a treat.

Thanks again
View profile  Send private message
WKempees
Posted: 05/26/2006, 3:56 AM

DonB,
Recognize this: "Sometimes a solution is so simple, one cannot see it
through ones own approach to the problem"
Thanks man, brilliantly simple.
All this great tooling is blogging my old brains.

Walter

"DonB" <~ccbth~@gotodon.com> schreef in bericht
news:e529fi$56a$1@news.codecharge.com...
> Here's the easy way:
>
> Put this in the Format property:
>
> #.#;[Red]#.#
>
> You get Red'>negative values in Red (or choose any color you want, that HTML
> 'understands'). Change the format strings if you wnat, too (I chose a
> float
> format).
>
> #.#[Blue];[Red]#.#
>
> would also display positive numbers in Blue.
>
> The complete format property breakdown is:
>
> positive number format;Red'>negative number format;zero number format;Null
> number
> format;decimal separator;group separator
>
> This is in the Help, under "Number Format"
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "grum" <grum@forum.codecharge> wrote in message
>news:5447293d8d7746@news.codecharge.com...
>> I am displaying numbers from a database and went positive numbers to
> display in
>> blue and Red'>negative in red. Can someone point me to ean example of how
>> this
>> would be done. I cant sem to find antythink in the manual.
>>
>> Regards
>> ---------------------------------------
>> Sent from YesSoftware forum
>> http://forums.codecharge.com/
>>
>
>

DonB
Posted: 05/26/2006, 5:50 AM

Sometimes the hardest thing is finding the right page in the help file.

--
DonB

http://www.gotodon.com/ccbth


"WKempees" <kempe819@planet.nl> wrote in message
news:e56msh$7nj$1@news.codecharge.com...
> DonB,
> Recognize this: "Sometimes a solution is so simple, one cannot see it
> through ones own approach to the problem"
> Thanks man, brilliantly simple.
> All this great tooling is blogging my old brains.
>
> Walter
>
> "DonB" <~ccbth~@gotodon.com> schreef in bericht
>news:e529fi$56a$1@news.codecharge.com...
> > Here's the easy way:
> >
> > Put this in the Format property:
> >
> > #.#;[Red]#.#
> >
> > You get Red'>negative values in Red (or choose any color you want, that HTML
> > 'understands'). Change the format strings if you wnat, too (I chose a
> > float
> > format).
> >
> > #.#[Blue];[Red]#.#
> >
> > would also display positive numbers in Blue.
> >
> > The complete format property breakdown is:
> >
> > positive number format;Red'>negative number format;zero number format;Null
> > number
> > format;decimal separator;group separator
> >
> > This is in the Help, under "Number Format"
> >
> > --
> > DonB
> >
> > http://www.gotodon.com/ccbth
> >
> >
> > "grum" <grum@forum.codecharge> wrote in message
> >news:5447293d8d7746@news.codecharge.com...
> >> I am displaying numbers from a database and went positive numbers to
> > display in
> >> blue and Red'>negative in red. Can someone point me to ean example of how
> >> this
> >> would be done. I cant sem to find antythink in the manual.
> >>
> >> Regards
> >> ---------------------------------------
> >> Sent from YesSoftware forum
> >> http://forums.codecharge.com/
> >>
> >
> >
>
>

WKempees
Posted: 05/26/2006, 1:47 PM

True, and in Wishes already!

"DonB" <~ccbth~@gotodon.com> schreef in bericht
news:e56thu$ao8$1@news.codecharge.com...
> Sometimes the hardest thing is finding the right page in the help file.
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "WKempees" <kempe819@planet.nl> wrote in message
>news:e56msh$7nj$1@news.codecharge.com...
>> DonB,
>> Recognize this: "Sometimes a solution is so simple, one cannot see it
>> through ones own approach to the problem"
>> Thanks man, brilliantly simple.
>> All this great tooling is blogging my old brains.
>>
>> Walter
>>
>> "DonB" <~ccbth~@gotodon.com> schreef in bericht
>>news:e529fi$56a$1@news.codecharge.com...
>> > Here's the easy way:
>> >
>> > Put this in the Format property:
>> >
>> > #.#;[Red]#.#
>> >
>> > You get Red'>negative values in Red (or choose any color you want, that HTML
>> > 'understands'). Change the format strings if you wnat, too (I chose a
>> > float
>> > format).
>> >
>> > #.#[Blue];[Red]#.#
>> >
>> > would also display positive numbers in Blue.
>> >
>> > The complete format property breakdown is:
>> >
>> > positive number format;Red'>negative number format;zero number format;Null
>> > number
>> > format;decimal separator;group separator
>> >
>> > This is in the Help, under "Number Format"
>> >
>> > --
>> > DonB
>> >
>> > http://www.gotodon.com/ccbth
>> >
>> >
>> > "grum" <grum@forum.codecharge> wrote in message
>> >news:5447293d8d7746@news.codecharge.com...
>> >> I am displaying numbers from a database and went positive numbers to
>> > display in
>> >> blue and Red'>negative in red. Can someone point me to ean example of how
>> >> this
>> >> would be done. I cant sem to find antythink in the manual.
>> >>
>> >> Regards
>> >> ---------------------------------------
>> >> Sent from YesSoftware forum
>> >> http://forums.codecharge.com/
>> >>
>> >
>> >
>>
>>
>
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.