Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problems with summary field in group footer

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.

replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question