It's simple, but I'm sooo new!

demi222
Member Posts: 131
In the order report I want a counter. When I print the report, I want it to add a column where it shows 1 and then the rest of the info,
2 and then the rest of the info...etc.
for example... in CRONOS the order report shows the following:
.................................................................... What I want is
No....Description...Quantity...Unit of Measure........ Number
1908.....printer .............1..............box ............................... 1
1906......ink...................5..............box................................ 2
1907......cable................3 .............box.................................3
I know its a counter I'm supposed to make. I'm new at programming as well as navision... please help me.
I start by declaring a variable Counts as an integer.
in C/AL I write:
Count:=0;
then something...
Count := Count +1;
2 and then the rest of the info...etc.
for example... in CRONOS the order report shows the following:
.................................................................... What I want is
No....Description...Quantity...Unit of Measure........ Number
1908.....printer .............1..............box ............................... 1
1906......ink...................5..............box................................ 2
1907......cable................3 .............box.................................3
I know its a counter I'm supposed to make. I'm new at programming as well as navision... please help me.
I start by declaring a variable Counts as an integer.
in C/AL I write:
Count:=0;
then something...
Count := Count +1;
0
Comments
-
Hi,
- Declare an global int variable name i.e. Counter.
- On the OnPreDataItem place a line:Counter := 0;
- On the OnAfterGetRecord place a line:Counter := Counter + 1;
- Place a Text Box on the corresponding detail section that has a SourceExpr=Counter
That is the main concept...0 -
Thank you!
I'll definitely not ask this again...that was easy!0 -
Why is this not working for me today?
I am trying to do the same thing, for the same report.
On pre data item of the purchase header I put the code:
Counters := 0;
On after get record of the purchase header I put the code:
Counters := Counters + 1;
for the source expression of my text box that I have added on my report I have it set to Counters
I have declared Counters as a global variable of typ integer.
have I forgotten something?0 -
:?
OnAfterGetRecord of the "purchase Header" or "Purchase Line"??
Shouldn't you display and calculate under the "Purchase Line"?0 -
I tried that and it still didn't work.
I have done all the combinations....
on pre data item of purchase header Counters := 0;
on after get record of purchase line Counters := Counters + 1;
on pre data item of purchase header Counters := Counters + 1;
on after get record of purchase line Counters := 0;
on after get record of purchase header Counters := 0;
on pre data item of purchase line Counters := Counters +1;
on after get record of purchase header Counters := Counters + 1;
on pre data item of purchase line Counters := 0;
Don't know what else to do...0 -
If it is the report 405 then you could just place a textbox in the RoundLoop Body (4) that has a sourceExpr to Number. nothing else... This is report specific and the Purchase Line data item executes a CurrReportBreak, that means that it is not displayed. The items are shown with the RoundLoop data item. So if you don't want to use the "Number" value in the SourceExpr, then you could:
* Create a global Counters of type Integer.
* you must enter code to:
RoundLoop - OnPreDataItem
Counters := 0;
* you must enter code to:
RoundLoop - OnAfterGetRecord
Counters := Counters+1;
* On the Section RoundLoop Body (4) place on the start of it a textbox with SourceExpr to Counters;
(The "Number" is a field of the "integer" virtual table.)
If it is not the 405 report then on what report are you making your customizations, so I could replicate the problem...
:roll:0 -
Thank you, it worked.
The way I was thinking about it was wrong. I wasn't using the data item where the information was displayed (for example the Roundloop data item)
I was thinking of where the data is coming from (Purchase line and header).
I appreciate your help.
Thank you0 -
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