Trying to keep it simple - I know I can pre-program report but I am trying to just use the Xojo Report tool as is. Using sql to create RowSet and then calling the Report Method (rpt.Run(rs,ps). I want to check a column data to see if empty and make the label invisible when displaying that record but can’t find a way to reference the RowSet - ‘rs’ - in the ‘before printing’ event of a label. Have tried a lot of code but nothing seems to work. Is this even possible? Sorry if this is easy - I haven’t worked in Xojo a lot . . .
When the BeforePrinting event fires, your data will already be populated in the report fields. So you can check the field being populated by the column to see if its empty rather than referencing the RowSet.
That’s how you can do things like generating barcodes from the contents of one field and showing them in a ReportPicture.
Sub BeforePrinting() Handles BeforePrinting
me.BackColor = RGB(255,255,255)
me.Image = App.GenerateBarcode(SampleIDField.Text,1,100)
End Sub
Tried that but kept getting compile errors trying to reference the field data. Thought that was the logical way but must be doing something wrong in my statement. Trying something like:
sNote = fNote.datafield ‘where fNote is the field name
Anything like that gets compile error . .
You need to reference the .Text property of the field to get the value.
Duh!! Thank you - that sure works . . guess I was over thinking the issue because it was a report and forgetting basics!!
All good. Happy to help ![]()
Welcome to the forum!