getVariables() private method

private getVariables ( ) : cReportVariables
return cReportVariables
        private void evalMin(cReportFormulaInt fint)
        {
            object value = null;

            if (fint.getVariables().item(C_MIN) == null)
            {
                fint.getVariables().add(null, C_MIN);
            }

            cReportVariable w_item = fint.getVariables().item(C_MIN);
            // The Min function is for numbers and strings
            //
            value = m_report.getValue(fint.getParameters().item(0).getValue());

            if (value.GetType() == typeof(String))
            {
                if (String.Compare(w_item.getValue().ToString(),
                                    value.ToString(),
                                    StringComparison.CurrentCulture) > 0)
                {
                    w_item.setValue(value);
                }
            }
            else
            {
                if ((double)w_item.getValue() > (double)value)
                {
                    w_item.setValue(value);
                }
            }
        }
        private void evalSum(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_SUM) == null)
            {
                fint.getVariables().add(null, C_SUM).setValue(0);
            }

            cReportVariable w_item = fint.getVariables().item(C_SUM);
            // the sum function is for numbers
            //
            w_item.setValue(Convert.ToDouble(w_item.getValue())
                + pGetNumber(m_report.getValue(fint.getParameters().item(0).getValue(), true)));
        }
        private void evalSumTime(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_SUMTIME) == null)
            {
                fint.getVariables().add(null, C_SUMTIME).setValue(new cStructTime());
            }

            cReportVariable w_item = fint.getVariables().item(C_SUMTIME);
            // the SumTime if for dates
            //
            pSumTimes((cStructTime)w_item.getValue(),
                        DateTime.Parse(m_report.getValue(fint.getParameters().item(0).getValue(), true).ToString()));
        }
        private void evalIsInRs(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_ISINRS) == null)
            {
                fint.getVariables().add(null, C_ISINRS);
            }

            cReportVariable w_item = fint.getVariables().item(C_ISINRS);
            // TODO: finish coding evalIsInRs
            //
            w_item.setValue(true);
        }
 private double resultSum(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() == 0) { return 0; }
     return Convert.ToDouble(fint.getVariables().item(C_SUM).getValue());
 }
        private void evalIsNotEqual(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_ISNOTEQUAL) == null)
            {
                fint.getVariables().add(null, C_ISNOTEQUAL);
            }

            cReportVariable w_item = fint.getVariables().item(C_ISNOTEQUAL);
            // the IsNotEqual function is for numbers
            //
            String strValue = "";
            String strConstValue = "";

            strValue = (String)m_report.getValue(fint.getParameters().item(0).getValue(), true);
            strConstValue = fint.getParameters().item(1).getValue();

            w_item.setValue(strValue != strConstValue);
        }
        private void evalGroupCount(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_GROUPCOUNT) == null)
            {
                fint.getVariables().add(null, C_GROUPCOUNT);
            }

            cReportVariable w_item = fint.getVariables().item(C_GROUPCOUNT);
            // the Count function is for numbers

            // if param1 doesn't contain an index column is because we haven't
            // process the formulas yet. It happens because compilereport
            // is called before the InitColIndex in cReport's Launch function
            // and the order can not be changed because the function GetData 
            // is executed after the CompileReport function, and we don't want
            // to change this order because we are afraid of the collateral damage
            // it could produce :(
            //
            // In the future we can analize it and modify the order and if this
            // doesn't produce any error we will remove this if :)
            //
            if (fint.getParameters().item(cReportGlobals.C_KEYINDEXCOL) == null)
            {
                w_item.setValue(0);
            }
            else
            {
                w_item.setValue(
                    m_report.getGroupCount(
                        int.Parse(fint.getParameters().item(cReportGlobals.C_KEYINDEXCOL).getValue()),
                        int.Parse(fint.getParameters().item(cReportGlobals.C_KEYINDEXGROUP).getValue())));
            }
        }
 private double resultAverage(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() == 0) 
     { 
         return 0; 
     }
     double sum = (double)fint.getVariables().item(C_AVERAGESUM).getValue();
     double count = (double)fint.getVariables().item(C_AVERAGECOUNT).getValue();
     return sum / count;
 }
 private object resultGroupAverage(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() > 0)
     {
         return fint.getVariables().item(C_GROUPAVERAGE).getValue();
     }
     else
     {
         return 0;
     }
 }
Exemplo n.º 10
0
 private object resultIsNotEqual(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() > 0)
     {
         return fint.getVariables().item(C_ISNOTEQUAL).getValue();
     }
     else
     {
         return 0;
     }
 }
Exemplo n.º 11
0
 private object resultIsLessThan(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() > 0)
     {
         return fint.getVariables().item(C_ISLESSTHAN).getValue();
     }
     else
     {
         return 0;
     }
 }
Exemplo n.º 12
0
 private object resultNumberToString(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() > 0)
     {
         return fint.getVariables().item(C_NUMBERTOSTRING).getValue();
     }
     else
     {
         return "";
     }
 }
Exemplo n.º 13
0
 private object resultCount(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() == 0) { return null; }
     return fint.getVariables().item(C_COUNT).getValue();
 }
Exemplo n.º 14
0
 private double resultMin(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() == 0) { return 0; }
     return (double)fint.getVariables().item(C_MIN).getValue();
 }
Exemplo n.º 15
0
        private void evalCount(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_COUNT) == null)
            {
                fint.getVariables().add(null, C_COUNT);
            }

            cReportVariable w_item = fint.getVariables().item(C_COUNT);
            // the Count functio is for numbers
            //
            w_item.setValue((double)w_item.getValue() + 1);
        }
Exemplo n.º 16
0
 private object resultGroupCount(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() > 0)
     {
         return fint.getVariables().item(C_GROUPCOUNT).getValue();
     }
     else
     {
         return 0;
     }
 }
Exemplo n.º 17
0
        private void evalNumberToString(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_NUMBERTOSTRING) == null)
            {
                fint.getVariables().add(null, C_NUMBERTOSTRING);
            }

            cReportVariable w_item = fint.getVariables().item(C_NUMBERTOSTRING);
            // the NumberToString funciton is for numbres
            //
            double iNumber = 0;
            int iLenguage = 0;

            iNumber = pGetNumber(m_report.getValue(fint.getParameters().item(0).getValue(), true));
            iLenguage = cUtil.valAsInt(fint.getParameters().item(1).getValue());

            cNumberToString ntos = new cNumberToString();

            switch (iLenguage)
            {
                case C_SPANISH:
                    w_item.setValue(ntos.spanishNumberToString(iNumber));
                    break;
                case C_ENGLISH:
                    w_item.setValue(ntos.englishNumberToString(iNumber));
                    break;
                case C_FRENCH:
                    w_item.setValue(ntos.frenchNumberToString(iNumber));
                    break;
            }
        }
Exemplo n.º 18
0
 private object resultGroupLineNumber(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() > 0)
     {
         return fint.getVariables().item(C_GROUPLINENUMBER).getValue();
     }
     else
     {
         return 0;
     }
 }
Exemplo n.º 19
0
        private void evalIsLessThan(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_ISLESSTHAN) == null)
            {
                fint.getVariables().add(null, C_ISLESSTHAN);
            }

            cReportVariable w_item = fint.getVariables().item(C_ISLESSTHAN);
            // the IsLessThan function is for numbers
            //
            object value = m_report.getValue(fint.getParameters().item(0).getValue(), true);
            object constValue = fint.getParameters().item(1).getValue();

            if (value.GetType() == typeof(String))
            {
                String strValue = value.ToString();
                String strConstValue = constValue.ToString();

                if (String.Compare(strValue.ToString(),
                                    strConstValue.ToString(),
                                    StringComparison.CurrentCulture) < 0)
                {
                    w_item.setValue(true);
                }
                else
                {
                    w_item.setValue(false);
                }
            }
            else
            {
                if ((double)value < (double)constValue)
                {
                    w_item.setValue(true);
                }
                else
                {
                    w_item.setValue(false);
                }
            }
        }
Exemplo n.º 20
0
 private object resultIsInRs(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() > 0)
     {
         return fint.getVariables().item(C_ISINRS).getValue();
     }
     else
     {
         return 0;
     }
 }
Exemplo n.º 21
0
        private void evalGroupLineNumber(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_GROUPLINENUMBER) == null)
            {
                fint.getVariables().add(null, C_GROUPLINENUMBER);
            }

            cReportVariable w_item = fint.getVariables().item(C_GROUPLINENUMBER);
            // the LineNumber function is for numbers
            w_item.setValue(
                m_report.getGroupLineNumber(
                    int.Parse(fint.getParameters().item(cReportGlobals.C_KEYINDEXGROUP).getValue())));
        }
Exemplo n.º 22
0
        private void evalAverage(cReportFormulaInt fint)
        {
            if (fint.getVariables().item(C_AVERAGESUM) == null)
            {
                fint.getVariables().add(null, C_AVERAGESUM);
                fint.getVariables().add(null, C_AVERAGECOUNT);
            }

            cReportVariable w_item = fint.getVariables().item(C_AVERAGESUM);
            // the average function is for numbers
            //
            w_item.setValue((double)w_item.getValue()
                + pGetNumber(m_report.getValue(fint.getParameters().item(0).getValue(), true)));

            w_item = fint.getVariables().item(C_AVERAGECOUNT);
            // the average function is for numbers
            //
            w_item.setValue((double)w_item.getValue() + 1);
        }
Exemplo n.º 23
0
        private void pEvalFunctionGroup(cReportFormulaInt fint)
        {
            double value = 0;
            double total = 0;

            if (fint.getVariables().count() > 0)
            {
                if (fint.getParameters().item(cReportGlobals.C_KEYINDEXCOL2) == null)
                {
                    value = 0;
                }
                else
                {
                    int columnIndex = int.Parse(fint.getParameters().item(cReportGlobals.C_KEYINDEXCOL2).getValue());
                    value = cUtil.val(m_report.getValueFromRs(columnIndex).ToString());
                }

                cReportVariable var = fint.getVariables().item(C_GROUPPERCENTT);
                total = cUtil.val(var.getValue().ToString());
                value = cUtil.divideByZero(value, total);
                var.setValue(value);

            }

        }
Exemplo n.º 24
0
 private String resultSumTime(cReportFormulaInt fint)
 {
     if (fint.getVariables().count() == 0) 
     { 
         return ""; 
     }
     cStructTime st = null;
     st = (cStructTime)fint.getVariables().item(C_SUMTIME).getValue();
     if (cUtil.val(fint.getParameters().item(1).getValue()) != 0)
     {
         return cReportGlobals.format(st.getHour(), "00")
                 + ":" + cReportGlobals.format(st.getMinute(), "00")
                 + ":" + cReportGlobals.format(st.getSecond(), "00");
     }
     else
     {
         return cReportGlobals.format(st.getHour(), "00") + ":" + cReportGlobals.format(st.getMinute(), "00");
     }
 }