I can't send a tab setting to the printer
The routine works with a memo but fPrn.Handle gives and error.
Something to do with fPrn and system.text
procedure TfMain.puExpListClick(Sender: TObject);
var
fPrn: system.text;
TabArray : array[0..4] of integer;
begin
TabArray[0] := 350;// div DialogUnitsX; //Tab Positions
TabArray[1] := 380; //div DialogUnitsX;
begin
with Printer.Canvas do begin
PrinterSetupDialog1.execute;
Font.Name := 'Courier New';
Font.size := 14;
AssignPrn(fPrn);
Rewrite(fPrn);
SendMessage(fPrn,EM_SETTABSTOPS,2,LongInt(@TabArray)) ; // This
line does not work
SendMessage(fPrn.Handle,EM_SETTABSTOPS,2,LongInt(@TabArray)) ;
//This gives an error.
// SendMessage(memo.Handle,EM_SETTABSTOPS,2,LongInt(@TabArray)) ;
//This works on the memo.
end;
end
dm.tblExpJob.First;
begin // Heading
with Printer.Canvas do begin
Font.size := 12;
WriteLn(fPrn,#10+#10);
WriteLn(fPrn,' '+dm.tblData['Desc']+#13+#10);
Font.Size := 10;
end;
end
etc
WriteLn(fPrn,' '+dm.tblExpJob.FieldByName('Date').AsString
+' '+dm.tblExpJob.FieldByName('Desc').AsString
+' '+#9+dm.tblExpJob.FieldByName('Person').AsString) // Trying to
format the Person on TAB
CloseFile(fPrn);
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [email protected] with Subject:
unsubscribe