zoukankan      html  css  js  c++  java
  • Active Report 3 生成图表

      1DataSet ds = new DataSet();
      2ds.ReadXml( "c:\\budgetTable.xml" );
      3
      4code from Zhen
    132
    133PicPage pp = new PicPage();
    134
    135ChartControl chartControl = (ChartControl)pp.Sections["detail"].Controls["ccPerlazienda"];
    136SeriesCollection objSeries = chartControl.Series;
    137objSeries.Clear();
    138
    139DataDynamics.ActiveReports.Chart.Axis axis1 = new DataDynamics.ActiveReports.Chart.Axis();
    140
    141DataDynamics.ActiveReports.Chart.Axis axis3 = new DataDynamics.ActiveReports.Chart.Axis();
    142
    143
    144axis1.AxisType = DataDynamics.ActiveReports.Chart.AxisType.Categorical;
    145axis1.LabelFont = new DataDynamics.ActiveReports.Chart.FontInfo(System.Drawing.Color.Black, new System.Drawing.Font("Microsoft Sans Serif", 8F));
    146axis1.MajorTick = new DataDynamics.ActiveReports.Chart.Tick(new DataDynamics.ActiveReports.Chart.Graphics.Line(), new DataDynamics.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Black, DataDynamics.ActiveReports.Chart.Graphics.LineStyle.Dot), 1, 5F, true);
    147axis1.MinorTick = new DataDynamics.ActiveReports.Chart.Tick(new DataDynamics.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Transparent, 0, DataDynamics.ActiveReports.Chart.Graphics.LineStyle.None), new DataDynamics.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Transparent, 0, DataDynamics.ActiveReports.Chart.Graphics.LineStyle.None), 0, 0F, false);
    148axis1.TitleFont = new DataDynamics.ActiveReports.Chart.FontInfo(System.Drawing.Color.Black, new System.Drawing.Font("Microsoft Sans Serif", 8F));
    149
    150axis3.LabelFont = new DataDynamics.ActiveReports.Chart.FontInfo(System.Drawing.Color.Black, new System.Drawing.Font("Microsoft Sans Serif", 8F));
    151axis3.MajorTick = new DataDynamics.ActiveReports.Chart.Tick(new DataDynamics.ActiveReports.Chart.Graphics.Line(), new DataDynamics.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Black, DataDynamics.ActiveReports.Chart.Graphics.LineStyle.Dot), 1, 5F, true);
    152axis3.MinorTick = new DataDynamics.ActiveReports.Chart.Tick(new DataDynamics.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Transparent, 0, DataDynamics.ActiveReports.Chart.Graphics.LineStyle.None), new DataDynamics.ActiveReports.Chart.Graphics.Line(System.Drawing.Color.Transparent, 0, DataDynamics.ActiveReports.Chart.Graphics.LineStyle.None), 0, 0F, false);
    153axis3.Position = 0;
    154axis3.TitleFont = new DataDynamics.ActiveReports.Chart.FontInfo(System.Drawing.Color.Black, new System.Drawing.Font("Microsoft Sans Serif", 8F), -90F);
    155
    156DataRow[] line1 = arrayint[0];
    157DataRow[] line2 = arrayint[1];
    158
    159Hashtable ht = new Hashtable();
    160forint i = 0; i < line1.Length - 1; i++ )
    161{
    162    DataRow dr = line1[i];
    163    if!ht.ContainsKey( dr[1].ToString() ) )
    164    {
    165        Series ser = new Series();
    166        ser.Name = dr[1].ToString();
    167
    168        ser.AxisX = axis1;
    169        ser.AxisY = axis3;
    170        ser.Type = DataDynamics.ActiveReports.Chart.ChartType.StackedBar3D;
    171        ser.Properties = new CustomProperties(new KeyValuePair[] {new DataDynamics.ActiveReports.Chart.KeyValuePair("BarType", DataDynamics.ActiveReports.Chart.BarType.Bar)});
    172        chartControl.Series.Add(ser);
    173
    174        ht.Add( dr[1].ToString(), ser );
    175    }

    176}

    177
    178forint i = 0; i < line2.Length - 1; i++ )
    179{
    180    DataRow dr = line2[i];
    181    if!ht.ContainsKey( dr[1].ToString() ) )
    182    {
    183        Series ser = new Series();
    184        ser.Name = dr[1].ToString();
    185
    186        ser.AxisX = axis1;
    187        ser.AxisY = axis3;
    188        ser.Type = DataDynamics.ActiveReports.Chart.ChartType.StackedBar3D;
    189        ser.Properties = new CustomProperties(new KeyValuePair[] {new DataDynamics.ActiveReports.Chart.KeyValuePair("BarType", DataDynamics.ActiveReports.Chart.BarType.Bar)});
    190        chartControl.Series.Add(ser);
    191
    192        ht.Add( dr[1].ToString(), ser );
    193    }

    194}

    195
    196forint i = 0; i < line1.Length - 1; i++ )
    197{
    198    DataRow dr = line1[i];
    199    Series ser = (Series)ht[dr[1]];
    200    DataPoint objDataPoint1 = new DataPoint(); //Declare a new DataPoint
    201    objDataPoint1.XValue = dr[0];
    202    objDataPoint1.YValues = new DoubleArray(dr[4].ToString());
    203
    204    DataPoint objDataPoint2 = new DataPoint( line2[0][0], new DoubleArray("0"), false);
    205    forint j = 0; j < line2.Length - 1; j++ )
    206    {
    207        DataRow dr2 = line2[j];
    208        if( dr2[1].ToString() == ser.Name )
    209        {
    210            objDataPoint2.XValue = dr2[0];
    211            objDataPoint2.YValues = new DoubleArray(dr2[4].ToString());
    212            break;
    213        }

    214    }

    215
    216    if( ser.Points.Count == 0 )
    217        ser.Points.AddRange( new DataPoint[]{ objDataPoint1,objDataPoint2 } );
    218    else
    219    {
    220        string s ="";
    221    }

    222    
    223}

    224
    225forint i = 0; i < line2.Length - 1; i++ )
    226{
    227    DataRow dr = line2[i];
    228
    229    Series ser = (Series)ht[dr[1]];
    230    DataPoint objDataPoint1 = new DataPoint(); //Declare a new DataPoint
    231    objDataPoint1.XValue = dr[0];
    232    objDataPoint1.YValues = new DoubleArray( dr[4].ToString() );
    233
    234    DataPoint objDataPoint2 = new DataPoint( line1[0][0], new DoubleArray("0"), false);
    235
    236    if( ser.Points.Count == 0 )
    237        ser.Points.AddRange( new DataPoint[]{ objDataPoint2, objDataPoint1} );
    238    else
    239    {
    240        ser.Points.RemoveAt( 1 );
    241        ser.Points.Add( objDataPoint1 );
    242    }

    243}

    244
    245
    246
    247pp.Run();
    248
    249DataDynamics.ActiveReports.Export.Html.HtmlExport htmlExporter = new DataDynamics.ActiveReports.Export.Html.HtmlExport();
    250htmlExporter.Export( pp.Document, "c:\\aaa.html");
    251
    252pp.Stop();
    253



      1<?xml version="1.0" standalone="yes"?>
      2<NewDataSet>
      3  <budgetTable>
      4    <bdgKeyCode>INDAZI</bdgKeyCode>
      5    <bdgLabel>TOT. IMPORTO BASE</bdgLabel>
      6    <bdgUnit>euro</bdgUnit>
      7    <bdgAmount>252,00</bdgAmount>
      8    <bdgAmountfloat>252</bdgAmountfloat>
      9    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     10    <bdgflagRawType>D</bdgflagRawType>
     11  </budgetTable>
     12  <budgetTable>
     13    <bdgKeyCode>INDAZI</bdgKeyCode>
     14    <bdgLabel>+ ratei 13a,14a,ferie TFR</bdgLabel>
     15    <bdgUnit>euro</bdgUnit>
     16    <bdgAmount>85,68</bdgAmount>
     17    <bdgAmountfloat>85.68</bdgAmountfloat>
     18    <bdgPercentage>34%</bdgPercentage>
     19    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     20    <bdgflagRawType>D</bdgflagRawType>
     21  </budgetTable>
     22  <budgetTable>
     23    <bdgKeyCode>INDAZI</bdgKeyCode>
     24    <bdgLabel>+ oneri previdanziali</bdgLabel>
     25    <bdgUnit>euro</bdgUnit>
     26    <bdgAmount>111,43</bdgAmount>
     27    <bdgAmountfloat>111.43</bdgAmountfloat>
     28    <bdgPercentage>33%</bdgPercentage>
     29    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     30    <bdgflagRawType>D</bdgflagRawType>
     31  </budgetTable>
     32  <budgetTable>
     33    <bdgKeyCode>INDAZI</bdgKeyCode>
     34    <bdgLabel>+ IRAP</bdgLabel>
     35    <bdgUnit>euro</bdgUnit>
     36    <bdgAmount>17,52</bdgAmount>
     37    <bdgAmountfloat>17.52</bdgAmountfloat>
     38    <bdgPercentage>3,9%</bdgPercentage>
     39    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     40    <bdgflagRawType>D</bdgflagRawType>
     41  </budgetTable>
     42  <budgetTable>
     43    <bdgKeyCode>INDAZI</bdgKeyCode>
     44    <bdgLabel>+ IRES su IRAP</bdgLabel>
     45    <bdgUnit>euro</bdgUnit>
     46    <bdgAmount>4,82</bdgAmount>
     47    <bdgAmountfloat>4.82</bdgAmountfloat>
     48    <bdgPercentage>27,5%</bdgPercentage>
     49    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     50    <bdgflagRawType>D</bdgflagRawType>
     51  </budgetTable>
     52  <budgetTable>
     53    <bdgKeyCode>INDAZI</bdgKeyCode>
     54    <bdgLabel>SPENDO</bdgLabel>
     55    <bdgUnit>euro</bdgUnit>
     56    <bdgAmount>471,45</bdgAmount>
     57    <bdgAmountfloat>471.45</bdgAmountfloat>
     58    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     59    <bdgflagRawType>T</bdgflagRawType>
     60  </budgetTable>
     61  <budgetTable>
     62    <bdgKeyCode>INDDIP</bdgKeyCode>
     63    <bdgLabel>IMPORTO BASE</bdgLabel>
     64    <bdgUnit>euro</bdgUnit>
     65    <bdgAmount>12,00</bdgAmount>
     66    <bdgAmountfloat>12</bdgAmountfloat>
     67    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     68    <bdgflagRawType>D</bdgflagRawType>
     69  </budgetTable>
     70  <budgetTable>
     71    <bdgKeyCode>INDDIP</bdgKeyCode>
     72    <bdgLabel>- oneri previdenziali</bdgLabel>
     73    <bdgUnit>euro</bdgUnit>
     74    <bdgAmount>-1,10</bdgAmount>
     75    <bdgAmountfloat>-1.1</bdgAmountfloat>
     76    <bdgPercentage>9,19%</bdgPercentage>
     77    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     78    <bdgflagRawType>D</bdgflagRawType>
     79  </budgetTable>
     80  <budgetTable>
     81    <bdgKeyCode>INDDIP</bdgKeyCode>
     82    <bdgLabel>- IRPEF</bdgLabel>
     83    <bdgUnit>euro</bdgUnit>
     84    <bdgAmount>-3,54</bdgAmount>
     85    <bdgAmountfloat>-3.54</bdgAmountfloat>
     86    <bdgPercentage>27%</bdgPercentage>
     87    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     88    <bdgflagRawType>D</bdgflagRawType>
     89  </budgetTable>
     90  <budgetTable>
     91    <bdgKeyCode>INDDIP</bdgKeyCode>
     92    <bdgLabel>PER EROGARE</bdgLabel>
     93    <bdgUnit>euro</bdgUnit>
     94    <bdgAmount>7,36</bdgAmount>
     95    <bdgAmountfloat>7.36</bdgAmountfloat>
     96    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
     97    <bdgflagRawType>T</bdgflagRawType>
     98  </budgetTable>
     99  <budgetTable>
    100    <bdgKeyCode>TRAZI</bdgKeyCode>
    101    <bdgLabel>TOT. VAL. TICKET</bdgLabel>
    102    <bdgUnit>euro</bdgUnit>
    103    <bdgAmount>252,00</bdgAmount>
    104    <bdgAmountfloat>252</bdgAmountfloat>
    105    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    106    <bdgflagRawType>D</bdgflagRawType>
    107  </budgetTable>
    108  <budgetTable>
    109    <bdgKeyCode>TRAZI</bdgKeyCode>
    110    <bdgLabel>+ IVA 4%</bdgLabel>
    111    <bdgUnit>euro</bdgUnit>
    112    <bdgAmount>10,08</bdgAmount>
    113    <bdgAmountfloat>10.08</bdgAmountfloat>
    114    <bdgPercentage>4%</bdgPercentage>
    115    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    116    <bdgflagRawType>D</bdgflagRawType>
    117  </budgetTable>
    118  <budgetTable>
    119    <bdgKeyCode>TRAZI</bdgKeyCode>
    120    <bdgLabel>+ oneri previdenziali</bdgLabel>
    121    <bdgUnit>euro</bdgUnit>
    122    <bdgAmount>46,50</bdgAmount>
    123    <bdgAmountfloat>46.5</bdgAmountfloat>
    124    <bdgPercentage>33%</bdgPercentage>
    125    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    126    <bdgflagRawType>D</bdgflagRawType>
    127  </budgetTable>
    128  <budgetTable>
    129    <bdgKeyCode>TRAZI</bdgKeyCode>
    130    <bdgLabel>+ IRAP</bdgLabel>
    131    <bdgUnit>euro</bdgUnit>
    132    <bdgAmount>12,03</bdgAmount>
    133    <bdgAmountfloat>12.03</bdgAmountfloat>
    134    <bdgPercentage>3,9%</bdgPercentage>
    135    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    136    <bdgflagRawType>D</bdgflagRawType>
    137  </budgetTable>
    138  <budgetTable>
    139    <bdgKeyCode>TRAZI</bdgKeyCode>
    140    <bdgLabel>+ IRES su IRAP</bdgLabel>
    141    <bdgUnit>euro</bdgUnit>
    142    <bdgAmount>3,31</bdgAmount>
    143    <bdgAmountfloat>3.31</bdgAmountfloat>
    144    <bdgPercentage>27,5%</bdgPercentage>
    145    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    146    <bdgflagRawType>D</bdgflagRawType>
    147  </budgetTable>
    148  <budgetTable>
    149    <bdgKeyCode>TRAZI</bdgKeyCode>
    150    <bdgLabel>SPENDO</bdgLabel>
    151    <bdgUnit>euro</bdgUnit>
    152    <bdgAmount>323,92</bdgAmount>
    153    <bdgAmountfloat>323.92</bdgAmountfloat>
    154    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    155    <bdgflagRawType>T</bdgflagRawType>
    156  </budgetTable>
    157  <budgetTable>
    158    <bdgKeyCode>TRDIP</bdgKeyCode>
    159    <bdgLabel>VALORE TICKET</bdgLabel>
    160    <bdgUnit>euro</bdgUnit>
    161    <bdgAmount>12,00</bdgAmount>
    162    <bdgAmountfloat>12</bdgAmountfloat>
    163    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    164    <bdgflagRawType>D</bdgflagRawType>
    165  </budgetTable>
    166  <budgetTable>
    167    <bdgKeyCode>TRDIP</bdgKeyCode>
    168    <bdgLabel>- oneri previdenziali</bdgLabel>
    169    <bdgUnit>euro</bdgUnit>
    170    <bdgAmount>0,62</bdgAmount>
    171    <bdgAmountfloat>0.62</bdgAmountfloat>
    172    <bdgPercentage>9,19%</bdgPercentage>
    173    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    174    <bdgflagRawType>D</bdgflagRawType>
    175  </budgetTable>
    176  <budgetTable>
    177    <bdgKeyCode>TRDIP</bdgKeyCode>
    178    <bdgLabel>- IRPEF</bdgLabel>
    179    <bdgUnit>euro</bdgUnit>
    180    <bdgAmount>1,98</bdgAmount>
    181    <bdgAmountfloat>1.98</bdgAmountfloat>
    182    <bdgPercentage>27%</bdgPercentage>
    183    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    184    <bdgflagRawType>D</bdgflagRawType>
    185  </budgetTable>
    186  <budgetTable>
    187    <bdgKeyCode>TRDIP</bdgKeyCode>
    188    <bdgLabel>PER EROGARE</bdgLabel>
    189    <bdgUnit>euro</bdgUnit>
    190    <bdgAmount>9,40</bdgAmount>
    191    <bdgAmountfloat>9.4</bdgAmountfloat>
    192    <bdgflagToBeDisplayed>true</bdgflagToBeDisplayed>
    193    <bdgflagRawType>T</bdgflagRawType>
    194  </budgetTable>
    195</NewDataSet>

  • 相关阅读:
    java之大文件断点续传
    Html5大文件断点续传
    前端js怎么实现大文件G级的断点续传(分块上传)和分段下载
    HTML5解决大文件断点续传
    完整版断点续传、秒传,支持超大大大文件_支持重定义文件名和路径
    起来吧!不要做奴隶的ITproject师们!
    Oracle PL/SQL 编程基础 实例
    C语言高速入门系列(八)
    POJ 3253-Fence Repair(堆)
    抽屉式导航可能减少产品一半的用户參与度
  • 原文地址:https://www.cnblogs.com/jinweijie/p/1145364.html
Copyright © 2011-2022 走看看