首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

100分怎么把QuickReport报表转换为Word文档

2012-03-31 
100分求教:如何把QuickReport报表转换为Word文档?是否有办法可以把把QuickReport报表转换为Word文档?[解决

100分求教:如何把QuickReport报表转换为Word文档?
是否有办法可以把把QuickReport报表转换为Word文档?

[解决办法]
除非找到第三方插件,否则就自己往word里写吧
[解决办法]
FastReport有控件导出,太麻烦的话建议放弃QuickReport
[解决办法]
用ole方式寫進word中試試。。。
[解决办法]

Delphi(Pascal) code
unit   Unit1; interface uses     Windows,   Messages,   SysUtils,   Variants,   Classes,   Graphics,   Controls,   Forms,     Dialogs,   StdCtrls,   Buttons,   OleCtnrs,   OleServer,   Word2000; type     TForm1   =   class(TForm)         OleContainer1:   TOleContainer;         BitBtn1:   TBitBtn;         BitBtn2:   TBitBtn;         BitBtn3:   TBitBtn;         WordDocument1:   TWordDocument;         Button1:   TButton;         WordApplication1:   TWordApplication;         procedure   BitBtn1Click(Sender:   TObject);         procedure   BitBtn2Click(Sender:   TObject);         procedure   BitBtn3Click(Sender:   TObject);         procedure   Button1Click(Sender:   TObject);     private         {   Private   declarations   }     public         {   Public   declarations   }     end; var     Form1:   TForm1; implementation {$R   *.dfm} procedure   setWordBars(Target:   TOleContainer;   Show:   Boolean); begin     try         Target.OleObject.ActiveWindow.DisplayRulers   :=   Show;         Target.OleObject.CommandBars[ 'Menu   Bar '].Enabled   :=   Show;         Target.OleObject.CommandBars[ 'Standard '].Enabled   :=   Show;         Target.OleObject.CommandBars[ 'Formatting '].Enabled   :=   Show;         Target.OleObject.CommandBars[ 'Drawing '].Enabled   :=   Show;     except         ShowMessage(Exception(ExceptObject()).Message);     end; end; procedure   OpenWordFile(Target:   TOleContainer;   WordFile:   string); begin     Screen.Cursor   :=   crHourGlass;     try         Target.DestroyObject;         if   FileExists(WordFile)   then             begin                 Target.CreateObjectFromFile(WordFile,   False);                 Target.DoVerb(ovPrimary);             end     except         Screen.Cursor   :=   crDefault;     end;     Screen.Cursor   :=   crDefault; end; procedure   TForm1.BitBtn1Click(Sender:   TObject); begin     OpenWordFile(OleContainer1,   'c:\1.doc '); end; procedure   TForm1.BitBtn2Click(Sender:   TObject); begin     setWordBars(OleContainer1,   FALSE); end; procedure   TForm1.BitBtn3Click(Sender:   TObject); begin     setWordBars(OleContainer1,   true); end; procedure   TForm1.Button1Click(Sender:   TObject); var     WordRepTemp,   wordApp:   olevariant;     fn:   olevariant; begin     WordRepTemp   :=   OleContainer1.OleObject;     WordApp   :=   WordRepTemp.Application;     WordDocument1.ConnectTo(IUnknown(WordRepTemp)   as   _Document);     WordApplication1.ConnectTo(WordDocument1.Application); //     fn   :=   'c:\2.doc '; //     WordDocument1.SaveAs(fn);     WordDocument1.PrintOutOld; /////////////////////////////////////////////////////// end; end.
[解决办法]
你可以选择delphi直接操作word 但是那和quickreport没有关系了,在有就是看看现在最新的qr有没有导出功能,那就方便多了,哈哈 我就爱偷懒
[解决办法]
这个得自己写代码实现。
[解决办法]
自己往word里写吧

热点排行