Beispiel #1
0
        public cReportChartSerie add(cReportChartSerie c, String key)
        {
            try
            {
                if (c == null)
                {
                    c = new cReportChartSerie();
                }

                if (key == "")
                {
                    Add(getDummyKey(), c);
                }
                else
                {
                    Add(cReportGlobals.getKey(key), c);
                }

                return(c);
            }
            catch
            {
                return(null);
            }
        }
Beispiel #2
0
        private void pFill(cWebChart chart, DataRowCollection rows, String strFormat)
        {
            int i = 0;

            t_SerieValue[]    values = null;
            cReportChartSerie serie  = null;
            int idxSerie             = 0;

            if (m_top == 0)
            {
                m_top = 50;
            }

            // TODO: we need the rows dimension. remeber rows is a matrix (cols by rows)
            if (rows.Count < 0)
            {
                return;
            }

            // TODO: we need the rows dimension. remeber rows is a matrix (cols by rows)
            if (rows.Count < m_top)
            {
                // TODO: we need the rows dimension. remeber rows is a matrix (cols by rows)
                pRedim(ref values, rows.Count);
            }
            else
            {
                pRedim(ref values, m_top - 1);
            }

            for (int _i = 0; _i < m_series.count(); _i++)
            {
                serie = m_series.item(_i);

                // At the time we only support two series
                //
                idxSerie = idxSerie + 1;
                if (idxSerie > 2)
                {
                    return;
                }

                pGetSerieValues(rows,
                                values,
                                serie.getValueIndex(),
                                serie.getLabelIndex(),
                                m_chartType == csRptChartType.PIE);

                for (i = 0; i < values.Length; i++)
                {
                    if (values[i].idx != -1)
                    {
                        if (idxSerie == 1)
                        {
                            cWebChartItem w_add = chart.getItems().add(null);
                            w_add.setPrimaryValue(values[i].value);
                            w_add.setPrimaryLabel(cReportGlobals.format(values[i].label, strFormat));
                            w_add.setPieLabel(cReportGlobals.format(values[i].label, strFormat));
                            w_add.setAlternateValue(0);
                        }
                        else if (idxSerie == 2)
                        {
                            cWebChartItem w_item = chart.getItems().item(i);
                            w_item.setAlternateValue(values[i].value);
                            w_item.setPieLabel(cReportGlobals.format(values[i].label, strFormat));
                            w_item.setAltLabel(cReportGlobals.format(values[i].label, strFormat));
                        }
                    }
                }

                if ((values.Length > m_top - 1) && m_chartType == csRptChartType.PIE)
                {
                    cWebChartItem w_item = chart.getItems().item(chart.getItems().count() - 1);
                    w_item.setPrimaryLabel("Otros");
                    w_item.setPieLabel("Otros");
                }
            }

            if (chart.getItems().count() > 0)
            {
                chart.getItems().item(0).setExplode(true);
            }
        }
Beispiel #3
0
        internal bool save(CSXml.cXml xDoc, XmlNode nodeFather)
        {
            CSXml.cXmlProperty xProperty = null;
            XmlNode            nodeObj   = null;

            xProperty = new CSXml.cXmlProperty();

            xProperty.setName("Chart");
            nodeObj = xDoc.addNodeToNode(nodeFather, xProperty);

            xProperty.setName("LineStyle");
            xProperty.setValue(eTypes.eInteger, m_chartLineStyle);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("BarOutline");
            xProperty.setValue(eTypes.eBoolean, m_chartBarOutline);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("ShowValues");
            xProperty.setValue(eTypes.eBoolean, m_chartShowValues);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("PieThickness");
            xProperty.setValue(eTypes.eInteger, m_pieThickness);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("PieDiameter");
            xProperty.setValue(eTypes.eInteger, m_pieDiameter);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("ImageFormat");
            xProperty.setValue(eTypes.eInteger, m_imageFormat);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("Copyright");
            xProperty.setValue(eTypes.eText, m_copyright);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("ChartTitle");
            xProperty.setValue(eTypes.eText, m_chartTitle);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("ChartType");
            xProperty.setValue(eTypes.eInteger, m_chartType);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("Top");
            xProperty.setValue(eTypes.eInteger, m_top);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("GroupFieldName");
            xProperty.setValue(eTypes.eText, m_groupFieldName);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("GroupFieldIndex");
            xProperty.setValue(eTypes.eInteger, m_groupFieldIndex);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("GroupValue");
            xProperty.setValue(eTypes.eText, m_groupValue);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("Sort");
            xProperty.setValue(eTypes.eBoolean, m_sort);
            xDoc.addPropertyToNode(nodeObj, xProperty);

            xProperty.setName("Series");
            nodeObj = xDoc.addNodeToNode(nodeObj, xProperty);

            cReportChartSerie serie = null;
            int index = 0;

            for (int _i = 0; _i < m_series.count(); _i++)
            {
                serie = m_series.item(_i);
                index = index + 1;
                serie.save(xDoc, nodeObj, index);
            }

            return(true);
        }
        public cReportChartSerie add(cReportChartSerie c, String key)
        {
            try
            {
                if (c == null) 
                { 
                    c = new cReportChartSerie(); 
                }

                if (key == "")
                {
                    Add(getDummyKey(), c);
                }
                else
                {
                    Add(cReportGlobals.getKey(key), c);
                }

                return c;
            }
            catch
            {
                return null;
            }
        }