| |
SharpGrid Support
Started by mikelgiles at 01-26-2010 9:33 AM. Topic has 1 replies.
 
 
 
|
|
Sort Posts:
|
|
|
|
01-26-2010, 9:33 AM
|
mikelgiles
Joined on 02-08-2006
Posts 11
|
HeaderFormula formating problem
|
|
|
|
|
I am having a problem making the format function work as expected inside a HeaderFormula property.
I am trying to keep all the headers spaced the same for easy viewing and all works ok unless one of the GroupCalc(1 or 2) happens to have no value. If both have non 0 values, everything gets spaced correctly but if either has a 0 value, that spacing doesnt follow the formating that I am trying for. What I am looking for is something like this
01/25/2010 0312 0356.2 -0044.2
01/26/2010 0322 0306.1 0015.9
01/27/2010 0344 0333.0 0011
if 01/26/2010 had a 0 value in either of the calc values, here is what happens
01/25/2010 0312 0356.2 -0044.2
01/26/2010 0306.1 0015.9
01/27/2010 0344 0011
I was thinking that the Format(GroupCalc(1),'0000') would reserve four spaces for the text. It does work if the number is 1 and shows up as 0001 but if it is 0, it ends up with "" (nothing)
What am I doing wrong?
Sample code
SG.Groups.Add "Dept", sgnoSort, sgSortTypeDefault, True, False
SG.Groups.Add "Center", sgnoSort, sgSortTypeDefault, True, False
SG.Groups.Add "Week", sgnoSort, sgSortTypeDefault, True, False
SG.Groups(3).HeaderTextSource = sgGrpHdrFormula
SG.Groups(3).Calculations.Add sgCalcSum, "Sched Hr" 'create calculations for header and footer
SG.Groups(3).Calculations.Add sgCalcSum, "Job Hr"
SG.Groups(3).HeaderFormula = "format(GroupingValue,'mm/dd/yyyy') & ' ' & Format(GroupCalc(1),'0000') & ' ' & Format(GroupCalc(2),'0000.0') & ' Free ' & Format((GroupCalc(1) - GroupCalc(2)),'0000.0') "
Thanks,
Mikel Giles
|
|
|
|
|
Report
|
|
|
|
01-26-2010, 10:40 PM
|
Andrey - DD
Joined on 08-01-2007
Russia, Novosibirsk
Posts 562

|
|
|
Mikel,
I've created a small sample and formatting is working good even for zero numbers and shows "0000.0". Can you please look into this sample and try to modify it to reproduce the issue?
Thank you, Andrey T.
|
|
|
|
|
Report
|
|
|
|
|
GrapeCity » Product Support » SharpGrid Suppo... » Re: HeaderFormula formating problem
|
|
|
|
|