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);
    CheckDateText := FORMAT("Posting Date",0,4);
Modified -
  IF "Cheque Date" <> 0D THEN
    CheckDateText := FORMAT("Cheque Date",0,'<Day,2><Month,2><Year4>')
    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.

Saurav Dhyani


Popular posts from this blog

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.

NAV 2013 Upgrade Part III - Data Upgrading.

Hi all, As per agenda we need to discuss the data upgrade in NAV 2013. The process is similar to what used to be till NAV 2009 R2 but with some changes. Let's start the process. Remember -  1) You can only upgrade a database to NAV 2013 from NAV 2009 SP1 / R2 SQL Only. 2) The Synchronization of users with SQL Server is no more required.