Applying a FILTER to second Data Item on Report
erugalatha
Member Posts: 120
Hi,
I have a report that shows Items and Item Variants First data item is Item table and the second indented is Item Variant table. The Item Variant data item is not visible when I run the report as I have set a DataItemTableView set.
The filters on the Item data item include the Item Variant so how do I (in code) apply that filter to the second data item?
Thanks for your help.
I have a report that shows Items and Item Variants First data item is Item table and the second indented is Item Variant table. The Item Variant data item is not visible when I run the report as I have set a DataItemTableView set.
The filters on the Item data item include the Item Variant so how do I (in code) apply that filter to the second data item?
Thanks for your help.
0
Comments
-
on triger onprereport put the following code
Item.COPYFILTER("item Variant","Item Variant".COde):0 -
you might as well set the dataitemlink property of the item variant dataitem as "Code=FIELD(Variant Filter)"Regards,
GD0 -
Hi,
I am using Copyfilter. I have set a report to pull from dataitems:Sales Header Sales Line Sales Invoice Header Sales Invoice Line
In the Sales Invoice line I have this code:"Sales Line".COPYFILTER(Type,"Sales Invoice Line".Type); "Sales Line".COPYFILTER("No.","Sales Invoice Line"."No."); "Sales Line".COPYFILTER(Quantity,"Sales Invoice Line".Quantity); "Sales Line".COPYFILTER("Line Amount","Sales Invoice Line"."Line Amount");
Everything works great until the filters are choosen from the Sales Line and there are no existing records in the Sales Line. Then the filters are not carried to the Sales Invoice Line. They do not get picked up in the Sales Invoice Line until a record is found in the Sales Lines with those filters. So the first part of the report is wrong and then it suddenly looks perfect.
Does anyone have a suggestion to how I can fix this?
Dneal0 -
Maybe you should try a different nesting of the Dataitems:
Sales Header Sales Invoice Header Sales Line Sales Invoice Line
:-kMarcelo Borges
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com0 -
Hmm, I'm not sure how that changes things. Could you please explain?
I was hoping I wouldn't have to redo the dataitem or sections of he report.0 -
Dneal
In order to suggest you an easy way to change these dataitems, I'd like to know what is the purpose of this report so that we can think of an ideal organization of the DItems.
Marcelo Borges
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com0 -
Hi Marcelo,Maybe you should try a different nesting of the Dataitems:
Code:
Sales Header
Sales Invoice Header
Sales Line
Sales Invoice Line
What I meant by how does this change things, was I don't understand how changing the dataitems will change the copyfilter function in an empty record. I just wanted an explanation on how changing the dataitems will affect the copyfilters function.
Sorry for the confusion.
Dneal0 -
Is there a way to force/trick the dataitem into thinking it found a record when it didn't? I know this is out there, but I'm at a loss.0
-
My idea of change the dataitems order, is that you would have only sales invoice line if you found sales line.
But after writing the post, I was wondering what you were really trying to do with these two tables.
I'm not so sure if my advice will work for you, depending on what you want to do.
:-kMarcelo Borges
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com0 -
Hi again,
The report is for a customer who would like to see item statistics based on a customer. They would like to see the orders(sales header and sales line) and also historical data(sales invoice header and sales invoice line). Since the filters they are using exist in both sets of dataitems I am using a copyfilter in the sales invoice header and sales invoice line. The customer does not want to have 4 tabs in the request form and have to repeat the filters. This is why it is being done this way. I have the following data items:Customer Sales Header Sales Line Sales Invoice Header Sales Invoice Line
Unfortunatley, changing the order of the dataitems wouldn't give me the data I require.
I'm still trying to find a way to make it copy the filters even if it doesn't find a record. It seems rather silly that this is how a Navision function works. ](*,)0 -
You can always check if the filkters are blank and not apply them. Im pretty sure that will make you see the problem, cause i think your doing this wrong. Oh and btw Navision's own filters are not in filtergroup 0 on reports!It seems rather silly that this is how a Navision function works.
Not sure what you mean.0 -
Oh and btw Navision's own filters are not in filtergroup 0 on reports!
What are you talking about?0 -
Found what I needed! For anyone who runs into a similiar issue here is a link:
http://www.mibuso.com/forum/viewtopic.php?p=70019#70019
Thanks for all the input.
Dneal0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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

