How to format date bound to Custom Xml Part

j2associates
Member Posts: 7
We are using Word document layouts for customer facing Business Central 365 (SaaS) reports. When binding a date to a Text Content Control, how do you format said date?
0
Answers
-
What I have found so far is that it appears you have to do a Report Extension for a different date format. If you look at Report 1322 Purchase - Order you will see that all of the Date columns are defined as Format(DateField, 0, 4) which displays the full month names (e.g. September 15, 2019). This forces you to either have very wide date fields to accommodate long month names or have a lot of word wrap.
I created a Report Extension for Report 1322 Purchase - Order with the following definitions:
add("Purchase Line")
{
column(PlannedReceiptDate_Date; "Planned Receipt Date") { }
column(PlannedReceiptDate_Formatted; Format("Planned Receipt Date", 0, '<Month,2>/<Day,2>/<Year4>')) { }
}
Using the Report Extension, I tried the following in a Word document layout:
1. Added PlannedReceiptDate_Date to a detail line using a Date Picker Content Control
a. The SaaS report generator ignores any formatting applied to the Content Control
b. I had it formatted as MM/dd/yyyy and it displayed with that format but also displayed the time as midnight
2. Added PlannedReceiptDate_Formatted to a detail line using a Plain Text Content Control
a. This displayed as expected and desired
It seems absurd to have to write a Report Extension to get a different date format, but perhaps that will change in the (near) future. Prior to Report Extensions, you had to create an entire report just to add one custom field to an existing report.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions