Hi,
I am very new to Dynamics NAV development and need some help with a report I am trying to build. I have been asked to build a report that will show the Booking Details of Customers.
For these report i am taking sales Header and sales Lines Tables, against these two tables i should able to retrieve 16 columns,out of these i can able to show 14 columns(these are the columns which are coming directly from the above two tables) but remaining two columns(margin and margin%).
For the above margin column,what i did is ,i had designed a separate textbox with label name as MG in the section designer(this is Classic report) in report designing.
for the abv MG column,the data should come 4 columns from the remaining 14 columns. calculation is like
(unitprice-unit cost+line amount+special price ).
I tried in textbox propert,source expression of Mg, but i am not unable to retrive the solution.
whether i should write any C/Al code for the abv data in report.
Plz…plzz help me
You need to understand How margin are getting calculated
and then you can put that formula and get the desired result
If values are coming from selected data items in report and then you can select those columns in source expression of text box by putting arithmetic calculation .
If Not then you need to write CAL code and store value in variable and put that variable on source expression of text box.
Hi,
I tried to place in source expression but it is not taking more than one column…
i need to get margin from the 4 columns(unit cost-unit price+inv amount+spcl price)
i think i should write c/al code…
plz its better to explain me by gvng example…
thanq…
You asked the same question in another thread.
In textbox source expression, manually write your fields for eg:
salesline.amount+salesline.“unit cost”-salesline.“Discount”.
By this way, you can enter multiple fields in sourceExp. and this will work.
Hi i got the solution, now its working fine.i am able to retrieve data through source expression property.Tanq…
Hi,
I am at end of my report deign,and i need ur help for the last column,i have used below code in the following Sales Lines-on AfterGetRecord
IF “GM$” <> 0 THEN
GM := ROUND(“GM$”/“Unit Price”)*100
ELSE
GM := 0;
And error is here for the last margin% column all fields are coming as zeros,i think i gone some were wrong,thinking need to add extra c/al code for the above code .
plz help me…
Sorry,i will be more clear full for my issue…so that u can help me…
For margin(MG$) there are only some fields are zeros and For the same GM should be zero as per the code,it is fine
but all MG column fields are showing zeros…this was the my issue…plz correct me boss
hope soon for the solution …Tanq
In another thread you got the answer.
Answer was, you are using wrong code :
IF “GM$” <> 0 THEN
GM := ROUND(“GM$”/“Unit Price”)*100
ELSE
GM := 0;
It should be
IF “Unit Price” <> 0 THEN
GM := ROUND(“GM$”/“Unit Price”)*100
ELSE
GM := 0;