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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

fastReport导出Word问题.docx

1、fastReport导出Word问题fastReport 导出 Word 问题我已用 word 写好了一个模板,里面放了固定的格式, 并定义了很多相应的书签,现在的问题是如何向 word 文档里对应的书签中加入相应 的数据并设置的字体。最好能给出例子。/给你一个我刚刚编写的例子,你自己研究:unit Unit1;interfaceusesWindows, Messages, SysUtils, Classes,Graphics, Controls, Forms, Dialogs,StdCtrls;typeTForm1class(TForm)Button1: TButton;procedure

2、InsertLines(LineNum:Integer);procedure Button1Click(Sender: TObject);private Private declarations publicwordApp,wordDoc:Variant; Public declarations end;varForm1: TForm1;implementationusesComObj;ConstwdAlignParagraphLeft=0;ConstwdAlignParagraphCenter=1;ConstwdAlignParagraphRight=2;ConstwdAlignParagr

3、aphJustify=3;ConstwdAdjustNone=0;ConstwdGray25=16;ConstwdGoTOLine=3;ConstwdGoToLast=-1;ConstwdSendToNewDocument=0;$R *.DFM/在文档中插入空行procedure TForm1.InsertLines(LineNum:Integer); variCount:Integer;beginfor iCount:=1 to LineNum do wordApp.Selection.TypeParagraph;end;procedure TForm1.Button1Click(Sende

4、r: TObject); varStrAdd:String;i:Integer;wrdSelection:Variant;begin/ 创建一个 word 对象 wordApp:=CreateOleObject(Word.Application); wordApp.Visible:=true;/ 创建一个 word 文档 wordDoc:=wordApp.Documents.Add(); wordDoc.Select;wrdSelection:=wordApp.selection;/在文档中插入内容StrAdd:= 教务管理员职务说明书 ;wrdSelection.ParagraphForma

5、t.Alignment:=wdAlignParagraphCenter;wrdSelection.font.bold:=true;wrdSelection.font.size:=15;wrdSelection.font.Underline:=1;wrdSelection.TypeText(StrAdd);wrdSelection.font.Underline:=0;wrdSelection.font.bold:=false;wrdSelection.font.size:=11;InsertLines(1);/在文档中插入一个 4行 4列的表格,并格式化 wordDoc.Tables.Add(w

6、rdSelection.Range,4,4,2,0); wordDoc.Tables.Item(1).Borders.Item(1).LineStyle:=7; wordDoc.Tables.Item(1).Borders.Item(2).LineStyle:=7; wordDoc.Tables.Item(1).Borders.Item(3).LineStyle:=7; wordDoc.Tables.Item(1).Borders.Item(4).LineStyle:=7; for i:=1 to 4 do beginwordDoc.Tables.Item(1).Cell(i,1).Range

7、.Bold:=true;wordDoc.Tables.Item(1).Cell(i,3).Range.Bold:=true;wordDoc.Tables.Item(1).Rows.Item(i).Range.Paragraphs.Align ment:=wdAlignParagraphCenter;end;/ 在第一个表格中插入内容 wordDoc.Tables.Item(1).Cell(1,1).Range.text:= 岗位名 称;worddoc.tables.item(1).cell(1,2).range.InlineShapes.AddPicture( E:heartsong0003.

8、gif,False,True);wordDoc.Tables.Item(1).Cell(2,1).Range.InsertAfter( 岗 位级别 );wordDoc.Tables.Item(1).Cell(3,1).Range.InsertAfter( 隶 属部门 );wordDoc.Tables.Item(1).Cell(4,1).Range.InsertAfter( 直 接上级 );wordDoc.Tables.Item(1).Cell(1,3).Range.InsertAfter( 岗 位编号 );wordDoc.Tables.Item(1).Cell(2,3).Range.Inser

9、tAfter( 现 任职者 );wordDoc.Tables.Item(1).Cell(3,3).Range.InsertAfter( 分 支机构 );wordDoc.Tables.Item(1).Cell(4,3).Range.InsertAfter( 直 接下级 );/ 插入一个 5 行一列的表格 :工作概述wordApp.Selection.GoTo(wdGotoLine,wdGoToLast);Left;wordDoc.Tables.Add(wrdSelection.Range,1,1,2,0);wordDoc.Tables.Item(1).Rows.Item(5).Range.Par

10、agraphs.Alignment:=wdAlignParagraphLeft;wrdSelection.Font.Bold:=true;wrdSelection.Font.Size:=13;wrdSelection.TypeText( 一、工作概述: );wrdSelection.font.bold:=false;wrdSelection.Font.Size:=11;wrdSelection.TypeText(chr(10)+ 一些内容 );/ 插入一个 5 行一列的表格 :主要工作职责 wordApp.Selection.GoTo(wdGotoLine,wdGoToLast);wrdSel

11、ection.ParagraphFormat.Alignment:=wdAlignParagraphLeft;wordDoc.Tables.Add(wrdSelection.Range,1,1,2,0); wordDoc.Tables.Item(1).Rows.Item(6).Range.Paragraphs.Alignment:=wdAlignParagraphLeft;wrdSelection.Font.Bold:=true;wrdSelection.Font.Size:=13;wrdSelection.TypeText( 二、主要工作职责: );wrdSelection.font.bol

12、d:=false;wrdSelection.Font.Size:=11;wrdSelection.TypeText(chr(10)+ 一些内容 );/插入一个 5 行一列的表格 :工作关系: wordApp.Selection.GoTo(wdGotoLine,wdGoToLast);wrdSelection.ParagraphFormat.Alignment:=wdAlignParagraph Left;wordDoc.Tables.Add(wrdSelection.Range,1,1,2,0);wordDoc.Tables.Item(1).Rows.Item(7).Range.Paragra

13、phs.Alignment:=wdAlignParagraphLeft;wrdSelection.Font.Size:=13;wrdSelection.TypeText( 三、工作关系: );wrdSelection.font.bold:=false;wrdSelection.Font.Size:=11;wrdSelection.TypeText(chr(10)+ 一些内容 );/插入一个 5 行一列的表格 :工作权限:wordApp.Selection.GoTo(wdGotoLine,wdGoToLast);wrdSelection.ParagraphFormat.Alignment:=wd

14、AlignParagraphLeft;wordDoc.Tables.Add(wrdSelection.Range,1,1,2,0);wordDoc.Tables.Item(1).Rows.Item(8).Range.Paragraphs.Alignment:=wdAlignParagraphLeft;wrdSelection.Font.Bold:=true;wrdSelection.Font.Size:=13;wrdSelection.TypeText( 四、工作权限: );wrdSelection.font.bold:=false;wrdSelection.Font.Size:=11;wrd

15、Selection.TypeText(chr(10)+ 一些内容 );/ 插入一个 5 行一列的表格 :任职资格与要求: wordApp.Selection.GoTo(wdGotoLine,wdGoToLast);wrdSelection.ParagraphFormat.Alignment:=wdAlignParagraph Left;wordDoc.Tables.Add(wrdSelection.Range,1,1,2,0);wordDoc.Tables.Item(1).Rows.Item(9).Range.Paragraphs.Align ment:=wdAlignParagraphLef

16、t;wrdSelection.Font.Bold:=true;wrdSelection.Font.Size:=13;wrdSelection.TypeText( 五、任职资格与要求: : );wrdSelection.font.bold:=false;wrdSelection.Font.Size:=11;wrdSelection.TypeText(chr(10)+ 学历: + 一些内容 );wrdSelection.TypeText(chr(10)+ 工作经历: + 一些内容);+一些内容 );/插入编制人等内容 wordApp.Selection.GoTo(wdGotoLine,wdGoTo

17、Last);wrdSelection.ParagraphFormat.Alignment:=wdAlignParagraph Left;/编制人编制日期wrdSelection.Font.Bold:=true; wrdSelection.TypeText( 编制人: ); wrdSelection.Font.Bold:=false; wrdSelection.TypeText( 编制人 +);wrdSelection.Font.Bold:=true;wrdSelection.TypeText( 编制日期: ); wrdSelection.Font.Bold:=false; wrdSelecti

18、on.TypeText( 编制日期 );InsertLines(1);/审核人审核日期 wrdSelection.Font.Bold:=true; wrdSelection.TypeText( 审核人: ); wrdSelection.Font.Bold:=false; wrdSelection.TypeText( 审核人 +);wrdSelection.Font.Bold:=true; wrdSelection.TypeText( 审核日期: ); wrdSelection.Font.Bold:=false; wrdSelection.TypeText( 审核日期 );InsertLines

19、(1);/批准人批准日期 wrdSelection.Font.Bold:=true; wrdSelection.TypeText( 批准人: ); wrdSelection.Font.Bold:=false; wrdSelection.TypeText( 批准人 +);wrdSelection.TypeText( 批准日期: ); wrdSelection.Font.Bold:=false; wrdSelection.TypeText( 批准日期 );InsertLines(1);/操作员操作日期 wrdSelection.Font.Bold:=true; wrdSelection.TypeText( 操作员: ); wrdSelection.Font.Bold:=false; wrdSelection.TypeText( 操作员 +);wrdSelection.Font.Bold:=true; wrdSelection.TypeText( 操作日期: ); wrdSelection.Font.Bold:=false; wrdSelection.TypeText( 操作日期 );/保存文档end;end.

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

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