How to deal with DataCount=0?
Posted: Thu Aug 16, 2012 1:46 pm
Hi all,
In one of my reports, I would like to show as many labels as the number contained in the field "number".
For example, if for row 1 "number" contains 2, 2 labels are printed.
For row 2, "number" contains 0, no labels are printed.
For row 3, "number" contains 5, 5 labels are printed.
It works very well with 2 DataBands (one master DB + one with mastercomponent= the first one) and this BeforePrint event:
But I have a problem when 2 successive rows have 0 in "number". The first one is ok (no label), but DataCount for the second one is set to 1 because of the code in the event.
How can I do?
Thank you.
In one of my reports, I would like to show as many labels as the number contained in the field "number".
For example, if for row 1 "number" contains 2, 2 labels are printed.
For row 2, "number" contains 0, no labels are printed.
For row 3, "number" contains 5, 5 labels are printed.
It works very well with 2 DataBands (one master DB + one with mastercomponent= the first one) and this BeforePrint event:
Code: Select all
if (plantation.nb_of_fruits==0)
{
DataBand2.CountData=0;
plantation.Next();
DataBand2.CountData=1;
}
else
{DataBand2.CountData=plantation.nb_of_fruits;}
How can I do?
Thank you.