如何实现换行打印?

senhor 2003-06-02 08:36:40
俺家穷,可出得起这个价
还望哪位高手不啬赐教
最好有相关的例子
谢谢
...全文
91 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangguan007 2003-06-06
  • 打赏
  • 举报
回复
关注!!
wangguan007 2003-06-04
  • 打赏
  • 举报
回复
关注!!!!!
ych121 2003-06-04
  • 打赏
  • 举报
回复
用TQRRichText在QuickRep.OnNeedData中手工写入数据
procedure TQRListForm.QuickRep1NeedData(Sender: TObject;
var MoreData: Boolean);
var mc:WideString;
n:integer;
begin
MoreData:=true;
with datamodule1.Query3 do
begin
mc:=fieldbyname('mc').AsString;
QRRichText1.Lines.Text:=mc;
if fieldbyname('bh').AsString='***' then
begin
QRLabel14.Caption:='';
QRLabel15.Caption:=mc;
QRRichText1.Lines.Clear;
QRLabel18.Caption:='';
QRLabel19.Caption:='';
QRLabel20.Caption:='';
QRLabel15.Left:=(QRShape19.Left-QRLabel15.Width)div 2;
DetailBand1.Height:=24+RowHeight;
QRShape11.Top:=22+RowHeight;
QRShape13.Enabled:=false;
QRShape14.Enabled:=false;
QRShape15.Enabled:=false;
QRShape16.Enabled:=false;
QRShape17.Enabled:=false;
QRShape18.Enabled:=false;
QRRichText1.Height:=16+RowHeight div 2;
end
else
begin
QRShape13.Enabled:=true;
QRShape14.Enabled:=true;
QRShape15.Enabled:=true;
QRShape16.Enabled:=true;
QRShape17.Enabled:=true;
QRShape18.Enabled:=true;
QRLabel15.Left:=QRShape13.Left+2;
if copy(fieldbyname('bh').AsString,1,4)='****' then
begin
QRLabel14.Caption:='';
QRLabel15.Caption:=trim(copy(fieldbyname('bh').AsString,5,16));
end
else
begin
i:=i+1;
QRLabel14.Caption:=inttostr(i);
QRLabel15.Caption:=fieldbyname('bh').AsString;
end;

QRRichText2.Lines.Text:=fieldbyname('hsgs').AsString;
if (QRRichText1.Lines.Count>1)or(QRRichText2.Lines.Count>1) then
begin
if QRRichText1.Lines.Count>QRRichText2.Lines.Count then
n:=QRRichText1.Lines.Count
else
n:=QRRichText2.Lines.Count;
DetailBand1.Height:=24+RowHeight+10*n;
QRListForm.QRShape12.Height:=24+RowHeight+10*n;
QRLIstForm.QRShape11.Top:=22+RowHeight+10*n;
QRShape13.Height:=24+RowHeight+10*n;
QRShape14.Height:=24+RowHeight+10*n;
QRShape15.Height:=24+RowHeight+10*n;
QRShape16.Height:=24+RowHeight+10*n;
QRShape17.Height:=24+RowHeight+10*n;
QRShape18.Height:=24+RowHeight+10*n;
QRShape19.Height:=24+RowHeight+10*n;
QRRichText1.Height:=26+RowHeight div 2+10*n;
QRRichText2.Height:=24+RowHeight div 2+10*n;
end
else
begin
DetailBand1.Height:=24+RowHeight;
QRListForm.QRShape12.Height:=24+RowHeight;
QRShape11.Top:=22+RowHeight;
QRShape13.Height:=24+RowHeight;
QRShape14.Height:=24+RowHeight;
QRShape15.Height:=24+RowHeight;
QRShape16.Height:=24+RowHeight;
QRShape17.Height:=24+RowHeight;
QRShape18.Height:=24+RowHeight;
QRShape19.Height:=24+RowHeight;
QRRichText1.Height:=16+RowHeight div 2;
QRRichText2.Height:=14+RowHeight div 2;
end;
nRowH:=nRowH+DetailBand1.Height;
QRLabel18.Caption:=fieldbyname('dw').AsString;
if fieldbyname('q').AsFloat=0 then
QRLabel19.Caption:=''
else
QRLabel19.Caption:=formatfloat('0.000',fieldbyname('q').AsFloat);
if fieldbyname('jj').AsFloat=0 then
QRLabel20.Caption:=''
else
QRLabel20.Caption:=formatfloat('0.00',fieldbyname('jj').AsFloat);
end;
if(PrintHeight-nRowH>0)and(PrintHeight-nRowH<=Detailband1.Height)then
QRShape11.Height:=2
else
QRShape11.Height:=1;
if eof then
begin
if form38.IsSpace then
begin
QRLabel14.Caption:='';
QRLabel15.Caption:='';
QRRichText1.Lines.Clear;
QRRichText2.Lines.Clear;
QRLabel18.Caption:='';
QRLabel19.Caption:='';
QRLabel20.Caption:='';
if nRowH>=PrintHeight then
MoreData:=false;
end
else
MoreData:=false;
end;
next;
end;
end;
senhor 2003-06-03
  • 打赏
  • 举报
回复
斑竹呢????

没有人回啊???
不会UP也有分啊!!!
lxpbuaa 2003-06-02
  • 打赏
  • 举报
回复
使用TQRRichedit

在DataSet.OnAfterScroll中写代码

————————————————————————————————————
宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
————————————————————————————————————
senhor 2003-06-02
  • 打赏
  • 举报
回复
用QRMemo我不知道怎么连接数据库啊
pigeonwind 2003-06-02
  • 打赏
  • 举报
回复
你用qrdbmemotext控件试试,连接好后,应该是早点换行
senhor 2003-06-02
  • 打赏
  • 举报
回复
楼上的
你说的我没找着那个控件啊
是TQRRichEdit 还是TQRRichText
如果是TQRDBRichText那不行啊
我连接数据库后,字段的内容显示不出来啊

5,388

社区成员

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

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