捐赠 | 广告 | 注册 | 发布 | 上传 | 关于我们    
  沪ICP备05001939号 DELPHI盒子 | 盒子论坛 | 盒子文章 | 盒子问答悬赏 | 最新更新 | 论坛检索 | 下载中心 | 高级搜索    
  精品专区 | 繁體中文 | 奖励公告栏 | 直通车账号登陆 | 关闭GOOGLE广告 | 临时留言    
 
广告
评论:在程序中使用代码生成动态FastReport报表
zhqian 38656 2009/9/21 10:13:15
发个完一版本上来啊,你这个只是一个单元文件用处不大..........
w3k 24794 2006/7/6 16:31:02
作者只提供了动态生成FR报表部分代码及思想
请作者可否提供该报表的完整代码呢?
xiong81 24483 2006/6/23 11:15:11
不能用,安装的Fr是哪个版本,为什么我装完控件以后,还会出现有很多没见过的控件要我安装,是不是版主没有把全部的代码共享出来?????
jasonmale 24402 2006/6/20 8:48:03
此代码是给对FR有一定了解的人参考用,如果给各位现成的完整的例子,一方面我整理起来有点麻烦,另一方面也没时间。何况这也不是好事,相信对FR有研究的人会有一定的帮助(如何做报表公共处理部分),我使用的FR是3.17版本,此版本还有比较多的问题,下面是我列出的报表设置信息参数:
type
    pRcGrdInfo = ^rcGrdInfo;
    rcGrdInfo = record
      //master 
      sKeyID         :String;// ID
      sDesc          :String;
      isHasRpt       :Boolean;
      sRptID         :String;  //报表ID
      isHasFmtRpt     :Boolean;
      isTextFmtPrint  :Boolean; //是否文本格式化打印
      sFmtRptFile  :String; //所在格式档文件
      sReturnFdMain  :String;
      sReturnFdSecond:String;
      sWhereSql      :String;
      isMulPage      :Boolean; //是否分页显示数据
      isShowSum      :Boolean; //是否显示合计栏
      isDistinct     :Boolean; //相同记录是否显示
      isUserDefine   :Boolean; //速查或者报表是用户自定义的
      cTypeOfServer  :Char;    //连接服务器类型

      sModuleID      :String; //此查询或报表所在模块
      //明细列内容
      iLineNo        :Integer; //显示顺序
      iColNo        :Integer; //所在列号
      iRowNo         :Integer; //所在行,为二维表服务
      sTbname        :String;//表
      sFdName        :String;// 对应字段名
      isHasTopTitle  :Boolean; //是否有主标题
      sColTopTitle  :String;//原
      sColtitle      :String;//标题

      isVisible          :Boolean;
      isAllwaysVisible    :Boolean;
      isNotAllwaysVisible :Boolean;

     // sVisible      :String;//是否显示
      {0或空不显示,'1'和'9'显示(9表示永远显示,用户无权修改显示属性。
      ,8永远不显示,但数据需要取出来,并且对用户来说不能看见)}
      sShowFmt      :String;//显示格式
      iPrecision    :Integer;//小数点位数
      iPreSpaces      :Integer ; // 前加空格数量
      //isAutoFixWidth :Boolean;   //自动加宽
      //iswordwrap  :Boolean;         //折行
      //isAutoFixedLittleFont :Boolean;     //变小字体适应宽度
      isSuppressRepeated    :Boolean;     //重复值不打印

      isCanUpdate    :Boolean;
      iMaxLength     :Integer;
      isAllwaysCanUpdate :boolean;
      isNotAllwaysCanUpdate :Boolean;
      //sCanUpdate    :String;//是否可编辑
      {0或空:不可修改。'1'和'9'(9表示永远允许更新,8永远不可以更新,仅仅显示出来)}
      isChinese      :Boolean;//是否中文输入
      isKeyField    :Boolean;//决定唯一性的关键字
      isCanNotEmpty  :Boolean;//必须输入字段
      isSum          :Boolean;// 是否需合计
      isSortKey      :Boolean;//是否排序
      isSortAsc      :Boolean;//排序是否升序
      isPrintCol     :Boolean;//是否打印
      isGroup        :Boolean;//是否为分组    {9:主分组,1组头,0:不是}
      isMainGroup    :Boolean;
      iInputType    :Integer; //输入类型
      {0 普通字符串 1. 按钮速查类2.日期3. 时间 4: 整数类型 5 数值类型
      6 .Combox类型 7:Checkbox }
      iDataType      :Integer; //数据类型
      {-1,自行处理,0 字符串 1 日期 2 时间,3日期时间 4:逻辑型 5:表达式(后台计算字段)
      6:虚拟字段(前台计算字段)7, 整数 8 数量 9 单价 10 成本
       11 金额 12税率 13:合计}
      sExpression    :String ; //表达式
      sQKViewID      :String; // 对应速查ID
      iWidth        :Integer; //宽度
      sAligentTypeH  :String ;// 横向对方方式  (0:taLeftJustify, 1 taCenter, 2 taRightJustify, )
      sAligentTypeV  :String; // 纵向对方方式  (0 vtaTop,1 vtaCenter,2 vtaBottom)
      sFontName      :String; //字体名
      iFontSize      :Integer; //大小
      sFontStyle    :String; //类型
      iFontColor    :Integer; //颜色
      sHint          :String; //提示信息

      fTotal         :Double;
  end;
  {报表打印设置信息}
  Type
     rcPrintSet = record
        sRptID           :String; //报表内定名ID
        sRptTitle           :String; //varchar(120) 报表标题
        sSubTitle           :String ; //Varchar(120) 副标题
        sPageHeaderLeft     :String ; // Varchar(80) 左边页眉
        sPageHeaderCenter   :String ; //Varchar(80) 中间页眉
        sPageHeaderRight   :String ; //Varchar(80) 右边页眉
        sPageFooterLeft     :String ; //Varchar(80) 左边页脚
        sPageFooterCenter   :String ; //Varchar(80) 中间页脚
        sPageFooterRight   :String ; //Varchar(80) 右边页脚
        sRptEnd           :String ; //Varchar(120) 表尾

        isPrintTitlePerPage :Boolean;//Bit 每页都打印标题
        IsPrintFixedColPerPage:Boolean; // BIT 每页都打印栏头

        Isprintlogo         :Boolean; //Bit 是否打印公司标示
        IsHasHLine         :Boolean; //Bit 报表网格线标志
        IsHasVLine         :Boolean; //Bit 报表网格线标志
        IsShowZero         :Boolean; // Bit 数据为零是否显示
        IsPrintPageHeader   :Boolean; //Bit 是否打印页眉
        IsPrintRptEnd       :Boolean; //Bit 是否打印表尾
        IsPrintRptCondition :Boolean; // Bit 是否打印查询条件
        IsPrintPageFooter   :Boolean; //Bit 是否打印页脚
        IsCenterPageH       :Boolean; //Bit 水平是否居中打印
        IsCenterPageV       :Boolean; //Bit 垂直是否居中打印
        Is3DFixedCol       :Boolean; //Bit 是否打印3d 表头
       // IsAutoFixWidth     :Boolean; //Bit 是否自动适应列宽
        IsPrintToNextPage   :Boolean; //Bit 第一页打印不完时,是否转到下一页打印
        IsCollateCopies     :Boolean; //Bit 逐份打印
        IsColToRow         :Boolean; //Bit 行列是否转换
        IsNewPageByGrp     :Boolean; //Bit 打印时是否每组起新页
        isPrintWithGrp      :Boolean;// 允许分组打印
//        IsPrintAllGrp       :Boolean; //Bit 是否列印所有组
        IsPrintFixedColPerGrp :Boolean; //Bit 每组都打印栏头
        IsPrintGrpHeaderNextPage :Boolean; //Bit 跨页显示组头     
//        iGrpBegin           :integer ;//打印起始组
//        iGrpEnd           :integer ;//integer 打印终止组
        IprintRowsPerPage   :integer ;//Integer 每页打印记录数
        IsDlgWhenToPrint   :Boolean; //Bit 打印前是否显示设置
        sPrintName         :String; //varchar(100) 打印机名
        isPortrait         :Boolean;//Bit 是否纵向打印

        isPrintCover        :Boolean; //是否打印封面页
        sCoverFile          :String;
        isDotMatrix         :Boolean;      //点阵打印机
        iDuplex          :Integer ; //双面打印  0:无,1:纵向双面,2:横向双面,3:单一双面
        isConvertNull       :Boolean; //是否自动转换NULL值
        isDoublePass        :Boolean; //是否先预处理总页数
        isUserFileCache     :Boolean; //是否把报表内容存入缓冲文件
        isPrintIfEmpty      :Boolean; //报表为空时是否打印
        isDoubleBuffered    :Boolean; //采用双缓冲模式预览报表
        iColumns          :Integer ; //报表分栏打印,默认为0
        isPageHeaderLine    :Boolean; //页眉打印下划线
        isPageFooterLine    :Boolean; //页脚打印上划线
        isPHPrintOnFirstPage:Boolean; //页眉首页打印
        isPFPrintOnFirstPage:Boolean; // 页脚首页打印
        isPFPrintOnLastPage :Boolean; // 页脚最后一页打印
        isPrintRptBegin     :Boolean; //是否打印表头
        sRptBegin          :String; //表头条文 string 120
        isColStretch        :Boolean;//栏对象自动扩充行高否
        iTextFixedType      :Integer; //文体栏位的处理:0:折行 1:缩小字体以适应宽度 ,2截断字以填充.3 超界打印
        isPrintGrpSummary   :Boolean; //打印分组小计
        isPrintSummary      :Boolean; //打印报表总计
        iPageType           :integer ;//Integer 纸张类型
        fPageHeight         :double ;//integer 打印高度
        fPageWidth         :double ;//integer 打印宽度
        fRowHeight         :double ;//integer 行高
        fRowSpace           :double ;//Integer 行间距
        fColSpace           :double ;//Integer 列间距
        fLeft           :double ;//Integer 页面左边距
        fRight           :double ;//Integer 页面右边距
        fTop           :double ;//Integer 页面顶边距
        fBottom           :double ;//Integer 页面底边距
        iCopies           :Integer ;//Integer 打印份数
        sTitleFontName      :String   ;// varchar(20) 表标题字体名
        iTitleFontSize     :integer ;//integer 表标题字大小
        STitleFontStyle     :String   ;//varchar(4) 表标题字类型
        iTitleFontColor     :integer ;//Integer 表标题字颜色
        sFixedColFontName     :String   ;//varchar(20) 列头字体名
        iFixedColFontSize     :integer ;//Integer 列头大小
        sFixedColFontStyle   :String   ;//varchar(4) 列头类型
        iFixedColFontColor     :integer ;//Integer 列头颜色
        sFooterFontName     :String   ;//varchar(20) 页头(尾)字体名
        iFooterFontSize     :integer ;//Integer 页头(尾)字体大小
        sFooterFontStyle   :String   ;//varchar(4) 页头(尾)字类型
        iFooterFontColor   :integer ;//Integer 页头(尾)文字颜色
  end;
另外代码中会使用很多frxClass中的资源,其它一些函数是公共函数:如gSetObjectFontAttribute是设置一个对象字体属性。本报表处理程序中并未处理特殊显示格式,处理显示格式有两种方面:1。在BAND的BEFOREPRINT中写事情(我个人不建议),2。在DATASET的GETTEXT事件中写,我采用第2种(比如Boolean或字段中单据类型的显示内容)。其实调用者在调用报表时需传入调用者的一些函数,主要处理栏位属性中一些非后台数据字段的处理,如虚拟字段如何显示。这些方面有报表公共部分定义格式,调用者自己编写,然后传入,报表公共处理部分会把些方面放在dataset的gettext事件中
extraself 24378 2006/6/19 9:39:19
搞个能用的上来呀!另外,FR3X 到底是哪个版本.
第一页 上一页 下一页 最后页 有 5 条纪录 共1页 1 - 5
 用户名:
 密 码:
自动登陆(30天有效)
 
  DELPHI盒子版权所有 1999-2023 V4.01 粤ICP备10103342号-1 更新RSS列表