Hi,
I need to put the summary field in group footer area and format it. I saw this discussion How to format the summary field in GROUP? but how to do this: "use FieldObject class and embed the summary field's primary detail to FieldObject" programmatically.
I tried this but it doesn't work:
CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject fi = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
fi.Left = 500;
CrystalDecisions.ReportAppServer.DataDefModel.SummaryField summaryField = new CrystalDecisions.ReportAppServer.DataDefModel.SummaryField();
summaryField.SummarizedField = fieldToSummarize;
summaryField.Group = boGroup;
summaryField.Operation = (CrystalDecisions.ReportAppServer.DataDefModel.CrSummaryOperationEnum)elem.TypeCumul;
fi =(CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject) summaryField; // this line generates error
report.DataDefController.SummaryFieldController.Add(indexSummaryField, summaryField);
report.ReportDefController.ReportObjectController.Add(fi, section2, -1);
Thanks in advance.