Format Group field on query

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BenchmarkDan
Posts: 50
Joined: Sun Aug 10, 2008 7:40 pm
Location: Tulsa, OK
Contact:

Format Group field on query

Post by BenchmarkDan »

Group field on a query. SUM function on a currency field. I cannot get a reasonable display.
I have spent hours - this is simple, surely even I can get this.

...Not so. I give. Anything other than right align or plain {value} fails for me.

Tried:
<p align="right">{Value}$###,###.00</p>
<p align="right">{Value},$###,###.00</p>
<p align="right">{Value,$###,###.00}</p>
<p align="right">{Value},N</p>
<p align="right">{Value},n</p>
<p align="right">{Value},####,###.00</p>
<p align="right">{Value}####,###.00</p>
<p align="right">{Value,####,###.00}</p>
{Value}####,###.00
and many others.
Dan
_______________________________________________
V8.4 Developer Edition Build 2722. MS SQL Windows
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Format Group field on query

Post by Jaymer »

yeah, you're spinning your wheels there.
pretty sure thats just an oversight - something that was never implemented (but can be) and has never been reported.
to be safe and be sure thats its seen, just write it up and send it as a bug to [email protected]

1) You can see the row data will respect a format (like $ #.##), yet the group total will ignore the formatting (as you've seen)
Easily doable by Vlad - so you'll just have to wait for that in a future build. No reason the Group {value} can't either:
a) allow for explicit formatting as you tried, or
b) as a minimum, just format it the same as the column data

2) In your tests, you prolly realize you can view the Server Output and see "invalid expression...." entries as you whittle away your time.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Format Group field on query

Post by customaware »

Try this....in the Presentation Column

For SUM
<span style="font-weight: bold; color: navy; float: right;">#= kendo.toString(sum, 'n') # </span>

For COUNT
<span style="font-weight: bold; color: red; float: right;">#= kendo.toString(count, 'n') # </span>
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
BenchmarkDan
Posts: 50
Joined: Sun Aug 10, 2008 7:40 pm
Location: Tulsa, OK
Contact:

Re: Format Group field on query

Post by BenchmarkDan »

I agree Jaymer, this "should be there".

However, Mark your suggestion worked great. Thanks.

Added: font-size: 1.10em for a little size increase for the grouping total.
Added: a "$" -- although I thought I had seen that "$" might be trouble - but works here.

<span style="font-size: 1.10em; font-weight: bold;color: navy; float: right;">$#= kendo.toString(sum, 'n') # </span>

Looks good!
Dan
_______________________________________________
V8.4 Developer Edition Build 2722. MS SQL Windows
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Format Group field on query

Post by Jaymer »

BenchmarkDan wrote:I agree Jaymer, this "should be there".
this is great
all it needs is to actually be "in the product", not out on a forum somewhere, un-findable.
could easily be attached by support as a popup-help window and then anyone could do it.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
BenchmarkDan
Posts: 50
Joined: Sun Aug 10, 2008 7:40 pm
Location: Tulsa, OK
Contact:

Re: Format Group field on query

Post by BenchmarkDan »

You got that right.
Dan
_______________________________________________
V8.4 Developer Edition Build 2722. MS SQL Windows
rocketman
Posts: 1239
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Re: Format Group field on query

Post by rocketman »

WOW, this post just saved my life!!!

Here's another one I missed these past 9 years if anyone can help?. I've been changing a lot of my numeric attributes to be currency attributes, and utilising the Locale info to format UK customers with £ and Canadian customers with $ (only recently picked up some Canadian customers so it hasn't really been an issue until now - just me being lazy I guess)

All great except the report writer seems to totally ignore the locale data and just uses $

and ... does anyone have a similar solution for SUMming a duration attribute in a group. Vlad says it doesn't work and isn't meant to work, but I have no difficulty summing a duration at the bottom of a grid
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
rocketman
Posts: 1239
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Re: Format Group field on query

Post by rocketman »

and in answer to my own question, this brilliant fix didn't work for totally group durations (but totalling the whole query works .... how strange)
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
Post Reply