社区
Java
帖子详情
在JBuilder中怎么使用水晶报表(Crystal Reports)?
wqaihw
2007-01-12 11:59:03
我刚刚接触JBuilder,想用水晶报表做一个报表,不知道怎么做???请教大家????
...全文
726
7
打赏
收藏
在JBuilder中怎么使用水晶报表(Crystal Reports)?
我刚刚接触JBuilder,想用水晶报表做一个报表,不知道怎么做???请教大家????
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
yuly888
2007-09-30
打赏
举报
回复
不知道LZ有没有实现了呢?
nickzou2013
2007-06-21
打赏
举报
回复
我怎么沒有看見使用方法的介紹呢?
JAVANND
2007-05-31
打赏
举报
回复
closeAll();
}catch(SQLException e){
}
}
public void ReportDet2(String st){
try{
getStmt();
String sql22="select * from report_table2 where no1='"+st+"' order by id";
rs=stmt.executeQuery(sql22);
saleSubLedger1=new String[ku1][14];
for(int k=0;k<ku1;k++){
for(int h=0;h<14;h++){
saleSubLedger1[k][h] = "";
}
}
int i1=0;
String strku="";
while(rs.next()){
saleSubLedger1[i1][0]="" + rs.getString("no1");
saleSubLedger1[i1][1]="" + rs.getString("itemno");
saleSubLedger1[i1][2]="" + rs.getString("itemname");
saleSubLedger1[i1][3]="" + rs.getString("yn");
saleSubLedger1[i1][4]= "" +rs.getString("itemmem");
saleSubLedger1[i1][5]="" +rs.getString("packnum");
saleSubLedger1[i1][6]=""+rs.getDouble("gross");
saleSubLedger1[i1][7]=""+rs.getDouble("tare");
saleSubLedger1[i1][8]=""+rs.getDouble("num");
saleSubLedger1[i1][9]=""+rs.getString("huowei");
saleSubLedger1[i1][10]=""+rs.getString("mem");
saleSubLedger1[i1][11]=""+rs.getDouble("price");
saleSubLedger1[i1][12]=""+rs.getDouble("price1");
strku=rs.getString("cgno");
saleSubLedger1[i1][13]=strku;
i1+=1;
}
saleLedger10=strku;
closeAll();
}catch(SQLException e){
}
}
public void ReportSum2(String st){
try{
getStmt();
String sqlt1="select sum(gross) as a11,sum(tare) as a12,sum(num) as a13,sum(price1) as a14 from report_table2 where no1='"+st+"'";
rs=stmt.executeQuery(sqlt1);
if(rs.next()){
su3=rs.getDouble("a13");
su4=rs.getDouble("a14");
}
su1=Math.round(su1*10000);
su1=su1/10000;
su2=Math.round(su2*10000);
su2=su2/10000;
su3=Math.round(su3*10000);
su3=su3/10000;
su2=su1-su3;
su2=Math.round(su2*10000);
su2=su2/10000;
su4=Math.round(su4*100);
su4=su4/100;
closeAll();
}catch(SQLException e){
}
}
public void Reportfield3(String st){
try{
getStmt();
String sql212="select * from report_table3 where no1='"+st+"' order by id";
rs=stmt.executeQuery(sql212);
ku2=0;
while(rs.next()){
ku2+=1;
}
closeAll();
saleSubLedger2=new String[ku2][8];
}catch(SQLException e){
}
}
public void ReportDet3(String st){
try{
getStmt();
String sql222="select * from report_table3 where no1='"+st+"' order by id";
rs=stmt.executeQuery(sql222);
int i2=0;
while(rs.next()){
saleSubLedger2[i2][0]=""+rs.getString("no1");
saleSubLedger2[i2][1]=""+rs.getString("type1");
saleSubLedger2[i2][2]=""+rs.getDouble("num");
saleSubLedger2[i2][3]=""+rs.getString("pcs1");
saleSubLedger2[i2][4]=""+rs.getDouble("pcsnum");
saleSubLedger2[i2][5]=""+rs.getString("pcs2");
saleSubLedger2[i2][6]=""+rs.getDouble("total");
saleSubLedger2[i2][7]=""+rs.getString("mem");
i2+=1;
}
closeAll();
}catch(SQLException e){
}
}
public void ReportSum3(String st){
try{
getStmt();
String sqlt1="select sum(total) as a1 from report_table3 where no1='"+st+"'";
rs=stmt.executeQuery(sqlt1);
if(rs.next()){
sut3=rs.getDouble("a1");
}
sut3=Math.round(sut3*10000);
sut3=sut3/10000;
closeAll();
}catch(SQLException e){
}
}
/** 打印页面的方法 */
public void drawPages(Graphics2D g2){
if(isFirstPage){
drawFirstPage(g2);
}else{
drawOtherPages(g2,printPage);
}
}
/** 打印第1页的方法 */
public String checkChart(String str) {//转化汉字字体为普通字体
try{
trn = str;
byte bytes[];
bytes = trn.getBytes("ISO8859_1");
trn = new String(bytes, "GBK");
}catch(Exception e){
}
return trn;
}
public void drawFirstPage(Graphics2D g2){
//设置字体
g2.setFont(font16);
//显示销售单
barcode.setSize(barcode.WIDTH,barcode.HEIGHT);
barcode.qWe = BarCode1.q7E8; //code 39--->q1W2 q7E8--code 128 e3R4-->code 39EXT l9Z0---->CODE 93
g2.drawString("工 厂 收 货 报 告", 200,40); //x=173 ;y=80;
g2.setFont(font11);
g2.drawString("第 1 页 共 "+pageCount+" 页", 450, 20);
g2.drawString("收货日期:"+saleLedger1+" 来源:"+saleLedger12+" 封条号:"+saleLedger3,40,65);
g2.drawString("落地号:",360,65); //后面打印出落地号条码
// barcode.setW2e("C");
barcode.setRFv(0.5D);
barcode.setRTy(false);
barcode.wEr=saleLedger0; //落地号
// JOptionPane.showMessageDialog(null,"itemno1="+saleSubLedger[i][0]);
barcode.paint(g2.create(430,45,180,45));
// JOptionPane.showMessageDialog(null,"saleLedger10="+saleLedger10 +" saleLedger2="+saleLedger2);
if(saleLedger2.trim().length()>0){
g2.drawString("INV柜号: " + saleLedger2+" "+saleLedger11, 40, 90);
}else{
g2.drawString("货柜号: "+saleLedger10+" "+saleLedger11 , 40, 90);
}
JAVANND
2007-05-31
打赏
举报
回复
厂收货报告头高度为80
sumHeight+=((ku+3)+3+(ku2+2))*tableLineHeight+(tableLineHeight+25)*ku1+1*20+60;
sumtotal=((ku+3)+(ku2+2)+2)*tableLineHeight+21+60+20; //除了实际收货显示的高度
int tttn=(tableLineHeight+25)*ku1; //实际收货总高度
int kkn=(int)(700-sumtotal)/(tableLineHeight+25);
kkk=kkn;
pageCount+=1;
int kuu=(int)(ku1-kkn)/14;
if(ku1-kkn-kuu*14>0){
pageCount+=kuu+1;
}else{
pageCount+=kuu;
}
if(pageCount>1){
sumtotal+=3*tableLineHeight; //实际收货的字样头及合计
if(sumtotal<720){
tt2=1; //表示实际收货的字样及头与合计可以在第一页中显示
for(int i=1;i<=ku1;i++){
sumtotal+=tableLineHeight+25;
if(sumtotal>720){
tt1=i;//第一页显示实际收货的总记录数
break;
}
}
}else{
tt2=2; //表示在第二页中显示
tt1=ku1;
}
}else{
tt1=ku1;
tt2=1;
}
}
protected void getStmt()throws SQLException{//数据库的连接
if(con== null)
con = ConnectionPool.getConnection();
if(stmt == null)
stmt = con.createStatement();
}
protected void closeAll()throws SQLException{//关闭所有与数据库的连接
if(rs != null){
rs.close();
rs = null;
}
if(stmt != null){
stmt.close();
stmt = null;
}
if(pstmt != null){
pstmt.close();
pstmt = null;
}
if(!this.isTransaction && con != null)
ConnectionPool.returnConnection(con);
}
public void Reportfield(String st){
try{
String sql="select * from reporthead where no1='"+st+"'";
rs=stmt.executeQuery(sql);
if(rs.next()){
su1=rs.getDouble("cgross");
saleLedger10=""+rs.getString("cn");
saleLedger11=rs.getString("mem");
saleLedger12=rs.getString("laiyuan");
saleLedger0=rs.getString("no1");
saleLedger1=rs.getString("date1");
saleLedger2=rs.getString("cn1");
saleLedger3=rs.getString("sn");
saleLedger4=rs.getString("changer");
saleLedger5=rs.getString("wt");
saleLedger6=rs.getString("itemerr");
saleLedger7=rs.getString("claim");
saleLedger8=rs.getString("date2");
saleLedger9=rs.getString("comid");
}
closeAll();
}catch(SQLException e){
}
}
public void Reportfield1(String st){
try{
String sql2="select * from report_table1 where no1='"+st+"' order by id";
getStmt();
rs=stmt.executeQuery(sql2);
ku=0;
while(rs.next()){
ku+=1;
}
closeAll();
}catch(SQLException e){
}
}
public void ReportDet1(String st){
try{
getStmt();
2007-5-18日注释,加入下一行
String sql1="select report_table1.*,ReportInput_table.name1 from report_table1,reporthead,ReportInput_table where report_table1.no1='"+st+"' and report_table1.no1=reporthead.no1 and reporthead.cno=ReportInput_table.comid and report_table1.itemname=ReportInput_table.name2 order by report_table1.id";
rs=stmt.executeQuery(sql1);
int i=0;
double ttyn=0;
saleSubLedger=new String[ku][9]; //2007-5-18 将8改为9 主要是用来加入来单英文名称
while(rs.next()){
saleSubLedger[i][0]=""+rs.getString("no1");
saleSubLedger[i][1]=""+rs.getString("itemname");
saleSubLedger[i][8]=""+rs.getString("name1");
saleSubLedger[i][2]=""+rs.getString("packnum");
saleSubLedger[i][3]=""+rs.getDouble("gross");
saleSubLedger[i][4]=""+rs.getDouble("tare");
ttyn=rs.getDouble("num");
ttyn=Math.round(ttyn*10000);
ttyn=ttyn/10000;
saleSubLedger[i][5]=""+ttyn;
saleSubLedger[i][6]=""+rs.getDouble("price");
saleSubLedger[i][7]=""+rs.getDouble("total");
i+=1;
}
closeAll();
}catch(SQLException e){
}
}
public void ReportSum1(String st){
try{
getStmt();
String sqlt1="select sum(num) as b1,sum(total) as a1 from report_table1 where no1='"+st+"'";
rs=stmt.executeQuery(sqlt1);
if(rs.next()){
sut1=rs.getDouble("b1");
sut2=rs.getDouble("a1");
}
sut1=Math.round(sut1*10000);
sut1=sut1/10000;
sut2=Math.round(sut2*100);
sut2=sut2/100;
closeAll();
}catch(SQLException e){
}
}
public void Reportfield2(String st){
try{
getStmt();
String sql21="select * from report_table2 where no1='"+st+"' order by id";
rs=stmt.executeQuery(sql21);
ku1=0;
while(rs.next()){
ku1+=1;
}
JAVANND
2007-05-31
打赏
举报
回复
报表工具要自己去通过代码建立 先用代码比较方便
eg:package base;
import javax.swing.*;
import java.awt.*;
import java.awt.print.*;
import java.util.*;
import java.sql.*;
import ConnectionPool.*;
/**
* <p>Title: 应用程式</p> 收货报告整体内容 pane
* <p>Description: 应用程式开发</p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class ReportPrintPane extends JPanel {
protected JDCConnection con=null;
protected ResultSet rs = null;
protected Statement stmt = null;
protected PreparedStatement pstmt = null;
private boolean isTransaction = false;
String trn="";
final static Color fg = Color.black;
BarCode1 barcode=new BarCode1();
//创建字体
Font font16 = new Font("宋体", Font.BOLD, 16);
Font font11 = new Font("宋体", Font.PLAIN, 11);
String str1="";
String str2="";
String str3="";
Font font8=new Font("宋体",Font.PLAIN,8);
Font font81=new Font("宋体",Font.BOLD,8);
//是否第1页变量
static boolean isFirstPage = true;
//创建销售单数组
String[] saleLedger=new String[24];
//创建销售单明细账数组
int ku=0;
int ku1=0;
int ku2=0;
String[][] saleSubLedger ;
String[][] saleSubLedger1;
String[][] saleSubLedger2;
//创建页码变量
static int printPage = 0;
//页面左边的空白
int pageLeftMargin = 30;
//与左边的距离
int x = 0;
//与项部的距离
int y = 0;
//行宽
int lineHeight = 18;
//行间距
int lineDistant = 18;
//表格的行高
int tableLineHeight = 20;
//表格的总高度
int tableHeight = 0;
int tabHeight=6;
//定义纵坐标的总数,用来求出有多少页及页码的处理
int sumHeight=0; //除最上面显示的内容外的总高度
int pageCount=0; //总页数
int page1Height=0; //实际资料是否显示完了,如果没有则保存显示的记录数
int page2Height=0; //皮重说明显示是否完成,如果没有则保存显示具体的记录数
int page3Height=0;
boolean tf1=true; //实际收货中的合计是否显示
boolean tf2=true; //皮重说明是否显示
boolean tf3=true; //皮重编号是否显示
boolean tf4=true; //欠重是否显示
boolean tf5=true;//货不对板是否显示
boolean tf6=true; //报告示人
boolean t1=true;
boolean t2=true;
int tt1=0;
int tt2=0;
int tt3=0;
int tt4=0;
int tt5=0;
int tt6=0;
int page1=0;
String saleLedger0="";
String saleLedger1="";
String saleLedger2="";
String saleLedger3="";
String saleLedger4="";
String saleLedger5="";
String saleLedger6="";
String saleLedger7="";
String saleLedger8="";
String saleLedger9="";
String saleLedger10="";
String saleLedger11="";
String saleLedger12="";
//创建完成状态数组
String[] onProcesses = {"进行", "撤消", "完成"};
double sut1=0;
double sut2=0;
double sut3=0;
double sut4=0;
double su1=0;
double su2=0;
double su3=0;
double su4=0;
int sumtotal=0;
int kkk=0;
//重新绘画
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
//设置画笔颜色
g2.setPaint(fg);
drawPages(g2);
}
public ReportPrintPane() {
this.setBackground(Color.white);
}
public ReportPrintPane(String str){
// JOptionPane.showMessageDialog(null,"saleorderprintpane str="+ str );
if(str.equals("")){
JOptionPane.showMessageDialog(null,"str不能为空");
}else{
Reportfield(str);
Reportfield1(str);
Reportfield2(str);
Reportfield3(str);
ReportDet1(str);
ReportDet2(str);
ReportDet3(str);
ReportSum1(str);
ReportSum2(str);
ReportSum3(str);
pagesum(); //求出总页数
}
this.setBackground(Color.white);
}
public void pagesum(){
sumHeight=0;
dalilei
2007-01-20
打赏
举报
回复
关注,看到网上有for jb9的水晶报表。
但还不知道怎么用的。
我是从vb到vs.net都用的水晶报表。
lixiaoxue85
2007-01-12
打赏
举报
回复
不明白~~JBUILDER对这个报表有配置支持吗?~~还是用写代码的方式?
水晶报表
10 Java 支持概览及技术白皮书资源
本文介绍了
水晶报表
的Java支持,其有助于简化并加速访问、格式化和集成数据到JSP的过程。在BEA WebLogic Workshop和Borland J
Builder
中
作为紧密集成特性提供。还阐述了内嵌版
水晶报表
的关键特性,以及
水晶报表
10的升级特性,同时提供了JAVA社区和技术白皮书资源。
角色生成器-元技能系统的下级母技能,专门从任意角色概念生成完整角色Skill
角色生成器——元技能系统的下级母技能,专门从任意角色概念生成完整角色Skill。以角色=实体层×社会层×抽象层的三层12维正交模型(实体层:职业/身份/名人/拟人/躯体/文化;社会层:关系/层级;抽象层:功能/能力/动机/动态)系统填充,输出内嵌管线编排、三轴判定、领域校准、降级模式等可执行能力的角色Skill文件。触发词:生成角色、创建角色、角色生成、角色Skill、character
builder
、角色构建、角色设计、人物角色生成、meta-skill-system
【Python编程】Python字典与集合底层实现原理
内容概要:本文深入剖析Python字典(dict)与集合(set)的哈希表底层实现机制,重点讲解哈希冲突解决策略、负载因子动态调整、键的可哈希性要求等核心概念。文章从开放寻址法与分离链接法的对比入手,分析Python 3.6+版本字典的有序性保证原理,探讨集合的去重逻辑与数学运算实现。通过sys.getsizeof对比不同规模数据的内存占用,展示哈希表扩容与缩容的触发条件,同时介绍frozenset的不可变特性及其作为字典键的应用场景,最后给出在成员检测、数据去重、缓存实现等场景下的性能优化建议。 24直播网:www.yiyuan-ing.com 直播下载:www.xjamall.com 24直播网:www.yk666.cn 直播下载:www.yjkq.net 直播下载:www.zgystz.com
kalman滤波GUI.zip【GUI设计Matlab】
资 源 简 介 kalman滤波GUI(matlab6.5)m代码在m_files目录
中
,主函数为fildis执行独立exe时,需..inwin32下的dll支持.可以在autoexec.bat
中
加入此目录,也可将dll文件拷出放入同一目录下,对于独立exe若要从mat文件初始化,mat文件目录全名需无
中
文字符。可以作为设计各种kalman滤波器的开发导航,参数可以自己设置。 详 情 说 明 文
中
提到的kalman滤波GUI(matlab6.5)的m代码可以在m_files目录
中
找到。主函数为fildis。如果您需要在win32下独立地
使用
该exe文件,您需要下载相应的dll文件并将其放入同一目录下。如果您想从mat文件初始化独立exe文件,则必须确保mat文件目录全名不含
中
文字符。此代码可以作为设计各种kalman滤波器的开发导航,并且您可以根据自己的需要自由设置参数。如果您在
使用
过程
中
遇到任何问题,请随时与我们联系。我们将竭诚为您提供帮助。
复现基于ADMM算法的多主体综合能源系统分布式协同优化研究(Matlab代码实现)
内容概要:本文围绕基于交替方向乘子法(ADMM)的多主体综合能源系统分布式协同优化展开研究,提出了一种兼顾系统整体性能与各主体隐私保护的分布式优化框架,并提供了完整的Matlab代码实现。研究详细构建了包含电、热、气等多种能源形式耦合的多主体综合能源系统模型,设计了基于ADMM算法的分布式求解机制,实现了在去
中
心化架构下的协同优化调度。文
中
深入分析了算法的迭代流程、收敛条件及关键参数(如惩罚因子)对优化性能的影响,通过仿真实验验证了该方法在提升能源利用效率、促进多能协同、降低运行成本方面的有效性,适用于园区微网、能源互联网等复杂场景下的分布式决策需求。; 适合人群:具备一定优化理论基础和Matlab编程能力的研究生、科研人员及从事综合能源系统、智能电网、分布式能源管理等相关领域的工程技术人员。;
使用
场景及目标:①实现多主体综合能源系统
中
电、热、气等多能流的协同调度与优化运行;②解决传统集
中
式优化带来的数据隐私泄露和计算负担过重问题,支持去
中
心化的分布式决策模式;③为能源互联网、智慧园区、微电网等实际应用场景提供可复现、易拓展的算法原型与技术参考。; 阅读建议:建议读者结合所提供的Matlab代码进行动手实践,重点理解ADMM算法
中
增广拉格朗日函数的构造、变量更新规则及收敛判据的实现过程,关注惩罚参数设置对算法收敛速度与稳定性的影响,可进一步尝试将其拓展应用于其他分布式优化问题或与其他智能算法进行性能对比研究。
Java
51,408
社区成员
86,097
社区内容
发帖
与我相关
我的任务
Java
Java相关技术讨论
复制链接
扫一扫
分享
社区描述
Java相关技术讨论
java
spring boot
spring cloud
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章