Hi, i created a report with following DataItems:
DataItem Name
Item Category <Item Category>
---Product Group <Product Group>
Item <Item>
Price Group <Price Group>
---Kleur Toeslag <Kleur Toeslag>
---Bindmiddel Toeslag <Bindmiddel Toeslag>
---Verpakking <Verpakking>
Now the Problem is that this report is now Printing every record from the "Kleur Toeslag", "Bindmiddel Toeslag" & "Verpakking"
But this isnt the desired functionality. I need to print only the
"Kleur Toeslag", "Bindmiddel Toeslag" & "Verpakking"
if there are items under the "Product Group" who uses one of this records.
This is how i try to solve this:
Report - OnInitReport()
CLEAR(gv_KleurToeslag);
CLEAR(gv_BindmiddelToeslag);
CLEAR(gv_VerpakkingToeslag);
"Kleur Toeslag".CLEARMARKS;
"Bindmiddel Toeslag".CLEARMARKS;
Verpakking.CLEARMARKS;
Then in the Item onAfterGetRecord:
I place marks if the "Kleur Toeslag" or the "Bindmiddel Toeslag" or the "Packing Type" has been filled in.
Item - OnAfterGetRecord()
// Check of er een Kleurtoeslag aan het Artikel hangt:
IF "Kleur Toeslag" <> '' THEN BEGIN
IF gv_KleurToeslag.GET("Kleur Toeslag") THEN
gv_KleurToeslag.MARK(TRUE);
END;
// Check of er een Bindmiddeltoeslag aan het Artikel hangt:
IF "Bindmiddel Toeslag" <> '' THEN BEGIN
IF gv_BindmiddelToeslag.GET("Bindmiddel Toeslag") THEN
gv_BindmiddelToeslag.MARK(TRUE);
END;
// Check of er een Verpakkingtoeslag aan het Artikel hangt:
IF "Packing Type" <> '' THEN BEGIN
IF gv_VerpakkingToeslag.GET("Packing Type") THEN
gv_VerpakkingToeslag.MARK(TRUE);
END;
Then i copy this mark filter to my DataItems:
Kleur Toeslag - OnPreDataItem()
"Kleur Toeslag".COPYFILTERS(gv_KleurToeslag);
"Kleur Toeslag".MARKEDONLY(TRUE);
But now it isnt printing any record? Before i added the mark coding it was printing all records from the table "Kleur Toeslag"
Now it isnt printing any record anymore?
Does the COPYFILTERS dont copy the marks?
Answers
Mark dataitem records, do not create variable
DataItems:
DataItem Name
Item Category <Item Category>
---Product Group <Product Group>
Item <Item>
Price Group <Price Group>
---Kleur Toeslag KleurToeslag
---Bindmiddel Toeslag BindmiddelToeslag
---Verpakking <Verpakking>
Here is how i mark the DataItems:
Set the Marked filter for one dataitem:
When i follow with the debugger, i see that some records are getting marked... So it looks like it that when
i reach the DataItems, that the marks have disappeared ?
Why don't you indent the 3 dataitems and link them to the Item?
Hope this helps
Albert
I have to show all the "Kleur Toeslag" & "Bindmiddel Toeslag" & "Verpakking" at the end of each Item Category...
But i can only show the Records from these DataItems which are used by an Item inside the Item Category Code
Guess there will be no other choice then using a Temp Table or unless someone can tell me why the mark functionallity is not working
You MARK is not working because you probably have the property set to link to the Product Group dataitem, you should use an integer dataitem.
Could you give more info on what field you are trying to show at the end of the Product Group from these dataitem.
If you are just counting the records then the easiest would be to use a CREATETOTALS in the OnPreDataitem of the Product Group and the Item dataitems.
Albert
record.
Got it working like it should now.
Thanks for the info