CRLF in DetailData.OnAfterPrint event handler

MrWDMrWD Calgary AB, Canada
edited 10:50AM in FastReport 4.0
Hi

I need to have the option of adding an extra linefeed based on a conditional analysis. This must be done in the DetailData band and would be over and above the linefeed already issued. I was hoping the Engine object would have this functionality much the same as the New Page function. I am assuming this would be done in the DetailData.OnAfterPrint event handler. Any suggestions would be appreciated.

Thanks
Wayne

Comments

  • MrWDMrWD Calgary AB, Canada
    edited August 2010
    It seems the solution was rather simple. It was just a matter of incrementing the Engine.CurY value by whatever amount of pixels you need. For example a line of text using a font size of 8 would be 15 so Engine.CurY := Engine.CurY +15. If this is put in the OnAfterPrint event handler it will drop the cursor down by 15 units prior to printing the next row of text. In my particular case I have a boolean field in the data record that is set to true if I need to insert a blank line so I just evaluate that field:

    if <PList."BlankLine"> = True then Engine.CurY := Engine.CurY +15;

    I just need to work on automating the incremental value by determining the font height.
    I also have a boolean data field that I use to determine whether a new page is required after this row of data is printed.

    if <PList."NewPage"> = True then Engine.NewPage();


    Hope this is helpful to someone.

    Cheers
    Wayne

Leave a Comment