Re: To Nard Mosely of Digital-Metaphors




Please use support@xxxxxxxxxxxxxxxxxxxxx or the newsgroups.

The process of Report generation works something like this...

Report --> Page.DrawCommands[] --> PrinterDevice --> render to printer

I think the issue here is that you are using the Label.OnPrint event. This
event fires during Page generation. Each object that prints on the page,
creates a DrawCommand object. A DrawCommand object contains a description
of something to be rendered - location, font, text etc.

The TppPrinterDevice class receives the Page objects and renders the
DrawCommands to the printer canvas. The TppPrinterDevice.DrawText method
handles text rendering. Have a look at that.



"Debbie Erickson" <dericksonATknowles-mcniff.us> wrote in message
news:437e1c42$1@xxxxxxxxxxxxxxxxxxxxxxxxx
> HI Nard. Thanks for replying. Your support people in Digital-Metaphors
> are generally most helpful and I really do appreciate the help I've gotten
> over the years. :)
>
> But I have an issue that no one seems to have an answer for me over on
> that website. I'd been hoping that someone using Delphi and
> reportbuilder, but not currently following the rb newsgroup might see my
> posting.
>
> Here's my problem. I will be printing checks using a dimm signiture card.
> The signiture is activated thru an escape sequence and has no font name
> that I know of, so I can't use the normal canvas methods to change the
> font. We have not purchased the dimm card, but are trying to see if using
> it is feasible for us. My supervisor has asked me to get a working
> example of changing the font in a report using escape sequences before
> purchasing the actual dimm card. My test printer does understand pcl5
> escape sequences.
>
> Using DIMM cards for security reasons seems like it might be a fairly
> common practice. Maybe if I outline what I have tried, perhaps someone
> over on the rb site can post a how-to in the tip section of
> reportbuilder?
>
> This is what I have tried so far: I have a pplabel on my detail band of
> the report. The component is set to visible and the font is set to New
> Times Roman. I am attempting to set the font to Letter Gothic. I can
> generate a paper orientation escape that works by changing the orientation
> to landscape, but the font does not change. I code a string with my
> escape codes, copy the string to a null terminated string, set the length
> of that string, then call the extescape function. I am completely
> postitive that the escape code for Letter Gothic is #27'(s4102T'. I have
> tried sending this code by itself. And I have set the visibility of the
> pplabel to false and appended my label caption to the escape sequence
> before sending it thru the Windows event handler. Neither seems to work.
> The label appears as it was set at design time.
>
> This is my onprint event coding:
>
> type
> TPassThroughData = packed record
> DataLen: Word;
> DataBuf: array[0..255] of char;
> end;
>
> procedure TForm1.ppLabel2Print(Sender: TObject);
> const
> SymbolSet = #27'(8U';
> SpacingCommand = #27'(s0p';
> PitchCommand = #27'(s28H';
> HeightCommand = #27'(s18V';
> StyleCommand = #27'(s0S';
> StrokeWeightCommand = #27'(s3B';
> TypeFaceCommand = #27'(s4102T';
> LandScapeCommand = #27'&l1O';
>
> var
> lCanvas : TCanvas;
> lsEscapeCode : String;
> begin
> if Assigned(MyReport.PrinterDevice) then
> begin
> lCanvas := MyReport.PrinterDevice.Printer.Canvas;
> {the landscape command works}
> // lsEscapeCode := LandscapeCommand;
> lsEscapeCode:= TypeFaceCommand +
> pplabel2.caption;
> SendEscapeCode(lCanvas, lsEscapeCode);
> end;
> end;
>
> procedure TForm1.SendEscapeCode(aCanvas: TCanvas; aEscapeCode: String);
> var
> lPassThrough: Integer;
> Buff : TPassThroughData;
> s : string;
> begin
> lPassThrough := PASSTHROUGH;
> if (Escape(aCanvas.Handle, QUERYESCSUPPORT,
> SizeOf(lPassThrough),@lPassThrough, nil) > 0) then
> begin
> { Make a string to passthrough }
> s := aEscapeCode;
> { Copy the string to the buffer }
> { and set the length of the buffer}
> with buff do
> begin
> datalen := Length( s );
> StrLCopy( databuf, Pchar( s ), 255);
> end;
> {This is a Windows event handler}
> ExtEscape(aCanvas.Handle, PASSTHROUGH, sizeof(Buff), @Buff, 0, nil);
> end
> else
> MessageDlg('You have chosen to print checks on the wrong
> printer!',mtError,[mbok],0);
>
> end;
>
>
>


.



Relevant Pages

  • To Nard Mosely of Digital-Metaphors
    ... so I can't use the normal canvas methods to change the font. ... have not purchased the dimm card, but are trying to see if using it is ... I code a string with my escape ... and appended my label caption to the escape sequence before sending it thru ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: placement of text with Printer object
    ... I was thinking I needed a monospaced font ... do you recommend me positioning each string ... it seems fairly simple to migrate your report from Olde Basic to ... Using CurrentY is a better solution for horizontal ...
    (microsoft.public.vb.general.discussion)
  • Re: uncleared code
    ... Dim rt As String = ... when i change the font name int this line its reflected in crystal ... but i cant change the font directly in creport. ... right click the field and format but i cat reflect on report ...
    (microsoft.public.dotnet.faqs)
  • Re: uncleared code
    ... Dim rt As String = ... when i change the font name int this line its reflected in crystal ... but i cant change the font directly in creport. ... right click the field and format but i cat reflect on report ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: uncleared code
    ... Dim rt As String = ... when i change the font name int this line its reflected in crystal ... but i cant change the font directly in creport. ... right click the field and format but i cat reflect on report ...
    (microsoft.public.dotnet.languages.csharp)