Пример #1
0
 protected override void RenderAxisCell(HtmlTextWriter writer, PivotGridAxisCellEventArgs args)
 {
     writer.WriteLine("<td>");
     writer.WriteLine(args.Text);
     writer.WriteLine("</td>");
 }
Пример #2
0
        private void RenderGridContent(HtmlTextWriter writer)
        {
            DataTable yAxisItems = DataTableHelper.SelectDistinct(_dataSource, _yAxisValueField);
            DataTable xAxisItems = DataTableHelper.SelectDistinct(_dataSource, _xAxisValueField);

            foreach (DataRow yAxisRow in yAxisItems.Rows)
            {
                RenderRowBegin(writer);

                string yAxisValue = yAxisRow[_yAxisValueField].ToString();

                PivotGridAxisCellEventArgs axisArgs = new PivotGridAxisCellEventArgs();
                axisArgs.Text = yAxisValue;
                RenderAxisCell(writer, axisArgs);

                foreach (DataRow xAxisRow in xAxisItems.Rows)
                {
                    string xAxisValue = xAxisRow[_xAxisValueField].ToString();

                    string expression = string.Format("{0}='{1}' and {2}='{3}'",
                        _yAxisValueField, yAxisValue,
                        _xAxisValueField, xAxisValue
                        );
                    DataRow[] founded = _dataSource.Select(expression);

                    string value = "";
                    if (founded.Length > 0)
                    {
                        value = founded[0][_factValueField].ToString();
                    }
                    PivotGridDataCellEventArgs dataArgs = new PivotGridDataCellEventArgs();
                    dataArgs.Text = value;
                    RenderDataCell(writer, dataArgs);
                }
                RenderRowEnd(writer);
            }
        }
Пример #3
0
        private void RenderGridHeader(HtmlTextWriter writer)
        {
            DataTable xAxisItems = DataTableHelper.SelectDistinct(_dataSource, _xAxisValueField);
            int xAxisItemsCount = xAxisItems.Rows.Count;

            // render x axis items
            RenderRowBegin(writer);
            RenderDummyCell(writer);
            foreach (DataRow xAxisRow in xAxisItems.Rows)
            {
                string xAxisValue = xAxisRow[_xAxisValueField].ToString();

                PivotGridAxisCellEventArgs axisArgs = new PivotGridAxisCellEventArgs();
                axisArgs.Text = xAxisValue;
                RenderAxisCell(writer, axisArgs);
            }
            RenderRowEnd(writer);

            // render data cell names
            RenderRowBegin(writer);
            for (int xAxisItemIndex = 0; xAxisItemIndex < xAxisItemsCount; xAxisItemIndex++)
            {
                RenderDataHeaderCell(writer, _factValueField);
            }
            RenderRowEnd(writer);
        }
Пример #4
0
 protected virtual void RenderAxisCell(HtmlTextWriter writer, PivotGridAxisCellEventArgs args)
 {
 }