求一个简单的java做报表的示例,要求步骤和流程清晰,急用,谢谢!

解决方案 »

  1.   

    参考:http://poi.apache.org/spreadsheet/examples.html
    上面里面有源代码
      

  2.   

    还不是直接写SQL由JAVA程序来调用
      

  3.   

    报表主要都是在数据库写存储过程,返回java调用。
    还可以用java返回给Flex调用,展现更好些,封装了很多图形报表。
      

  4.   

    用birt吧,用birt开发报表很方便的。
      

  5.   

    做报表,最简单,功能最全的就是JFreechart.有各种报表供选择。
    下面我给出比较简单的饼图报表的实现代码:/**
     * 
     */
    package test.struts2.JFreeChart;import java.awt.Font;import org.jfree.chart.ChartFactory;
    import org.jfree.chart.ChartFrame;
    import org.jfree.chart.JFreeChart;
    import org.jfree.chart.plot.PiePlot;
    import org.jfree.chart.title.LegendTitle;
    import org.jfree.chart.title.TextTitle;
    import org.jfree.data.general.DefaultPieDataset;/**
     * @author paipaitjz
     * @description 
     */
    public class JFreeChartTest {

    public static void main(String[] args){
    DefaultPieDataset dpd = new DefaultPieDataset();

    dpd.setValue("管理部人员", 25);
    dpd.setValue("组织部人员", 30);
    dpd.setValue("市场部人员", 15);
    dpd.setValue("开发部人员", 40);

    JFreeChart chart = ChartFactory.createPieChart("某公司内部人员结构图", dpd, true, true, false);
    //标题
    chart.setTitle(new TextTitle("某公司内部人员结构图",new Font("仿宋_gb2312",Font.BOLD,20)));

    //饼上面的文字
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setLabelFont(new Font("宋体",Font.PLAIN,12));

    //图例
    LegendTitle legendtitle = chart.getLegend(0);
    legendtitle.setItemFont(new Font("宋体",Font.ITALIC,20));

    ChartFrame chartFrame = new ChartFrame("某公司内部人员",chart);

    chartFrame.pack();

    chartFrame.setVisible(true);
    }}
    当然要下下载JFreechart的相关包,主要有两个:jfreechart-1.0.13.jar,jcommon-1.0.16.jar
    下载地址:
    http://downloads.sourceforge.net/project/jfreechart/1.%20JFreeChart/1.0.13/jfreechart-1.0.13.ziphttp://downloads.sourceforge.net/project/jfreechart/3.%20JCommon/1.0.16/jcommon-1.0.16.zip
      

  6.   

    iReport,JFreeChart做统计报表的,有空楼主看看吧~
      

  7.   

    http://www.blogjava.net/fannie/ 这个里面讲的很详细 都是Java报表相关的技术文章及详细步骤
      

  8.   

    此群是一个 java Flex 技术群,如有想在知识方面想共同进步的请加入,长期不发言者 将会被清楚群号:90551956希望大家都能带着知识和问题进来