How can I print different bands depending on the value of a Field in a DataSet using FastReport?

StackOverflow https://stackoverflow.com/questions/333780

  •  22-07-2019
  •  | 
  •  

Question

I have a product's dataset and I want to have distinct bands for each type of product, something like, if the product is a fruit, print it's weight, if the product is a car print its color and so on.

And I want to let my users customize it, so each band for each type o product will be perfect.

My DataSet have all fields from all type of products and I have a field which determines the product type of the actual record.

Is there some easy to way to do it?

Was it helpful?

Solution

FastReports allows you to intercept the program's default report construction process with events at several useful places. If you have, for example a master band, in its OnBeforePrint event, you can put code that checks out the type of product and then a case statement could set the visible property to true only on detail bands that are the right kind of property.

I have found the news group at news://newsgroups.fast-report.com/fast-reports.public.fastreport.4 to be an incredible source of help and encouragement. I am sure you can find a much better answer to your question there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top