Use Marked Only In a Report
tompynation
Member Posts: 398
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:
Then in the Item onAfterGetRecord:
I place marks if the "Kleur Toeslag" or the "Bindmiddel Toeslag" or the "Packing Type" has been filled in.
Then i copy this mark filter to my DataItems:
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?
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?
0
Answers
-
Mark is not a filter, it is a temporary value for record, so this function will not copy marks.
Mark dataitem records, do not create variable0 -
Allright, i marked the dataitem now... but the report is still not showing the marked ones. It show none of them now
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:Item - OnAfterGetRecord() IF Item."Price Group" = '' THEN CurrReport.SKIP ELSE BEGIN // Check of er een Kleurtoeslag aan het Artikel hangt: IF Item."Kleur Toeslag" <> '' THEN BEGIN IF KleurToeslag.GET(Item."Kleur Toeslag") THEN KleurToeslag.MARK(TRUE); END; // Check of er een Bindmiddeltoeslag aan het Artikel hangt: IF Item."Bindmiddel Toeslag" <> '' THEN BEGIN IF BindmiddelToeslag.GET("Bindmiddel Toeslag") THEN BindmiddelToeslag.MARK(TRUE); END; // Check of er een Verpakkingtoeslag aan het Artikel hangt: IF Item."Packing Type" <> '' THEN BEGIN IF Verpakking.GET(Item."Packing Type") THEN Verpakking.MARK(TRUE); END; END;
Set the Marked filter for one dataitem:KleurToeslag - OnPreDataItem() KleurToeslag.MARKEDONLY(TRUE);
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 ?0 -
Hi
Why don't you indent the 3 dataitems and link them to the Item?DataItem Name Item Category <Item Category> ---Product Group <Product Group> ------Item <Item> ------Price Group <Price Group> --------Kleur Toeslag KleurToeslag (DataItemLink Reference-Item DataItemLink - No.=FIELD(Kleur Toeslag) --------Bindmiddel Toeslag BindmiddelToeslag --------Verpakking <Verpakking>
Hope this helps
Albert0 -
because they are not linked to the Item, but to the Item Category
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 Code0 -
Actually i will recomend you do not use mark, because this filtering is VERY slow and takes 100% of processor. Better way (if it is possible) is to use temporary table. In that case you can insert your table record in your table temporary table and then use Integer dataitem to print.0
-
but the mark functionallity is totally not working...
Guess there will be no other choice then using a Temp Table or unless someone can tell me why the mark functionallity is not working0 -
Hi,
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.
Albert0 -
Allright... I decided to forget the mark functionallity and solved it by using a tempory
record.
Got it working like it should now.
Thanks for the info0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 324 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions