将数据库中的数据链接到EXCEL,然后在EXCEL中进行相应的调整,然后再打印。
我认为这是一种比较好的方式。

解决方案 »

  1.   

    使用千禧报表控件
    准确打印
    例子(源码)
    http://wj52.easthome.net/letter.zip
      

  2.   

    要动态设定纸张大小,必须使用API;
    我用一个例子,不知合用否?
    你必须USES Printer;procedure Set_Print_Size(PLen, PWid: Integer);//Plen纸张长度,Pwid纸张宽度
    var
      Device: array[0..cchDeviceName - 1] of Char;
      Driver: array[0..(MAX_PATH - 1)] of Char;
      Port: array[0..32] of Char;
      hDMode: THandle;
      pDMode: PDevMode;
    begin
      printer.PrinterIndex := 0;
      Printer.GetPrinter(Device, Driver, Port, hDMode);
      if hDMode <> 0 then
        begin
          PDMode := GlobalLock(hDMode);
          if pDMode <> nil then
            begin
              pDMode^.dmFields := pDMode^.dmFields or DM_PAPERLENGTH;
              pDMode^.dmFields := pDMode^.dmFields or DM_PAPERWIDTH;
              pDMode^.dmPaperLength := PLen;
              pDMode^.dmPaperWidth := PWid;
              ResetDC(Printer.Handle, pDMode^);
              GlobalUnlock(hDMode);
            end;
        end;
    end;