FastReport
FastReport copied to clipboard
Problem with DataBand with several columns
Hi! I'm trying to do some logic on my DataBand BeforePrint event. I have a band with several columns.
Data1.Columns.Layout = ColumnLayout.DownThenAcross;
Data1.Columns.Count = 3;
This is an event handler code
private void Data1_BeforePrint(object sender, EventArgs e)
{
string manufacturer = (string)Report.GetColumnValue("report_data.manufacturer");
if (string.IsNullOrEmpty(manufacturer))
Text6.Text = "-";
}
If I have different values on "report_data.manufacturer", for example, null and "Some Company", I see the same values on my Text1.Text, it's "-". But I have to see "-" for the first and "Some Company" for the second. Report.GetColumnValue() method works with cache and maybe this is why I have a problem with it. Please, tell me what I need to do for correctly printing.
Hi,
I recommend you to use NullValue property of TextObject to achive that. You just have to type "-" into NullValue.
Best Regards, Oleg.