quickreport问题,多行如何打印?!! 我利用sql 查询出 多条数据 ,显示在dbgrid框中!(条目不定) 现在我想用 quickreport 打印出dbgrid中的数据 请问如何打印?!--就用quickreport中的控件 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 报表的数据源连接查询的dataset,然后用循环把字段名读进来就可以了,标签和QRDBText都用数组。 谢谢楼上可是我的 条目不定 怎么知道 划多少个qrdbtext? 根据QUERY的字段数目动态创建QTDBTEXT,我写过类似的。最好在ONNEEDDATA手动写入 我这儿是打印的StringGrid里的数据,字段的多少是不定的。代码如下:procedure TForm1.SpeedButton11Click(Sender: TObject);Var Index_R ,ALeft: Integer; Index : Integer;begin QRFree; StringGrid_File('D:\AAA.TXT'); if Not LinkTextFile then begin ShowMessage('失败'); Exit; end; // QuickRep1.DataSet := ADOTable1; Index_R := ReSize(StringGrid1.Width); ALeft := 13; Create_Title(TitleBand1,ALeft,24,Size_(0),20, HeaderControl1.Sections[0].Text,taLeftJustify); with Create_QRDBText(DetailBand1,ALeft,8,Size_(0),20, StringGrid1.Font,taLeftJustify) do begin DataSet := ADOTable1; DataField := ADOTable1.Fields[0].DisplayName; end; ALeft := ALeft + Size_(0) + 1; For Index := 1 to ADOTable1.FieldCount - 1 do begin Create_VLine(TitleBand1,ALeft - 13,16,1,40); Create_Title(TitleBand1,ALeft,24,Size_(Index),20, HeaderControl1.Sections[Index].Text,taLeftJustify); Create_VLine(DetailBand1,ALeft - 13,-1,1,31); with Create_QRDBText(DetailBand1,ALeft ,8,Size_(Index),20, StringGrid1.Font,taLeftJustify) do begin DataSet := ADOTable1; DataField := ADOTable1.Fields[Index].DisplayName; end; ALeft := ALeft + Size_(Index) + 1; end; QuickRep1.Preview;end; 请教如何在CIS中调用IE的cookies 问个比较低级的问题!大家多帮忙 关于读取文件的出错问题!!!! 关于ComboBox的经典问题??(在线等) ????????????给另一程序的edit付值 求解 想不通,女朋友是拿来做什么的? 问两个问题 delphi不同数据库表间的图像存取问题 dbgrid下输入焦点怎样回到前一个字段? 商业逻辑,不知大家把它放在哪里处理? 关于treeview100分 帮帮我这初级菜鸟
最好在ONNEEDDATA手动写入
Var
Index_R ,ALeft: Integer;
Index : Integer;
begin
QRFree;
StringGrid_File('D:\AAA.TXT');
if Not LinkTextFile then
begin
ShowMessage('失败');
Exit;
end;
//
QuickRep1.DataSet := ADOTable1;
Index_R := ReSize(StringGrid1.Width);
ALeft := 13;
Create_Title(TitleBand1,ALeft,24,Size_(0),20,
HeaderControl1.Sections[0].Text,taLeftJustify);
with Create_QRDBText(DetailBand1,ALeft,8,Size_(0),20,
StringGrid1.Font,taLeftJustify) do
begin
DataSet := ADOTable1;
DataField := ADOTable1.Fields[0].DisplayName;
end;
ALeft := ALeft + Size_(0) + 1;
For Index := 1 to ADOTable1.FieldCount - 1 do
begin
Create_VLine(TitleBand1,ALeft - 13,16,1,40);
Create_Title(TitleBand1,ALeft,24,Size_(Index),20,
HeaderControl1.Sections[Index].Text,taLeftJustify);
Create_VLine(DetailBand1,ALeft - 13,-1,1,31);
with Create_QRDBText(DetailBand1,ALeft ,8,Size_(Index),20,
StringGrid1.Font,taLeftJustify) do
begin
DataSet := ADOTable1;
DataField := ADOTable1.Fields[Index].DisplayName;
end;
ALeft := ALeft + Size_(Index) + 1;
end;
QuickRep1.Preview;
end;