On 03/05/2020 5:03 pm, Santiago A. via lazarus wrote: > I want to write a report where even lines are written with no background > and odd lines with a light gray background.
Have you considered using the newer FPReport (aka fcl-report) included with FPC? There is a report designer for Lazarus too. It is super simple to implement the alternating colors that you required. Take a look at the fcl-report/demos/ directory and look at the "rptexpressions.pas" unit. All you need to do is assign the alternating colors in the DoBeforePrint() event handler. eg: procedure TExpressionsDemo.DoBeforePrint(Sender: TFPReportElement); begin With rpt.Variables.FindVariable('isEven') do AsBoolean:=Not AsBoolean; if rpt.Variables.FindVariable('isEven').AsBoolean then Sender.Frame.BackgroundColor := clLtGray else Sender.Frame.BackgroundColor := clWhite; end; Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp -- _______________________________________________ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus