on 06-09-2022 2:47 PM
Hello,
I am migrating one report using CR2020 SDK, I need to change Group property and edit the field name with group.
For example: Earlier it was A. Address
Now I like to change field information like: B.Address
I can see that field information can be changed but How I can change the table alias name also. Please suggest :
for (int i = 0; i < rptSrcClientDocument.DataDefinition.Groups.Count; i++)
{
CrystalDecisions.ReportAppServer.DataDefModel.ISCRGroup srcGroup = (CrystalDecisions.ReportAppServer.DataDefModel.ISCRGroup)rptSrcClientDocument.DataDefinition.Groups[i];
CrystalDecisions.ReportAppServer.DataDefModel.Group srcFormulaFieldInsert = srcGroup.Clone(true);
Object oldGrp = (object)rptSrcClientDocument.DataDefinition.Groups[i];
ISCRField conFild = srcGroup.ConditionField;
//It allows filed name like conFild.Name = "{Address" but do not allow like below
conFild.Name = "{B.Address}";<br> srcFormulaFieldInsert.ConditionField = conFild;
rptSrcClientDocument.DataDefController.GroupController.Remove(oldGrp);
rptSrcClientDocument.DataDefController.GroupController.Add(i, srcFormulaFieldInsert);
}<br>
Hi Yogesh,
To change it you need to Clone() the group first, then make the change and then delete the original and replace it with the new.
Look in my sample for cloning.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.