How to hide fields in report
Navi_Learner
Member Posts: 356
I created a report on the sales invoice line table and some other tables. If I want to retrieve the item and its related price fieds, all the data(including the freight and set up and others and its related cost) are displayed in the report. My question is how to hide the fields I don't need.
0
Comments
-
Are these fields you want visible sometimes & others not depending on a scenario?
Are these just extra fields you don't need? -.You can just delete them.
Are these fields you don't need but don't want to get rid of "just in case"?
you can change the fields proporties to Visible:No0 -
Thanks, Harry! It's not what I meant. For example we have the following fields, Item, Cost, and Quantity and the data are as follows:
Item Cost Quantity
Pen 5.00 100
Imprinting30.00 90
Shipping 12.00 1
How to hide imprinting and shipping and its related data and generate the report like
Item Cost Quanity
Pen 5.00 100
I tried to code with If condition, but it doesn't work. Thanks!0 -
In the "OnPreSection()"-trigger of the section you don't want to print, you have to put
CurrReport.SHOWOUTPUT(condition that returns TRUE or FALSE); //TRUE to show it and FALSE to hide it
or
In the "OnPreSection()"-trigger of the section you don't want to print, you have to putIF [I don't want to see it-condition] THEN CurrReport.SHOWOUTPUT(FALSE);
or
If you don't want to process the record at all (with previous examples, you process the report and you are able to show other sections of that record [mostly used to select between different layouts for a record (see Salesinvoice => printing the lines)])
In the "OnAfterGetRecord()"-trigger:IF [I don't want to see it-condition] THEN CurrReport.SKIP;
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thanks! Actually I know it, but when I use if conditions several times, it just hides one, but the rest of them are still displayed.0
-
Thanks, it works now. I have another question. I have another field total value, but it retrieves all the price, and I just want the total price of not hiding part, but the report still display all the amount including the shipping and imprinting. Thanks in advance! 0 -
I suppose you use the CREATETOTALS-command or the "TotalFields"-property.Navi Learner wrote:
Thanks, it works now. I have another question. I have another field total value, but it retrieves all the price, and I just want the total price of not hiding part, but the report still display all the amount including the shipping and imprinting. Thanks in advance!
It is better to create a global for it. You have to total it manually in the "OnAfterGetRecord"-trigger. But do it AFTER the SKIP-statement (if you used this one [this would be the best way to skip records]).
Or if you put code in the "OnPreSection"-trigger, you have to subtract the value in case it shouldn't be shown. This because you added it in the "OnAfterGetRecord"-trigger. This is not really a nice programming style. In this case I would put a comment in the "OnAfterGetRecord"-trigger, saying the value will be subtracted in an "OnPreSection"-trigger in case the record has not to be shown.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thanks!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
- 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