MasterFooter.OnBeforePrint doesn't work

Recently I upgraded to FR 2.55 and now the OnBeforePrint event of my MasterFooter band no longer executes at all.

Has anyone else experienced any similar problem? Any idea what is going on with this new version.

Would anyone know where I can download the last stable version of FR 2.x, version 2.55 appears to be full of bugs.

FastReport team, are you monitoring this forum at all, it seems like most questions remain unanswered.

Thank you,
--
Philippe

Comments

  • edited 11:15AM
    Correction!!

    In my original posting, I said that my OnBeforePrint event does not execute at all but I was wrong. It does execute.

    However, even though it does execute, I am still facing 2 problems when it runs...

    1. The FieldIsNull function returns true even when testing a field that contains a value.

    2. Assigning a text value to a TfrMemoView can no longer be done without specifying the Memo property in the assignment...

    - Memo1 := 'Some text'; // used to work but not anymore
    - Memo1.Memo := 'Some text'; // does work

    Problem# 2 can easily be worked around by specifying the Memo property in all MemoView assignments but it would have been nice if it continued to work the way it used to.

    Would anyone have a workaround for problem# 1.

    Thank you,
    --
    Philippe (Using FR 2.55 Pro with D7 Pro.)
  • edited 11:15AM
    Another correction.

    Problem number 2 in my previous note is actually not a problem at all. After doing some more testing, I came to realize that it was my mistake to try to change the content of a TfrMemoView without using the Memo qualifier.

    I am sorry if I mislead anyone with my false statement and for jumping to conclusion too promptly.
    --
    Philippe
  • edited 11:15AM
    wrote:
    1. The FieldIsNull function returns true even when testing a field that contains a value.
    You need try to call the FieldIsNull function like this:
    FieldIsNull(' Table1."CustNo" ')
    The call FieldIsNull([Table1."CustNo"]) - it is wrong.
  • edited 11:15AM
    Hi Den,

    Thank you for your reply.

    The code I am trying to execute is...

    if FieldIsNull('dmOrder.ibdsPO."INSTRUCTIONS"') then
    InstructionsBand.Visible := false;

    This code used to work with the last version of FR installed on my computer (I think it was version 2.52) and stopped working after I installed version 2.55.
    --
    Philippe
  • edited 11:15AM
    Try to change function in the FR_Class.pas.

    Function:

    procedure TDatabaseFunctionLibrary.DoFunction(FNo: Integer; p1, p2, p3: Variant;
    var val: Variant);
    begin
    val := 0;
    case FNo of
    0: val := frFieldIsNull(p1);{change to 0: val := frFieldIsNull(frParser.Calc(p1));}
    end;
    end;
  • edited 11:15AM
    Hi Den,

    Thank you for your help.

    I must tell you that I did backtrack to FR 2.54 as a result of having too much trouble with FR 2.55.

    Unfortunately, the FieldIsNull function doesn't seem to work in FR 2.54 either. I tried applying the changes that you suggested but the result is the same. FieldIsNull continues returning 'true' even when a field is not null.

    I found a substitute for using FieldIsNull with varchar fields but it doesn't work with other field types like date fields for example.

    Here is the substitute that I use with varchar fields..

    if [LENGTH(TRIM([dmOrder.ibdsPO."INSTRUCTIONS"]))] = 0 then
    InstructionsBand.Visible := false;

    This substitute even gives me the advantage of not printing the InstructionsBand when the value of the field is not null but still contains an empty string.

    Do you have any other suggestions for using the FieldIsNull function with fields of a type different than varchar?

    Many thanks again for your help.
    --
    Philippe
  • edited 11:15AM
    In FR 2.54 FILDISNULL - work fine.
    Try something like this:

    if FIELDISNULL('dmOrder.ibdsPO."INSTRUCTIONS"') then
    MasterData1.Visible:=False//if field not null hide band
    else
    MasterData1.Visible:=True;//if field not null show band

    You need the write False (false - is not correct).

    Sorry, My English is bad.
  • edited 11:15AM
    Hi Den,

    Don't worry about your English, I think it's fine and very understandable. If there is anything I cannot understand, I will ask you to clarify, but that did not happen so far.

    In my report, InstructionsBand is visible by default. If 'InstructionsBand := false' does not work, InstructionsBand should remain visible all the time, even when I don't want it to. But my problem is the opposite (i.e. InstructionsBand.Visible is always set to 'false' through the conditional block.

    If FIELDISNULL would return 'false' when the field tested is not null, InstructionsBand would remain visible as it does when I use the substituted workaround.

    Does that make sense or am I overlooking something?
    --
    Philippe
  • edited 11:15AM
    Please give me example(Report),maybe i see what's wrong.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.