Passing Option Value to Report

Pinkycz
Member Posts: 17
Hi, I wonder if there is a quick way to pass an option values as number to the report.... The thing is, SSRS reports has some show row/cell logic that is trigerred by the option value ie. "Line Type"::Item, this passes value "Item" into the dataset and works ok in English language.
But when user switches language, the option gets passed as the translated (eg. "Artikel") so show/hide logic trips over there.
I could write a short code CASE OF but wonder if there is easier, more elegant way of doing it... pass option values 0,1,2 the logic in report is then language independent...
Any ideas??
But when user switches language, the option gets passed as the translated (eg. "Artikel") so show/hide logic trips over there.
I could write a short code CASE OF but wonder if there is easier, more elegant way of doing it... pass option values 0,1,2 the logic in report is then language independent...
Any ideas??
0
Best Answer
-
Assing (in OnAferGetRecord) the "Line Type" value to some integer var, and add this integer to your Data Items.
A step further would be to use RecordRef/FieldRef and getting an option string text, and add this as a dataitem. It is better imho to have a meaningful text (like 'Item', 'Resource') rather than just 0,1,2,3..
Something like this perhaps:LineTypeInt := "Line Type"; RecordRef.GETTABLE(yourDataItemTable) FieldRef := RecordRef.FIELD("Line Type" field number); LineTypeText = SELECTSTR(LineTypeInt+1, FieldRef.OPTIONSTRING); RecordRef.CLOSE;
and then include the LineTypeText in your data item.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035
Answers
-
Assing (in OnAferGetRecord) the "Line Type" value to some integer var, and add this integer to your Data Items.
A step further would be to use RecordRef/FieldRef and getting an option string text, and add this as a dataitem. It is better imho to have a meaningful text (like 'Item', 'Resource') rather than just 0,1,2,3..
Something like this perhaps:LineTypeInt := "Line Type"; RecordRef.GETTABLE(yourDataItemTable) FieldRef := RecordRef.FIELD("Line Type" field number); LineTypeText = SELECTSTR(LineTypeInt+1, FieldRef.OPTIONSTRING); RecordRef.CLOSE;
and then include the LineTypeText in your data item.Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-035 -
Hi Slawek,
thanks for your sugegstion, never used RecordRef or FieldRef but this should work with 5 lines of code, I had 8 wsuing CAse and passing a language independent value to the dataset for report logic to work. Used integer in my case but agree it is easier with text.
Will try to rework my solution and get more familiar with this approach, Thx!0
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