cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with summary field in group footer

Former Member
0 Kudos

Hello

In a dynamically generated Report in c#, i made a sum in some group footer i have generated.

the values to sum are integers. But Crystal show a result like that : 1254.00 and i want it this 1254.

here the code use to make the sum in the group footer

...

l_CrySectionSousTotal = m_ReportClientDocument.ReportDefController.ReportDefinition.get_GroupFooterArea(b_intNumGroupe).Sections[0];

l_champsTotal.FieldFormat.NumericFormat.RoundingFormat = CrRoundingTypeEnum.crRoundingTypeRoundToUnit;

l_champsTotal.FieldFormat.NumericFormat.NDecimalPlaces = 0;

l_champsTotal.DataSource = "Sum ({ado.Poids})";

m_ReportClientDocument.ReportDefController.ReportObjectController.Add(l_champsTotal, l_CrySectionSousTotal, -1);

it's seem's like the NDecimalPlaces property do nothing.... i don't understand.

if you have an exemple of use of NDecimalPlaces ....

thanks for you help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello, Jonik;

The formatting changes will not take effect unless you tell the field not to use the default values.

So, try adding a line of code such as:

l_champsTotal.FieldFormat.CommonFormat.EnableSystemDefault = False;

before:

l_champsTotal.FieldFormat.NumericFormat.RoundingFormat = CrRoundingTypeEnum.crRoundingTypeRoundToUnit;

l_champsTotal.FieldFormat.NumericFormat.NDecimalPlaces = 0;

Elaine

Former Member
0 Kudos

Thanks a lot Elaine ... Your solution worked for me. I was having same problem as Jonik and followed many posts here. But nothing was working. I don't know how I missed this thread, I think today was my lucky day that I found this post.

Thanks again both of you

Regards,

Namrata Mathur

Answers (1)

Answers (1)

Former Member
0 Kudos

thanks,

now it's ok.