Skip to main content

Navision - How to Format Dates for Cheque Reports?

Hi all,

This is nothing most of you would be interested in. This post only show steps about how to Format Cheque Date specific to Actual Cheque.

If you don't know this, then please go ahead.

The intended readers for this post are the Peoples who have recently joined and are still Learning NAV. Based on Request received via Contact Form..


So in Cheque Report we have date like 22/10/2014 i.e DD/MM/YYYY which may not what Customer is looking for in actual cheque. Customer Normally look for format as per country regulation. In India current Cheque Date format is as shown below -


How we can change that in Navision Report 1401 ?

Design the Report 1401 you will see something like shown below -


Go to the Code of Second Data Item i.e GenJnlLine and on Trigger onAfterGetRecord you need to search for CheckDateText.

This is the text constant that is used to display Date in Cheque Reports.

So how can i change that to my desired format?

I will create three global variables as listed below -

CheckDateText1 - Data Type (Text) - Length (30)
ChrB                    - Data Type (Text) - Length (1)
Chr1                     - Data Type (Text) - Length (1)  & Dimension (8)

Now I will change code as below -

Standard -
-------------------------------------------------------------------------
  IF "Cheque Date" <> 0D THEN
    CheckDateText := FORMAT("Cheque Date",0,4);
ELSE
    CheckDateText := FORMAT("Posting Date",0,4);
-------------------------------------------------------------------------
Modified -
-------------------------------------------------------------------------
  IF "Cheque Date" <> 0D THEN
    CheckDateText := FORMAT("Cheque Date",0,'<Day,2><Month,2><Year4>')
  ELSE
    CheckDateText := FORMAT("Posting Date",0,'<Day,2><Month,2><Year4>')

  Chr1[1] := FORMAT(CheckDateText[1]);
  Chr1[2] := FORMAT(CheckDateText[2]);
  Chr1[3] := FORMAT(CheckDateText[3]);
  Chr1[4] := FORMAT(CheckDateText[4]);
  Chr1[5] := FORMAT(CheckDateText[5]);
  Chr1[6] := FORMAT(CheckDateText[6]);
  Chr1[7] := FORMAT(CheckDateText[7]);
  Chr1[8] := FORMAT(CheckDateText[8]);
  ChrB := ' ';

 CheckDateText1 := Chr1[1] + ChrB + Chr1[2] + ChrB + Chr1[3] +  ChrB + Chr1[4] + ChrB + Chr1[5] + ChrB + Chr1[6] +  ChrB+ Chr1[7] + ChrB + Chr1[8];
-------------------------------------------------------------------------

I will replace the source expression of Cheque Date From CheckDateText to CheckDateText1.

What Exactly the Code DO?

1. The Code First Convert the Date as Format (DDMMYYYY).

2. Put Each part of the Text i.e Date into a text constant of Length 1 (8 Dimension for 8 Values).

3. ChrB is used to put Spaces in the Middle of Date Parts. (NEED TO BE CHANGED AS PER CHEQUE)

The No. of occurrence of ChrB changes as per cheque that you want to print.

I hope you find the post useful and let me know the feedback of such basic Navision post on the Contact form or as a comment to post.

Stay tuned for More.

Regards,
Saurav Dhyani
www.sauravdhyani.com

Comments

Popular posts from this blog

Welcome - Microsoft Dynamics 365!

Hi All, In this article we will discuss the new introduced member of Dynamics Family. Yes you heard it correctly, one more new member with Name "Microsoft Dynamics 365" . #ProjectMadeira   #Dynamics365

Send Mail with Attachment From Navision.

Hi all, We have seen how to save a report into PDF and how to send mail to a customer. Let's link these two post in one i.e. Mailing statement to a customer into PDF Format. This article is part of the Series. Please Refer  Table of Content here . If you have the old objects set let me brief you what I will be changing - 

NAV 2013 Credential Type - How to Use?

Hi all, Please do these activities when you have time, its a long activity and i would suggest do all activities in one go. So be clam and lets start. For NAV 2013 R2 Refer Here. For NAV 2016 Steps have been Reduced Please Refer Here. I have installed NAV 2013 and its work great with my windows credentials. I was checking the service console (Microsoft Dynamics NAV Administration) in NAV 2013 and found out that Credentials Type have multiple Options.