Count in Navision Reports

Hi,

I am trying to build a report against for each customer and number of invoices using sections.so i want to use count function to get total number of invoices against for each customer.Can anybody help me where to use this count function and how to use it?

Thanks in Advance…

Supposed you have a dataitem on Customer table, you can insert this code in OnAfterGetRecord trigger:

SalesInvHeader.RESET;

SalesInvHeader.SETRANGE(“Sell-to Customer No.”,“No.”);

InvoiceCount := SalesInvHeader.COUNT;

Hi,

I guess there is a field No. of Invoices in customer table just display it :

OnAfterGetRecord trigger:

CALCFIELDS(“No. of Invoices”);

it does the same thing as :

alesInvHeader.RESET;

SalesInvHeader.SETRANGE(“Sell-to Customer No.”,“No.”);

InvoiceCount := SalesInvHeader.COUNT;

Yes, you are right, but the field is “No. of Pstd. Invoices”, since “No. of Invoices” count the number of temporary invoices.

Hi,

I have not seen no of invoice or no of Pst invoice field in customer table…

I am using navision 2009… actually i want to use only salesinvoiceheader and salesinvoiceline from here i want to pull the data by using count function base on sell-to Customerno

Hi Ali,

I have tried what u have given code is working fine… but it is counting total no of invoices in file…

Hi Venkatesh,

If you want to count no. of posted invoices only, the above method using No. of Pstd. Invoices is OK. Field no. in customer table is 7178. Just check it.

You are right [:P]

Fieldi is 7178

Hi Bheem Singh

Thank you giving me information… i have seen that field name.

Now actually i want to use count to no of invoices to that customer and sum of those invoices.

i got sum of invoice by keeping using group but no of invoices is not coming… can u help in this regard.

How you got sum of invoices ?

If you got sum of invoices, you can use the same concept for the no. of invoices.

Regards

Bheem

Hi All

I want to use “Count” function to count no of invoices for each salesperson and sum of those invoices.

i got sum of invoice by keeping using group but no of invoices is not coming… can u help in this regard.

reagards

venkatesh