Create code inside fastreport

edited 9:15AM in FastReport 4.0
Hi

How to create code for change band with


Where I will write my code.


ex:

If variable = '' then
fxreport1.masterband.with :=2
else
fxreport1.masterband.with :=4;


Thank you


Mario



Comments

  • gpigpi
    edited 9:15AM
    wrote:
    Where I will write my code
    Use TfrxMasterData.OnBeforePrint event
    If <variable> = '' then
    MasterData1.Height := 2 * fr1cm
    else
    MasterData1.Height := 4 * fr1cm;
    
  • edited 9:15AM
    gpi wrote: »
    gpi wrote: »
    Where I will write my code
    Use TfrxMasterData.OnBeforePrint event
    If <variable> = '' then
    MasterData1.Height := 2 * fr1cm
    else
    MasterData1.Height := 4 * fr1cm;
    

    Thank you

    I don't understand why I'm not open events in MasterData1 I have just access to proprieties then events isn't accessible.


    Mario






  • edited 9:15AM
    Mario9a wrote: »
    Mario9a wrote: »
    Mario9a wrote: »
    Where I will write my code
    Use TfrxMasterData.OnBeforePrint event
    If <variable> = '' then
    MasterData1.Height := 2 * fr1cm
    else
    MasterData1.Height := 4 * fr1cm;
    

    Thank you

    I don't understand why I'm not open events in MasterData1 I have just access to proprieties then events isn't accessible.


    Mario


    Hi

    It is possible may be I have a FastReport 4 Basic Edition only the standard edition is-it better

    Just info..


    Mario
  • gpigpi
    edited 9:15AM
    FR Basic doesn't supports scripts
  • edited 9:15AM
    gpi wrote: »
    FR Basic doesn't supports scripts

    Thank you M.Gpi

    I will upgrade for standard edition



    Thank again


    Mario
  • edited 9:15AM
    Mario9a wrote: »
    Mario9a wrote: »
    FR Basic doesn't supports scripts

    Thank you M.Gpi

    I will upgrade for standard edition



    Thank again


    Mario

    Hi

    I upgrade my fastreport for Standard

    my problem is I will like to change a height of Groupfooter I have a probleme with my syntax

    My question is

    If variable< 1 then
    band.height := 2
    else
    band.height : =4;


    my code ise :

    procedure GroupFooter1OnBeforePrint(Sender: TfrxComponent);
    begin
    if <frxDBDataset1."FRAISGEST"> < 1 then
    GroupFooter1.height := 4.2 ;


    end;

    begin

    end.
  • edited 9:15AM
    What does it do? Give and error or does it just not work?
    What is 4.2's unit, centimeters, inches?
    What is the value supposed to be when if <frxDBDataset1."FRAISGEST"> <= 0?
  • edited 9:15AM
    technisoft wrote: »
    What does it do? Give and error or does it just not work?
    What is 4.2's unit, centimeters, inches?
    What is the value supposed to be when if <frxDBDataset1."FRAISGEST"> <= 0?

    Thank you tecnisoft


    My code was OK but my height to small

    I replace height with value 185 and my band.height is perfect.


    I use version 4.12 standard

    Where I check unit inside fastreport

    Thank again


    Mario
  • gpigpi
    edited 9:15AM
    wrote:
    My code was OK but my height to small
    You should use fr1cm constant to convert cm to pixels:
    procedure GroupFooter1OnBeforePrint(Sender: TfrxComponent);
    begin
    if <frxDBDataset1."FRAISGEST"> < 1 then
    GroupFooter1.height := 4.2 * fr1cm;
    
    
    end;;
    

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.