private bool initControls(List<object[]> recordsets)
{ // TODO: Use of ByRef founded Private Function InitControls(ByRef Recordsets As Collection) As Boolean
cReportControl ctrl = null;
cReportChartSerie serie = null;
int idx = 0;
for (int _i = 0; _i < m_controls.count(); _i++)
{
ctrl = m_controls.item(_i);
if (ctrl.getControlType() == csRptControlType.CSRPTCTFIELD
|| ctrl.getControlType() == csRptControlType.CSRPTCTDBIMAGE)
{
idx = ctrl.getField().getIndex();
if (!pInitCtrls(ctrl, out idx, recordsets, ctrl.getField().getName()))
{
return false;
}
ctrl.getField().setIndex(idx);
}
else if (ctrl.getControlType() == csRptControlType.CSRPTCTCHART)
{
if (ctrl.getChart().getGroupFieldName() != "")
{
idx = -1;
pInitCtrls(ctrl, out idx, recordsets, ctrl.getChart().getGroupFieldName());
ctrl.getChart().setGroupFieldIndex(idx);
}
else
{
ctrl.getChart().setGroupFieldIndex(-1);
}
for (int _j = 0; _j < ctrl.getChart().getSeries().count(); _j++)
{
serie = ctrl.getChart().getSeries().item(_j);
idx = serie.getValueIndex();
if (!pInitCtrls(ctrl, out idx, recordsets, serie.getValueFieldName()))
{
return false;
}
serie.setValueIndex(idx);
idx = serie.getLabelIndex();
if (!pInitCtrls(ctrl, out idx, recordsets, serie.getLabelFieldName()))
{
return false;
}
serie.setLabelIndex(idx);
}
ctrl.getChart().setChartCreated(false);
}
}
return true;
}