想使用  FastReports 打印出货单,格式如下图所示,请问该如何编写?如果有多页呢?谢谢。

解决方案 »

  1.   

    汗·~不带有这么问问题的……如果不会写,可以考虑使用grideh,类似这样的表格打印,一句话搞定~~
      

  2.   

    主细表结构,看看FastReport中的demo(例子)就知道了。
      

  3.   

    http://blog.csdn.net/bdmh/archive/2009/05/27/4219395.aspx
    FastReport问题整理
      

  4.   

    使用Band呀!
    页面抬头!
    表头
    还有明细数据!
    FastReport底下有Demo的!
      

  5.   

    還有REPORT BUILDER, REPORT MACHINE...CRYSTAL REPORT....
      

  6.   

    兄弟,你也研究研究再用啊! 报表不是像你这样用的!都傻瓜式的画,那用excel不更好!去看一下band是怎么回事,好吧
      

  7.   

    这张报表Fastreport完全可以实现
      

  8.   

    楼主的意思是多页套打主从表单据,要使用fr的group band,而且在数据集中有分组的字段,表示每行记录的所在分组号(varchar(50))
    、下面是我写的公共的分页套打代码:
    //套打数据集
    Procedure PrintPre_Com(vw_mst, vw_Det, FKFld, KFldVal, FDKeyFld, DetFlds, NumFld, MstFlds, DetTable:String;
                           MPrintQry, DPrintQry :TAdoQuery);
    var i, j, i1, i2:integer; Qrytmp :TAdoQuery;
        PrintLines :Integer;  Sqls ,Fld :String; PrintCompName :string;
    begin
       PrintLines    :=GetPrintLines;//读取结算单打印格式中的行数
       PrintCompName :=GetPrintCompName; //打印格式中的公司标题   with MPrintQry do begin close; sql.Text:='Select * from '+vw_mst +' where '+FKFld +'='''+KFldVal+''''; open;end;   Qrytmp  :=createBatchQry;
       with Qrytmp do begin close; sql.Text:='Select * from '+vw_Det+' where '+FKFld +'='''+KFldVal+''' Order By '+FDKeyFld; open;end;
       
       //拼接临时的数据集的Sql。
       Sqls :=' Select Re as CurrPage, Re as PageCount, Re as PrintCompName ' ;
       For i :=1 to GetMaskCount(DetFlds, '\') do begin
          Sqls :=Sqls +',Re as ' +GetMaskString(DetFlds, '\', i);
       end;   For i :=1 to GetMaskCount(NumFld, '\') do begin
          Sqls :=Sqls  +',' +GetMaskString(NumFld, '\', i);
       end;   For i :=1 to GetMaskCount(MstFlds, '\') do begin
          Sqls :=Sqls +', Re as ' +GetMaskString(MstFlds, '\', i);
       end;
       
       Sqls :=Sqls +' from ' +DetTable +' where 1=2 ';
       with DPrintQry do begin close; sql.Text :=Sqls; open; end;   i := 0; i2 :=0;
       with Qrytmp do begin
          first;
          while not eof do begin
             i1 :=RecNo Div PrintLines;
             i2 :=RecNo Mod PrintLines;
             if i2 =0 then i :=i1
             else          i :=i1 +1;
             
             with DPrintQry do begin
                append;
                For j :=1 to GetMaskCount(DetFlds, '\') do begin
                   Fld :=GetMaskString(DetFlds, '\', j);
                   FieldByName(Fld).asstring :=Qrytmp.FieldByName(Fld).asstring;
                end;            For j :=1 to GetMaskCount(NumFld, '\') do begin
                   Fld :=GetMaskString(NumFld, '\', j);
                   FieldByName(Fld).asstring :=Qrytmp.FieldByName(Fld).asstring;
                end;
                
                FieldByName('CurrPage').asstring  :=inttostr(i);
                post;
             end;
             next;
          end;
       end;   //补全N行
       For j :=0 to ( (PrintLines -i2) Mod PrintLines ) -1 do begin
          with DPrintQry do begin
             append; FieldByName('CurrPage').asstring :=inttostr(i); post;
          end;
       end;   //设置最大分组页数和打印格式公司标题名称
       with DPrintQry do begin
          first;
          while not eof do begin
             edit;
             FieldByName('PageCount').asstring      :=inttostr(i);
             FieldByName('PrintCompName').asstring  :=PrintCompName;
             Post; next;
          end;
       end;   //明细数据集加主表字段
       with DPrintQry do begin
          first;
          while not eof do begin
             edit;
             For i :=1 to GetMaskCount(MstFlds, '\') do begin
                Fld :=GetMaskString(MstFlds, '\', i);
                FieldByName(Fld).asstring :=MPrintQry.FieldByName(Fld).asstring;
             end;
             Post; next;
          end;
       end;   Qrytmp.Free;
    end;