private void pSetFormulaIndexGroup(cReportFormula formula, cReportSection sec)
{ // TODO: Use of ByRef founded Private Function pSetFormulaIndexGroup(ByRef Formula As cReportFormula, ByRef Sec As cReportSection) As Boolean
cReportFormulaInt fint = null;
int indexGroup = 0;
for (int _i = 0; _i < formula.getFormulasInt().count(); _i++)
{
fint = formula.getFormulasInt().item(_i);
if (pIsGroupFormula((int)fint.getFormulaType()))
{
if (fint.getFormulaType() == csRptFormulaType.CSRPTGROUPPERCENT)
{
formula.setIdxGroup2(0);
indexGroup = cUtil.valAsInt(fint.getParameters().item(3).getValue());
}
else
{
indexGroup = cUtil.valAsInt(fint.getParameters().item(2).getValue());
}
if (fint.getParameters().item(cReportGlobals.C_KEYINDEXGROUP) == null)
{
fint.getParameters().add2("", cReportGlobals.C_KEYINDEXGROUP);
}
if (indexGroup == -1)
{
if (sec.getTypeSection() == csRptSectionType.GROUP_HEADER
|| sec.getTypeSection() == csRptSectionType.GROUP_FOOTER)
{
// index of the group
//
fint.getParameters().item(cReportGlobals.C_KEYINDEXGROUP).setValue(sec.getIndex().ToString());
formula.setIdxGroup(sec.getIndex());
}
else if (sec.getTypeSection() == csRptSectionType.MAIN_DETAIL)
{
// index of the most internal group
//
fint.getParameters().item(cReportGlobals.C_KEYINDEXGROUP).setValue(m_groups.count().ToString());
formula.setIdxGroup(m_groups.count()-1);
}
else
{
fint.getParameters().item(cReportGlobals.C_KEYINDEXGROUP).setValue("0");
formula.setIdxGroup(0);
}
}
else
{
fint.getParameters().item(cReportGlobals.C_KEYINDEXGROUP).setValue(indexGroup.ToString());
formula.setIdxGroup(indexGroup);
}
}
}
}