How to make a field invisible in a report

DarkHorse
Member Posts: 389
Hello, I think this is easy. I know it can be done in properties, but how to make a specific field invisible in a report by code?.
Thanks.
Thanks.
0
Comments
-
You can't.
There are 2 ways:
1) define different sections for the different fields to show.
2) In the OnAfterGetRecord-trigger, put the field in a global and show the global on the form. If the field must NOT be shown, you can blank the global.
I would go for 2. It is easier to maintain.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
No direct way.... just way around...
You can use more sections with making visible the correct section...
You can use variable to show the value and if you do not want to show it, just clear the variable...0 -
Thanks both for reply; but i need to do it on the same line, for example, if I has a report that shows in body section a relation of customers with an import like this:
Customer.Field Import.Field
Customer1 1.000
Customer2 2.000
Customer3 4.000
I should put a condition that said IF Customer.Field:='Customer2" THEN Import.Field:= invisible. Then it shows like this:
Customer.Field Import.Field
Customer1 1.000
Customer2
Customer3 4.000
¿It's possible to do it?.
Thanks.0 -
Both ways I wrote about can be used...
just think about it like
IF Customer.Field:='Customer2" THEN
Show empty variable
else
Show my value
OR
IF Customer.Field:='Customer2" THEN
Show section without the field
else
Show section with the field0 -
Ok, but what is the code for "Show empty variable", please?0
-
if my condition then
MyVariable := MyValue
else
MyVariable := '';0 -
Ok, thank you very much for help; i'll try it.
Thanks.0 -
Sorry, one thing, my varibale is a decimal one, the MyVariable := '' doesn't works, it says me that the type is different, how I can do it?0
-
DarkHorse wrote:Sorry, one thing, my varibale is a decimal one, the MyVariable := '' doesn't works, it says me that the type is different, how I can do it?
That your variable is decimal is irrelevant. Your display variable will be text, but you assign into it empty string or decimal converted to text (FORMAT).0 -
Ok, thanks again for help.
Thank you.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