NAV2013 Report Date formats

  • NAV2013 Report Date formats

    Posted by DSC Communities on January 31, 2018 at 3:30 pm
    • Samuel Champoux

      Member

      January 31, 2018 at 3:30 PM

      In our invoice, it looks like even if you use the following code, the date format seems based on the current logged-in user’s regional settings, and not on the customer’s settings.

      CurrReport.LANGUAGE := Language.GetLanguageID(“Language Code”);

      Is there a way to have both texts and dates follow the customer’s regional settings?

      ——————————
      Samuel Champoux
      Drummondville QC
      ——————————

    • Ramin Marghi

      Member

      January 31, 2018 at 5:32 PM

      Hey Samuel,

      Yeah, unless explicitly stated otherwise, dates conform to the regional settings. Have you tried setting the Language ID on the User Personalization to the desired date culture, to see if that does the trick for you:

      ——————————
      Ramin Marghi , CPA, CGA
      CPA, CGA | ERP Consultant
      Catapult ERP
      VANCOUVER BC
      ——————————
      ——————————————-

    • Kim Dallefeld

      Member

      January 31, 2018 at 5:39 PM

      The date format is not contingent upon the customer or vendor country code setting.

      ——————————
      Kim Dallefeld
      VP Professional Services
      Syte Consulting Group
      kdallefeld@sytecg.com

      Past NAVUG Board Chairman
      NAVUG Programming Committee
      ——————————
      ——————————————-

    • Naveen Jain

      Member

      January 31, 2018 at 6:07 PM

      I agree with Kim

      ——————————
      Naveen Jain
      Director of IT
      Symbex Companies
      Santa Fe Springs CA
      ——————————
      ——————————————-

    • Val Gameiro

      Member

      February 1, 2018 at 9:58 AM

      There’s no field in NAV for Vendor or Customer language.

      You could do a mod, or simply assign a different user for each country, and change that user’s Windows settings, but then everything else would look wonky to that user.

      A mod to the report with a new language field on the Vendor and Customer cards is probably the best choice.

      [LanguageID :=] GLOBALLANGUAGE([NewLanguageID])

      ——————————
      Val Gameiro
      Senior NAV Analyst
      BPL Plasma Inc.
      Austin, Texas
      NAVUG Austin Chapter Leader
      ——————————
      ——————————————-

    • Samuel Champoux

      Member

      February 1, 2018 at 2:36 PM

      ?That’s unfortunate, this worked great in Dynamics AX šŸ˜‰

      I’ll have the user use a different computer regional setting when printing invoices for other countries.

      ——————————
      Samuel Champoux
      Drummondville QC
      ——————————
      ——————————————-

    • Ian Ray

      Member

      February 1, 2018 at 7:09 PM

      There is another option besides changing the control panel settings for Windows, but it is not as automatic as detecting the customer language code.

      If you edit a report layout in Report Builder or Visual Studio, you can specify a different number format for date. So, for example, you can specify 02/01/18 to appear as 01-Feb-18 or 18/02/01 (but unfortunately not 01/02/18).


      In NAV 2013, you could create a new report in object designer like the original invoice report, modify the layout for the different date format, and then run the report by adding an item for the report in menusuite. This would require selecting the invoice from the report dialog.

      In NAV 2016+, you could do a similar process for creating the report except that you could then use “Document Layouts” on each customer card to specify the report to run. This would make it so that the default report for specific customers is your modified report.

      This is not an ideal solution, but it may be faster than changing windows settings every time.

      ——————————
      Ian Ray
      Cypress Grove
      Arcata CA
      ——————————
      ——————————————-

    • Franz Kalchmair

      Member

      February 1, 2018 at 7:31 PM

      standard nav uses the windows regional settings for date format.

      to use the customers/vendors date format according the language/country can be done by a quite easy customization:

      e.g. rep. 205 sales invoice
      there is a column in the report dataitem for e.g. posting date:Ā 
      FORMAT(“Sales Invoice Header”.”Posting Date”,0,4) // formatted

      when printing that report for a US customer the dates result in (according regional setting, in my case German-Austria):

      so let’s do some simple changes.

      first step:
      create new global var. DateFormat, type Text in report 206.
      change the above column entry to
      FORMAT(“Sales Invoice Header”.”Posting Date”,0,DateFormat) // glob. var.

      also change that for other date columns.

      edit code (F9). goto:

      Sales Invoice Header – OnAfterGetRecord()

      CurrReport.LANGUAGE := Language.GetLanguageID(“Language Code”);
      // add this: start
      case UPPERCASE(“language code”) OF
      Ā  ‘ENU’: DateFormat := ‘<month,2>/<day,2>/<year4>’;
      Ā  ‘ENG’: DateFormat := ‘<day,2>/<month,2>/<year4>’;
      Ā  ‘DEA’,’DEU’: DateFormat := ‘<day,2>.<month,2>.<year4>’;
      Ā  // add what ever you need here
      END;

      // end

      when reprinting the sales invoice report (US customer) it now results in:

      ——————————
      Franz Kalchmair
      Senior Consultant
      Vienna, Austria, Europe
      ——————————
      ——————————————-

    • Samuel Champoux

      Member

      February 2, 2018 at 11:51 AM

      ?Franz, yes I guess that could work, did you use a “d” date format in the report? Or only a string without format?

      There is a field for localization on SSRS reports, thatĀ NAV could be using instead.
      That would make the “d” and “n” formats use that region’s settings without having to hardcode anything.
      I’m not sure what control over the report parameters you have (new to NAV). If this is possible, that would be a better solution, and it is what Dynamics AX did.

      Here’s the field I am talking about:


      ——————————
      Samuel Champoux
      Drummondville QC
      ——————————
      ——————————————-

    • Franz Kalchmair

      Member

      February 3, 2018 at 3:45 PM

      i did not change anything in the layout of the report.

      setting language=user!language is standard in any report layout’s properties and has, what i know, no impact on date formats.

      what do you mean with “d” and “n”?

      don’t think, that there is a simpler solution.

      ——————————
      Franz Kalchmair
      Senior Consultant
      Vienna, Austria, Europe
      ——————————
      ——————————————-

    • Samuel Champoux

      Member

      February 5, 2018 at 8:35 AM

      ?Yes, the field Language on the report has an effect on dates. It’s the locale of the report, and that’s why right now it uses the users’ locale.
      Set it to fr-ca, and you’ll have dates with yyyy-mm-dd format, whatever the locale of the user is.

      The “d” I was referring to is the normal date format, it will use the date format of the report language. If you hardcode a date format, then it won’t use the report’s locale to determine the format.
      From this, I think if I add the customer’s language to a parameter and set it to the language parameter it should work like I want it to.

      ——————————
      Samuel Champoux
      Drummondville QC
      ——————————
      ——————————————-

    DSC Communities replied 7 years, 7 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘NAV2013 Report Date formats’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!