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

system variable font assignment

edited June 2015 in General
I am using RB 16.02 in XE7. I have a system variable on the form for
the page count, which is set to vtPageCount. I have set psTwoPass. The
variables for page number and page count are working properly.

However, I need to set font name and size dynamically, and although
that works fine on the system variable which is the page number, on the
one for page count, an exception is thrown if I try to assign the font
properties. Pretty simple:

This works:
svPgNum.Font.Name := FFontName;
svPgNum.Font.Size := FFontSize;

This fails:
svPgCount.Font.Name := FFontName;
svPgCount.Font.Size := FFontSize;

What am I missing?

Thanks,

Bill

Comments

  • edited June 2015
    Hi Bill,

    As a quick test I created a simple report with 5 pages and placed the
    following code in the Band.BeforePrint event and received no errors and
    the correct output. Are you able to recreate a similar situation with a
    simple example?

    procedure TForm1.ppFooterBand1BeforePrint(Sender: TObject);
    begin
    SystemVariable_PageNo.Font.Name := 'Verdana';
    SystemVariable_PageNo.Font.Size := 30;

    SystemVariable_PageCount.Font.Name := 'Verdana';
    SystemVariable_PageCount.Font.Size := 30;

    end;

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2015
    Nico Cizik (Digital Metaphors) wrote:


    Hi Nico,

    I found my problem, which was of my own making. XE7 auto-complete
    seems a bit eager sometimes, or maybe it is another add-in, but I
    overlooked an incorrect property path.

    Thanks,

    Bill
This discussion has been closed.