<%@ page contentType="application/pdf;charset=gb2312" %>
<%@ page import="net.sf.jasperreports.engine.*" %>
<%@ page import="com.rsc.mainframe.util.ConfigContainer" %>
<%@ page import="com.rsc.rs.pub.dbUtil.SelRs" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%
File reportFile = new File(application.getRealPath("/com/rsc/rs/inv/zz_inv5200/zz_inv5200.jasper"));
System.out.println(reportFile.getPath());
if (!reportFile.exists())
throw new JRRuntimeException("File WebappReport.jasper not found. The report design must be compiled first.");
String queryCondition = (String)request.getParameter("myCriSQL");
String sSql = "select t1.item_code,t5.item_name,t1.order_no,t1.lot_no,sum(t1.on_hand_qty) as on_hand_qty ,t1.unit_name,sum(t1.inspection_qty) as inspection_qty,t1.print_flag from inv_book_master_detail t1,inv_master t5 where "+queryCondition+" and t1.item_code=t5.item_code and t1.company_code=t5.company_code and print_flag='Y' and exists(select 1 from inv_book_master_detail t2 where t2.on_hand_qty>0 and t2.company_code =t1.company_code and t2.item_code =t1.item_code and t2.order_no =t1.order_no and t2.lot_no =t1.lot_no ) group by t1.item_code,t5.item_name,t1.order_no,t1.lot_no,t1.print_flag,t1.unit_name order by t1.item_code,t5.item_name,t1.order_no,t1.lot_no";
System.out.println("&&&&&&&&&&&"+sSql);
System.out.println();
Map parameters = new HashMap();
parameters.put("sSql",sSql);
SelRs prtRs = new SelRs("");
ResultSet rs = null;
rs = prtRs.getRs(sSql);
JRResultSetDataSource jrsds = new JRResultSetDataSource(rs);
System.out.println("------------Jasper Begin----------------");
byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath(),parameters,jrsds);
System.out.println("------------Jasper end----------------");
response.setContentType("application/pdf");
System.out.println("------------2---------------");
response.setContentLength(bytes.length);
System.out.println("------------J3---------------");
// if(ServletOutputStream == null)
ServletOutputStream ouputStream = response.getOutputStream();
System.out.println("------------33----------------");
ouputStream.write(bytes, 0, bytes.length);
System.out.println("------------4---------------");
ouputStream.flush();
System.out.println("------------J5----------------");
ouputStream.close();
System.out.println("------------J6----------------");
jrsds = null;
prtRs = null;
rs = null;
%>
java ireport jar包部署,引用,与ireport文件调用
需积分: 5 31 浏览量
2023-06-19
17:33:17
上传
评论
收藏 4.18MB RAR 举报
吴杨威
- 粉丝: 0
- 资源: 2
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈