FastReport控件系列写一个小小报表界面设计工具

新手!空间里的东西太少了,没事就记录一下自己写小玩意的过程。

 

DELPHI 7 创建一个Application,在Form上拖出一个Lable,其caption设置为“选择目标文件”,再拖出一个Edit编辑框用于存放“.fr3”文件的路径,再拖出1个按钮"Open"做打开OpenDialog动作,一个按钮“Designer”做设计动作。

 

1、双击“Open”按钮进入单击事件代码模块,写入       

        if OpenDialog.Execute then
        begin
            Edit1.Text := OpenDialog.FileName;
            DesignerClick(Sender);
        end;

 

 

2、在“Designer”事件代码模块,写入

    frxReport.LoadFromFile(Edit1.Text, false);
    frxReport.DesignReport(True, false);

 

 

 

 

 

Test_FastReportPrint4万能fr3报表查看器 自设计中支持按文本格式查看fr3报表, 前提是报表中最好不要有图片,否则打开会无响应或反应很慢 测试fr3文件2M左右反应很慢 procedure TFrm_BarCode.FallBitBtn6Click(Sender: TObject); begin //默认设计 MyTmsPrintDropBtn1.FrxReport.DesignPreviewPage end; procedure TFrm_BarCode.FallBitBtn3Click(Sender: TObject); begin //自设计 MyTmsPrintDropBtn1.PrintRpt_DesignerW(FrptPrintIDX,Frpttitle,FrptFile); end; procedure TFrm_BarCode.FallBitBtn5Click(Sender: TObject); begin //预览 MyTmsPrintDropBtn1.PrintRpt_PreviewNoDialog(FrptPrintIDX,Frpttitle,FrptFile); end; procedure TFrm_BarCode.FallBitBtn4Click(Sender: TObject); begin //无对话框打印 MyTmsPrintDropBtn1.PrintRpt_PrintNow(FrptPrintIDX,Frpttitle,FrptFile); end; procedure TFrm_BarCode.MyTmsPrintDropBtn1BeforeDropMenuClick( Sender: TMenuItem; ItemsTag: Integer; var CanClick: Boolean; var Memo: String); begin MyTmsPrintDropBtn1.RptFileName:=''; end; procedure TFrm_BarCode.AdvStringGrid1GetEditorType(Sender: TObject; ACol, ARow: Integer; var AEditor: TEditorType); begin if (ACol=0 ) and (ARow=0) then begin AEditor:=edComboList; end; end; procedure TFrm_BarCode.MyTmsPrintDropBtn2BeforeDropMenuClick( Sender: TMenuItem; ItemsTag: Integer; var CanClick: Boolean; var Memo: String); begin with MyTmsPrintDropBtn1 do begin RptPrintIDX:=0; RptPrtTitle:='xxxxxx'; RptFileName:=gsPath+'data\test.fr3' end; end; procedure TFrm_BarCode.FallBitBtn1Click(Sender: TObject); begin MyTmsPrintDropBtn1.FrxReport.PreviewPages.Export(frxXLSExport1) ; end; procedure TFrm_BarCode.FallBitBtn8Click(Sender: TObject); begin //初始化数据 with MyTmsPrintDropBtn1 do begin RptPrintIDX:=StrToInt(Trim(lbe_idx.Text)); //打印机 RptPrtTitle:=Trim(lbe_title.Text); //打印时显示的文件名 RptFileName:=Trim(lbe_file.Text) //打印模板 end; end; end.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值