POS餐飲系統開發時,許多朋友常會遇到報表長度問題。像是出單機會依照內容多寡而出現長短不一的狀況。那在報表長度如何設定呢?
fastreport裡的page options內有一個Endless page height 打勾就行了!
大型網站架構..net 架構師.rabbitMQ.redis.行動開發.APP開發教學.PHP Laravel開發..net core C# 開發.架構師之路.Delphi開發.資料庫程式.進銷存.餐飲POS系統
[pascal]
procedure USBOpenCashDrawer(PrinterName: String);
var
// use winspool
Handle, hDeviceMode: THandle;
N: DWORD;
DocInfo1: TDocInfo1;
Device, Driver, Port: array [0 .. 255] of char;
ThePrinter: string;
code:ansistring;
begin
ThePrinter := PrinterName;
Code := chr(27) + chr(64)+ chr(27) + chr(112) + chr(0) + chr(50) + chr(200);
Printer.PrinterIndex := Printer.Printers.Indexof(ThePrinter);
Printer.GetPrinter(Device, Driver, Port, hDeviceMode);
PrinterName := Format(‘%s’, [Device]);
if not WinSpool.OpenPrinter(PChar(PrinterName), Handle, nil) then
begin
// ShowMessage(‘Error : ‘ + IntToStr(GetLastError));
Exit;
end;
with DocInfo1 do
begin
pDocName := ‘Test’;
pOutputFile := nil;
pDataType := ‘RAW’;
end;
WinSpool.StartDocPrinter(Handle, 1, @DocInfo1);
WinSpool.StartPagePrinter(Handle);
WinSpool.WritePrinter(Handle, PAnsiChar(Code), Length(Code), N);
WinSpool.EndPagePrinter(Handle);
WinSpool.EndDocPrinter(Handle);
WinSpool.ClosePrinter(Handle);
end;
[/pascal]