mibuso.com

Microsoft Business Solutions online community
It is currently Wed Jun 19, 2013 12:23 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: [Solved] Body section wont display correct value in report
PostPosted: Mon May 28, 2012 4:35 pm 
Offline

Joined: Fri Sep 30, 2011 7:04 pm
Posts: 298
Country: Canada (ca)
Hello

I had a quick question. I created a report for a user that allows the user to select Cust ledger entries and they could print a receipt for the selected entries. The user wants to modify the calculation of the Amount field in the report. If the user selects a Document type of “Invoice” and “Credit Memo”, she wants to see the sum of the two amount fields. Currently it shows the value of Amount field if the document type is "Invoice". Lets say the Document type is Invoice and the amount field contains a value of 100. Another line, has a document type of “Credit Memo” and the amount field contains a value of 50. So when the receipt report is printed the final amount field to show $50 (100 - 50).

When I was trying to debugging the code: I put a line of code: Message(‘Value %1’, TotalAmountC) and when i run the report, i get a message prompt which displays the correct answer. However, in the report it doesn’t display the correct answer. Any ideas or suggestions how I can get past this issue. Any help will be greatly appreciated.

TotalAmountI is sume of all the document type which are invoices. TotalAmountIC is the sum of all document type: Credit Memo

The code is written in the OnAfterGetRecord of the dataitem.
Code: Select all

IF ("Cust. Ledger Entry"."Document Type" = "Cust. Ledger Entry"."Document Type"::"Credit Memo") THEN
  BEGIN
//    CurrReport.SHOWOUTPUT(FALSE);
    TotalAmountIC := "Cust. Ledger Entry".Amount + TotalAmountIC;
    MESSAGE('tOTAL IS %1 ', TotalAmountIC);

Total := TotalAmountI + TotalAmountIC;
END;


If I put the label in the footer section of the report, it display the correct value, but when its in the body section it doesnt work. What could I be doing wrong??


Last edited by nverma on Mon May 28, 2012 11:02 pm, edited 1 time in total.

Top
 Profile E-mail  
 
 Post subject: Re: Body section wont display correct value in report
PostPosted: Mon May 28, 2012 6:16 pm 
Offline

Joined: Mon May 18, 2009 6:36 am
Posts: 792
Location: India
Country: India (in)
As you are saying that in footer section you are getting perfact value so i assume you are using custledgerentry therefor until all the records will not come on body section how can you get value(total invoice - total credit memo) in body section. is not this then be clear on.
1. Which dataitem is in your report?
2. What are you printing in body section?

_________________
Vijay Gupta
Changing the code is last step. Try to change processes first...


Top
 Profile E-mail  
 
 Post subject: Re: Body section wont display correct value in report
PostPosted: Mon May 28, 2012 6:20 pm 
Offline

Joined: Fri Sep 30, 2011 7:04 pm
Posts: 298
Country: Canada (ca)
vijay_g wrote:
As you are saying that in footer section you are getting perfact value so i assume you are using custledgerentry therefor until all the records will not come on body section how can you get value(total invoice - total credit memo) in body section. is not this then be clear on.
1. Which dataitem is in your report?
2. What are you printing in body section?


I think that is the reason its not working. Is there a way around this??


Top
 Profile E-mail  
 
 Post subject: Re: Body section wont display correct value in report
PostPosted: Mon May 28, 2012 8:25 pm 
Offline

Joined: Fri Sep 30, 2011 7:04 pm
Posts: 298
Country: Canada (ca)
I was thinking to get rid of the body section and just try to do my calcuations in a footer section. But, no matter what I do footer section only reads one type of document type at a time. However, if i select two different lines, one has a doc type of invoice and the other is of credit memo doc type. It just seems to completely ignore the credit memo line and just displays the invoice line amount. Is it because its in a footer section???I am sorta lost (according to my manager doing it in footer should work). I went on google to try to find information regarding footers but i couldnt find much information on it. Any help will be greatly appreciated.


Top
 Profile E-mail  
 
 Post subject: Re: Body section wont display correct value in report
PostPosted: Mon May 28, 2012 8:37 pm 
Offline

Joined: Fri May 18, 2012 3:04 pm
Posts: 148
Location: Armenia, Quindio
Country: Colombia (co)
Add an Integer data item after the other data items - set the key on Number and a constant of 1. Then display your totals in this section.

_________________
Gerry Kistler
KCP Consultores


Top
 Profile E-mail  
 
 Post subject: Re: Body section wont display correct value in report
PostPosted: Mon May 28, 2012 11:02 pm 
Offline

Joined: Fri Sep 30, 2011 7:04 pm
Posts: 298
Country: Canada (ca)
gerrykistler wrote:
Add an Integer data item after the other data items - set the key on Number and a constant of 1. Then display your totals in this section.


Thanksss!!! It took me a while to get it working but It works now.


Top
 Profile E-mail  
 
 Post subject: Re: Body section wont display correct value in report
PostPosted: Tue May 29, 2012 5:22 pm 
Offline

Joined: Fri Sep 30, 2011 7:04 pm
Posts: 298
Country: Canada (ca)
Just out of curosity. Why did I need to create a new dataitem. I mean whats the logic behind it.


Top
 Profile E-mail  
 
 Post subject: Re: Body section wont display correct value in report
PostPosted: Tue May 29, 2012 6:13 pm 
Offline

Joined: Fri May 18, 2012 3:04 pm
Posts: 148
Location: Armenia, Quindio
Country: Colombia (co)
It is the only way to have a Body section where you want to show totals from the combination of other data items. A Footer section of the last data item normally works as well, but you mentioned this was not giving you the right totals.

_________________
Gerry Kistler
KCP Consultores


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: bbrown and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: