ImageVerifierCode 换一换
格式:DOCX , 页数:9 ,大小:16.47KB ,
资源ID:6869039      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/6869039.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(FastReport4 动态报表制作.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

FastReport4 动态报表制作.docx

1、FastReport4 动态报表制作FastReport4动态报表制作注:1、窗体报表控件FR:TfrxReport;frDB:TfrxDBDataset2、调用自定义函数:GetPrnFieldWidth(ADOQ_List); /取得查询结果中各字段宽度3、全局变量:Prn_FieldWidth: Arrayofinteger; /打印时各字段宽度数组通过GetPrnFieldWidth修改其值4、usesPRINTERS;代码:procedureTFrm_yppf_prn_pfd.ToolButton3Click(Sender: TObject);Var/DataPage: TfrxDa

2、taPage;Page: TfrxReportPage;PageTitle:TfrxReportTitle;PageHeader:TfrxPageHeader;/Band: TfrxBand;MastData: TfrxMasterData;PageSummary:TfrxReportSummary;Memo: TfrxMemoView;i:integer;MLeft:Real;/表头字段在mastdata中的左边距PaperWidth:Real; /纯报表(不含边距)宽度(毫米)begin/清除报表FR.Clear;/1=添加页Page:=TfrxReportPage.Create(FR);

3、Page.CreateUniqueName;/创建唯一名称/Page.SetDefaults;/设置默认字段大小,纸张/自定义纸张大小/Page.PaperWidth:=210; /纸张宽/Page.PaperHeight:=297;/纸张高Page.PaperSize:=9;/a4纸Page.Orientation:=poPortrait; /纸张纵向/Page.Orientation:=poLandscape; /纸张横向Page.TopMargin:=25;/上边距Page.BottomMargin:=15;Page.LeftMargin:=15;Page.RightMargin:=15

4、;/2=添加一个报表标题栏PageTitle:=TfrxReportTitle.Create(Page);PageTitle.CreateUniqueName;PageTitle.Top:=0;PageTitle.Height:=140;/留出空白行/得到报表不含边距的宽度(毫米)转换为像素时需乘以3.77953/SetBounds中用的是像素值PaperWidth:=(Page.PaperWidth-page.LeftMargin-page.RightMargin)*3.77953;/添加标题memoMemo:= TfrxMemoView.Create(PageTitle);Memo.Cre

5、ateUniqueName;Memo.HAlign:=haCenter;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Font.Size:=14;Memo.Text := 药品批发单;Memo.Height := 40;Memo.Align:=baWidth;/伸展坐标到标题栏的宽度/摘要第一行Memo:= TfrxMemoView.Create(PageTitle);Memo.CreateUniqueName;Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Text := 单号:+LEdit_dh.

6、Hint;Memo.Height := 20;Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.SetBounds(0,60,PaperWidth/3,20);/Memo:= TfrxMemoView.Create(PageTitle);Memo.CreateUniqueName;Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Text := 单位:+LEdit_dwmc.Text;Memo.Height := 20;Memo.Frame.Typ:=ftLeft,ft

7、Right,ftTop,ftBottom;/显示边线Memo.SetBounds(PaperWidth/3,60,PaperWidth/3,20);/Memo:= TfrxMemoView.Create(PageTitle);Memo.CreateUniqueName;Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Text := 批发金额:+LEdit_SumPfj.Text;Memo.Height := 20;Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.Se

8、tBounds(PaperWidth/3*2,60,PaperWidth/3,20);/摘要第二行Memo:= TfrxMemoView.Create(PageTitle);Memo.CreateUniqueName;Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Text := 结算方式:+LEdit_jsfsmc.Text;Memo.Height := 20;Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.SetBounds(0,80,PaperWidth/3,

9、20);/Memo:= TfrxMemoView.Create(PageTitle);Memo.CreateUniqueName;Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Text := 制单人:+LEdit_zdr.Text;Memo.Height := 20;Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.SetBounds(PaperWidth/3,80,PaperWidth/3,20);/Memo:= TfrxMemoView.Create(PageT

10、itle);Memo.CreateUniqueName;Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Text := 制单日期:+LEdit_zdrq.Text;Memo.Height := 20;Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.SetBounds(PaperWidth/3*2,80,PaperWidth/3,20);/摘要第三行Memo:= TfrxMemoView.Create(PageTitle);Memo.CreateUniqueName;

11、Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Text := 操作员:+UserName;Memo.Height := 20;Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.SetBounds(0,100,PaperWidth/3,20);/Memo:= TfrxMemoView.Create(PageTitle);Memo.CreateUniqueName;Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中M

12、emo.Text := 打印日期:+DateToStr(Date)+TimeToStr(GetTime);Memo.Height := 20;Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.SetBounds(PaperWidth/3,100,PaperWidth/3,20);/Memo:= TfrxMemoView.Create(PageTitle);Memo.CreateUniqueName;Memo.HAlign:=haLeft;/左右居中Memo.VAlign:=vaCenter;/上下居中Memo.Text := ;Me

13、mo.Height := 20;Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.SetBounds(PaperWidth/3*2,100,PaperWidth/3,20);/=3=添加Pageheader(表头)PageHeader:=TfrxPageHeader.Create(Page);PageHeader.CreateUniqueName;/PageHeader.Top:=PageTitle.Height+120; /其总是紧随PageTitle之后PageHeader.Height:=20;/添加表头memoGetPrnF

14、ieldWidth(ADOQ_List); /取得查询结果中各字段宽度MLeft:=0;for i := 0 to ADOQ_List.FieldCount - 1 doBeginMemo:=TfrxMemoView.Create(PageHeader);Memo.CreateUniqueName;Memo.HAlign:=haCenter;Memo.HAlign:=haCenter;Memo.VAlign:=vaCenter;/上下对齐Memo.Frame.TopLine.Style:=fsSolid;Memo.Frame.BottomLine.Style:=fsSolid;Memo.Fra

15、me.LeftLine.Style:=fsSolid;Memo.Frame.RightLine.Style:=fsSolid;/边线格式Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.Text:=Trim(ADOQ_List.Fieldsi.FieldName);ifiADOQ_List.FieldCount-1 thenBeginMemo.SetBounds(MLeft,0,Prn_FieldWidthi*7.5,20);EndElseBegin /最后一列时,页面剩余宽度都给他Memo.SetBounds(MLeft,0,Pa

16、perWidth-MLeft,20);End;MLeft:=MLeft+Prn_FieldWidthi*7.5;/下一列左起位置End;/4=主数据(记录)MastData:=TfrxMasterData.Create(Page);MastData.CreateUniqueName;MastData.Top:=PageTitle.Height+PageHeader.Height;MastData.Height:=20;MastData.DataSet:=frDB;/添加memoMLeft:=0;for i := 0 to ADOQ_List.FieldCount - 1 doBeginMemo

17、:=TfrxMemoView.Create(MastData);Memo.CreateUniqueName;/Memo.HAlign:=haCenter;Memo.HAlign:=haLeft;Memo.VAlign:=vaCenter;/上下对齐Memo.Font.Size:=9;Memo.Frame.TopLine.Style:=fsSolid;Memo.Frame.BottomLine.Style:=fsSolid;Memo.Frame.LeftLine.Style:=fsSolid;Memo.Frame.RightLine.Style:=fsSolid;/边线格式Memo.Frame.Typ:=ftLeft,ftRight,ftTop,ftBottom;/显示边线Memo.DataSet:=frDB;Memo.DataField:=Trim(ADOQ_List.Fieldsi.FieldName);ifi0 thenBeginif StrToInt(DM.ADOQ_Find.FieldByName(字段最长值).AsString)Prn_FieldWidthi thenPrn_FieldWidthi:=StrToInt(DM.ADOQ_Find.FieldByName(字段最长值).AsString);End;MyADOQ.Next;End;End;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1