CSReportDll.cReport.getGroupMin C# (CSharp) Метод

getGroupMin() публичный Метод

public getGroupMin ( int colIndex, int indexGroup ) : double
colIndex int
indexGroup int
Результат double
        public double getGroupMin(int colIndex, int indexGroup)
        {
            int iRow = 0;
            double rtn = 0;
            int i = 0;

            rtn = (double)cReportGlobals.valVariant(m_rows.Rows[m_vRowsIndex[iRow]][colIndex]);

            if (indexGroup == -1)
            {
                for (iRow = 0; iRow < m_recordCount; iRow++)
                {
                    double value = (double)cReportGlobals.valVariant(m_rows.Rows[m_vRowsIndex[iRow]][colIndex]);
                    if (rtn > value)
                    {
                        rtn = value;
                    }
                }
            }
            else
            {
                if (m_vGroups[indexGroup].grandTotalGroup)
                {
                    for (iRow = 0; iRow < m_recordCount; iRow++)
                    {
                        double value = (double)cReportGlobals.valVariant(m_rows.Rows[m_vRowsIndex[iRow]][colIndex]);
                        if (rtn > value)
                        {
                            rtn = value;
                        }
                    }
                }
                else
                {
                    for (iRow = m_iRow; iRow < m_recordCount; iRow++)
                    {
                        for (i = 0; i < indexGroup; i++)
                        {
                            switch (m_vGroups[i].comparisonType)
                            {
                                case csRptGrpComparisonType.CSRPTGRPTEXT:

                                    if (m_vGroups[i].value == null)
                                    {
                                        return rtn;
                                    }
                                    else
                                    {
                                        object value = m_rows.Rows[m_vRowsIndex[iRow]][m_vGroups[i].indexField];
                                        String text = (String)cReportGlobals.valVariant(value);
                                        if ((String)m_vGroups[i].value != text.ToLower())
                                        {
                                            return rtn;
                                        }
                                    }
                                    if (i == indexGroup)
                                    {
                                        double value = (double)cReportGlobals.valVariant(m_rows.Rows[m_vRowsIndex[iRow]][colIndex]);
                                        if (rtn > value)
                                        {
                                            rtn = value;
                                        }
                                    }
                                    break;

                                case csRptGrpComparisonType.CSRPTGRPNUMBER:

                                    if (m_vGroups[i].value == null)
                                    {
                                        return rtn;
                                    }
                                    else
                                    {
                                        object value = m_rows.Rows[m_vRowsIndex[iRow]][m_vGroups[i].indexField];
                                        double number = cUtil.val(cReportGlobals.valVariant(value));
                                        if ((double)m_vGroups[i].value != number)
                                        {
                                            return rtn;
                                        }
                                    }
                                    if (i == indexGroup)
                                    {
                                        double value = (double)cReportGlobals.valVariant(m_rows.Rows[m_vRowsIndex[iRow]][colIndex]);
                                        if (rtn > value)
                                        {
                                            rtn = value;
                                        }
                                    }
                                    break;

                                case csRptGrpComparisonType.CSRPTGRPDATE:

                                    if (m_vGroups[i].value == null)
                                    {
                                        return rtn;
                                    }
                                    else
                                    {
                                        object value = m_rows.Rows[m_vRowsIndex[iRow]][m_vGroups[i].indexField];
                                        DateTime date = cReportGlobals.dateValue(cReportGlobals.valVariant(value));
                                        if ((DateTime)m_vGroups[i].value != date)
                                        {
                                            return rtn;
                                        }
                                    }
                                    if (i == indexGroup)
                                    {
                                        double value = (double)cReportGlobals.valVariant(m_rows.Rows[m_vRowsIndex[iRow]][colIndex]);
                                        if (rtn > value)
                                        {
                                            rtn = value;
                                        }
                                    }
                                    break;
                            }
                        }
                    }
                }
            }
            return rtn;
        }
cReport