哪位大虾有用QReport做动态报表的例子,给小弟发一份好吗?

Snakeguo 2002-03-08 12:30:28
我的E-MAIL:
Snakeguo@sohu.com
谢谢了!
...全文
85 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
chinajavis 2002-03-11
  • 打赏
  • 举报
回复
哦!这个我还真搞不清。
你讲一下动态报表的大概意思洒...
Snakeguo 2002-03-11
  • 打赏
  • 举报
回复
还是forgot2000(忘记2000年)的方法比较好,接受答案了。
Snakeguo 2002-03-11
  • 打赏
  • 举报
回复
TO:chinajavis(我选择 我喜欢)你E-mail过来的并不是动态报表呀。
chinajavis 2002-03-08
  • 打赏
  • 举报
回复
给你寄个看看,要注意几个band的不同
lu_hm 2002-03-08
  • 打赏
  • 举报
回复
我试试看
cobi 2002-03-08
  • 打赏
  • 举报
回复
forgot2000的方法比较好,如果你觉得这样的定位过于麻烦,也可以把例子中几个类型报表研究以下,然后在你的程序中套用一下他们的格式即可
forgot2000 2002-03-08
  • 打赏
  • 举报
回复
建立listbox1为选择字段,listbox2为打印字段
在QuickReport1(为TQuickRep)上建立QuickReport
上有QRBand1(Title),QRBand2(Columeheader),QRBand3(Detail)
RXDbgrid为显示数据的DBGRID,打印宽度由COLUME.WIDTH决定
可在QRband2上下功夫,设计标题头。自动生成按选择打印列
...

type
ReportCom=record
MyLabel:TQRLabel;
MyText:TQrdbtext;
end;

var
Form_TodayReport: TForm_TodayReport;
Myreport: array[0..29] of ReportCom;// 最多可打印30列

...


procedure TForm_MyReport.OfficeButton16Click(Sender: TObject);
var
i,k:byte;
j:integer;
begin
if ListBox2.items.Count=0 then begin
Application.MessageBox('请选择要打印的项目','提示信息',mb_ok+MB_ICONINFORMATION);
exit;
end;
QuickReport1.quickreport.DataSet:=Form_TodayReport.Rx_Sell;
QuickReport1.QuickReport.OnNeedData:=nil;//如有自定义数据事件放在此处
j:=0;
for i:=0 to ListBox2.items.Count-1 do begin
for k:=0 to RxDBGrid6.Columns.Count-1 do if RxDBGrid6.Columns[k].FieldName=ListBox2.Items[i] then break;
myreport[i].MyLabel:=TQRLabel.Create(QuickReport1.QuickReport);
myreport[i].MyLabel.Parent:=QuickReport1.QRBand5;
myreport[i].MyLabel.Caption:=ListBox2.Items[i];
myreport[i].MyLabel.AutoSize:=False;
myreport[i].MyLabel.Left:=j;
myreport[i].MyLabel.Width:=RxDBGrid6.Columns[k].Width;

myreport[i].MyText:=TQRDBText.Create(QuickReport1.QuickReport);
myreport[i].MyText.Parent:=QuickReport1.QRband6;
myreport[i].MyText.DataSet:=Rx_Sell;
myreport[i].MyText.DataField:=ListBox2.Items[i];
myreport[i].MyText.AutoSize:=false;
myreport[i].MyText.Left:=j;
myreport[i].MyText.Width:=RxDBGrid6.Columns[k].Width;

j:=j+myreport[i].MyLabel.Width+10;
end;
QuickReport1.QuickReport.Preview;
for i:=0 to ListBox2.items.Count-1 do begin
myreport[i].MyLabel.free;
myreport[i].MyText.free;
end;
end;
Snakeguo 2002-03-08
  • 打赏
  • 举报
回复
好,谢谢

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧