How to Show Dimension Names in Report?

jeniez
Member Posts: 25
Hi,
I added a dimension field to a report, but it only shows the Dimension Code in that field. How do I change it to show the Dimension Name instead?
I'm very new to the technical part of Navision, so please give me step-by-step instructions. Thank you.
I added a dimension field to a report, but it only shows the Dimension Code in that field. How do I change it to show the Dimension Name instead?
I'm very new to the technical part of Navision, so please give me step-by-step instructions. Thank you.
0
Comments
-
Hi
You will have to define 2 variables of DataType Record
Dimension subtype Dimension
DimValue subtype Dimension Value
In the OnAfterGetRecord function you would have to add code
eg
DimName := '';
DimValName := '';
IF Dimension.GET("Global Dimension 1 Code") THEN
DimName := Dimension.Name;
IF DimValue.GET("Global Dimension 1 Code","Global Dimension 2 Code") THEN
DimValName := DimValue.Name;
I am assuming that DimName and DimValName are declared as Text variables and that you have put them into the Body Section of your report.
Cheers
Albert0 -
Thank you for your reply but I'm still having some trouble. If I set the 2 variables as text, then I can't choose the subtype column. Should I set the variables as record instead. And when I used your code, and tried to run it, it said "You have specified an unknown variable- Dimension - Define the variable under 'Global C/AL symbols".
As for your code, I just copied and paste it. Should I change some part or add something in the quotation?
Sorry, I've never had any training on codes or on this part of Navision, so I have no clues on what to do. Thanks again for your helps.0 -
Hi
I have written a little report which shows only dimension 1 and 2 code namesOBJECT Report 50116 TestReport { OBJECT-PROPERTIES { Date=01/06/05; Time=13:34:47; Modified=Yes; Version List=; } PROPERTIES { } DATAITEMS { { PROPERTIES { DataItemTable=Table36; DataItemTableView=SORTING(Document Type,No.) WHERE(Document Type=FILTER(Invoice)); OnPreDataItem=BEGIN GLSetup.GET; END; OnAfterGetRecord=BEGIN DimName := ''; DimValName := ''; IF DimValue.GET(GLSetup."Shortcut Dimension 1 Code","Shortcut Dimension 1 Code") THEN DimName := DimValue.Name; IF DimValue.GET(GLSetup."Shortcut Dimension 2 Code","Shortcut Dimension 2 Code") THEN DimValName := DimValue.Name; END; } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=12000; SectionHeight=846; } CONTROLS { { 1000000000;TextBox;150 ;0 ;1500 ;423 ;SourceExpr="Shortcut Dimension 1 Code" } { 1000000002;TextBox;6562 ;0 ;1500 ;423 ;SourceExpr="Shortcut Dimension 2 Code" } { 1000000004;TextBox;1746 ;0 ;4780 ;423 ;SourceExpr=DimName } { 1000000005;TextBox;8202 ;0 ;3775 ;423 ;SourceExpr=DimValName } } } } } } REQUESTFORM { PROPERTIES { Width=9020; Height=3410; } CONTROLS { } } CODE { VAR GLSetup@1000000004 : Record 98; DimValue@1000000001 : Record 349; DimName@1000000002 : Text[80]; DimValName@1000000003 : Text[80]; BEGIN END. } }
I made the assumption that you only use 2 dimensions. If you use more then you will have to use the Document Dimension, Posted Document Dimension or Ledger Entry Dimension tables.
You can copy and paste the above into a text file and import into Navision, be sure that you don't have a report with ID 50116
Hope this helps
Albert0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K 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
- 320 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