Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Font vs font.size for 10.04

edited November 2006 in RAP
Hi,
Using RB 10.04 and Delphi7.

My rap code to change the size of the font to suit a long name used
label.font := 10 for version 9.x

Now it does not work. I must use label.font.size := 10. This is a huge
problem with many many reports using the label.font code.

Is there anyway to change it easily or even recognize the reports/fields
somehow that need to be changed.

--
Louis Beck
Vital Records Product Manager
(864)232-2666 x 1-3502#
Piedmont Center East Suite 508
37 Villa Road
Greenville, SC 29615
louis@qsinc.com

Comments

  • edited November 2006
    Hi Louis,

    Which version of RB 9 were you using? In my quick testing with RB 7.04, and
    RB 9.03, I was unable to get the font size to change by directly setting the
    Font property equal to an integer. I checked the back dated bug fixes and
    this does not seem to be something we changed.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Hi Nico, We WERE using 9.03. Now we are on 10/04. I have included the
    code below that would not work and we are having to change.

    begin
    label76.text:= AFFIDAVIT['APPLICANT_NAME_F']+ ' ' +
    AFFIDAVIT['APPLICANT_NAME_M'] + ' ' +
    AFFIDAVIT['APPLICANT_NAME_L'] + ' '+
    AFFIDAVIT['APPLICANT_NAME_SUF'];
    Label76.font := 10;
    If length(Label76.text) > 50 then
    Label76.font := 9;
    If length(Label76.text) > 55 then
    Label76.font := 8;
    If length(Label76.text) > 65 then
    Label76.font := 7;
    If length(Label76.text) > 75 then
    Label76.font := 6;
    If length(Label76.text) > 85 then
    Label76.font := 5;

    end;

    version 10

    var
    comma1 : string;
    comma2 : string;
    comma3 : string;
    begin
    comma1 := ' ';
    comma2 := ' ';
    comma3 := ' ';
    if length(MARRIAGE['G_NAME_MIDDLE']) >= 1 then
    comma1 := ', ';
    if length(MARRIAGE['G_NAME_LAST']) >= 1 then
    comma2 := ', ';
    if length(MARRIAGE['G_NAME_SUFFIX']) >= 1 then
    comma3 := ', ';

    label52.text:= MARRIAGE['G_NAME_FIRST']+ comma1 +
    MARRIAGE['G_NAME_MIDDLE'] + comma2 +
    MARRIAGE['G_NAME_LAST'] + comma3 +
    MARRIAGE['G_NAME_SUFFIX'];
    If length(Label52.text) > 50 then
    Label52.font.size := 9;
    If length(Label52.text) > 55 then
    Label52.font.size := 8;
    If length(Label52.text) > 65 then
    Label52.font.size := 7;
    If length(Label52.text) > 75 then
    Label52.font.size := 6;
    If length(Label52.text) > 85 then
    Label52.font.size := 5;

    end;
    Thanks.

    Louis Beck
    louis@qsinc.com





  • edited November 2006
    Hi Louis,

    I tested again with RB 9.03 and the following code had no effect.

    procedure Label1OnPrint;
    begin
    Label1.Font := 30;
    end;


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Hi Nico,

    Works fine here. THe code we sent works in a lot of reports.

  • edited November 2006
    Hi Nico,

    I checked our code and it was on the ONPRINT also just like yours.
    Maybe we choose the wrong attribute of the Label when we said
    label1.font := 10. But now ours does nothing just like yours and we
    have to go through a huge number of reports to find where we used it.
    Any ideas on an easier way.

  • edited November 2006
    Hi Louis,

    Take a look at the example below. It shows how to automatically modify RAP
    programs in code. Using this method, you could possibly automate the
    process of searching and updating your templates.

    http://www.digital-metaphors.com/tips/RAPModifyPrograms.zip

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2006
    Nico Cizik (Digital Metaphors) wrote:
    Thanks, I will look. ALso I bet you could not reproduce my code and
    results because of printer driver issues. (some users it would work and
    others not).
This discussion has been closed.