Sorting a report using Variable in a codeunit
asembereng
Member Posts: 220
How can i possible sort a report using a variable in my codeunit. The report is suppose to display arrears and also the number of months not paid.. I want the report to be sorted by number of months not pay.
Thank you..
Thank you..
0
Comments
-
create a new table with 2 fieds: "number of months not pay","document no."
PK of the table: "number of months not pay","document no."
declare this table as temporary in your report, and when you calculate the no. of months, fill the table with this number and the document no.
after that, use the table to get the document nos ordered by "number of months not pay" and show your info in an integer dataitem
hope it's clear
0 -
Pretty confusing.. Explain further..
Thanks[/quote][/code]0 -
[/code][/quote]asembereng wrote:Pretty confusing.. Explain further..
Thanks
yes, you're right...i am pretty occupied...create a new table with 2 fieds: "number of months not pay","document no."
PK of the table: "number of months not pay","document no."
i think this one is clear...declare this table as temporary in your report, and when you calculate the no. of months, fill the table with this number and the document no.
in your rpt, declare a rec variable (temporary = yes) that point to the new table you have just created.
fill this table: field "number of months not pay" becomes the number of months you want to use to order the report.
"document no." becomes the actual document number you're processing.
after filling the table, you have to add a new dataitem(Integer table) and use it to loop into the temporary table: you read the first record e.g.:
field1=1 field2=INV08001
you do a GET on the table you need in your report (e.g. posted sales invoice) using the 'INV08001' and then show all the data you want.
for more info about showing a temporary table in a report, try to search the forum!
0 -
Check the top customers list or top items list reports for an example on how to do that.0
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
- 327 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