欢迎来到天天文库
浏览记录
ID:38679640
大小:29.64 KB
页数:34页
时间:2019-06-17
《润乾API操作实例》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、packagenbpt.ts.report.test.helper;importjava.io.File;importjava.io.FileNotFoundException;importjava.io.FileReader;importjava.io.FileWriter;importjava.io.IOException;importjava.util.ArrayList;importjava.util.List;importcom.runqian.report4.model.ReportDefine;impor
2、tcom.runqian.report4.usermodel.DataSetConfig;importcom.runqian.report4.usermodel.DataSetMetaData;importcom.runqian.report4.usermodel.IByteMap;importcom.runqian.report4.usermodel.IColCell;importcom.runqian.report4.usermodel.INormalCell;importcom.runqian.report4.u
3、sermodel.IReport;importcom.runqian.report4.usermodel.IRowCell;importcom.runqian.report4.usermodel.MacroMetaData;importcom.runqian.report4.usermodel.Param;importcom.runqian.report4.usermodel.ParamMetaData;importcom.runqian.report4.usermodel.ProcDataSetConfig;impo
4、rtcom.runqian.report4.usermodel.SQLDataSetConfig;importcom.runqian.report4.usermodel.Types;importcom.runqian.report4.util.ReportUtils;publicclassRunQianHelper{privateStringraqFilesPath="WebContent/report/zh/";ListreportRaqFileNames=newArrayList()
5、;publicRunQianHelper(){//Filedir=newFile(raqFilesPath);//loadFiles(dir);}publicListloadFilesa(Filedir){File[]files=dir.listFiles();for(inti=0;i6、(files[i].getAbsolutePath());}}else{loadFiles(files[i]);}}returnreportRaqFileNames;}/***统一把行高设置成8*/@SuppressWarnings("unused")publicvoidsetRowHeight(ListarrList){intflag=0;intindex=0;for(Stringitem:arrList){StringfileName=item;if(!fileName.contains("erro7、r")){continue;}try{ReportDefinerd=(ReportDefine)ReportUtils.read(fileName);intcolCount=rd.getColCount();introwCount=rd.getRowCount();for(inti=1;i<=3;i++){IRowCelliRowCell=rd.getRowCell(i);iRowCell.setRowHeight(8);for(intj=1;j<=colCount;j++){INormalCellcell=rd.ge8、tCell(i,(short)j);cell.setFontSize((short)12);}}ReportUtils.write(fileName,rd);}catch(Exceptione){System.out.println(fileName+"-"+e.toString());}System.out.println(fi
6、(files[i].getAbsolutePath());}}else{loadFiles(files[i]);}}returnreportRaqFileNames;}/***统一把行高设置成8*/@SuppressWarnings("unused")publicvoidsetRowHeight(ListarrList){intflag=0;intindex=0;for(Stringitem:arrList){StringfileName=item;if(!fileName.contains("erro
7、r")){continue;}try{ReportDefinerd=(ReportDefine)ReportUtils.read(fileName);intcolCount=rd.getColCount();introwCount=rd.getRowCount();for(inti=1;i<=3;i++){IRowCelliRowCell=rd.getRowCell(i);iRowCell.setRowHeight(8);for(intj=1;j<=colCount;j++){INormalCellcell=rd.ge
8、tCell(i,(short)j);cell.setFontSize((short)12);}}ReportUtils.write(fileName,rd);}catch(Exceptione){System.out.println(fileName+"-"+e.toString());}System.out.println(fi
此文档下载收益归作者所有