Skip to main content
Solved

How to change format of date displayed on report header


I am very new to Acumatica, I have inherited a lot of reports in which I want to update the formatting. One thing I’m stuck on is how the coding works on formatting the date. I changed the formula to this (see below). It currently reads as: 

I want to change the format to include a “/” or a “-” inbetween the month and Year. Another thing I want to do is to just have the last 2 digits of the year if possible so it can look like this “08-22” or at least be able to read as “08-2022”. Any help is greatly appreciated.

 

 

Best answer by taranjitgill

@BenjaminCrisman 

I was able to write this out to get what I wanted:

='Period: ' +  Report.FormatPeriod(@StartPeriod) + ' to ' + Report.FormatPeriod(@EndPeriod)

 

 

I wanted the dates to be in this format, and was able to figure out that removing the “Format(‘{0: MM/yyyy})” was causing the bunching of the month and year together. Hope this helps and this is what I was aiming for. I added in the “Report.FormatPeriod” which I honestly do not know what it does LOL, but I was it on another report I inherited and plugged it in and saw that it was able to get the format to show the date as “MM-YYYY”.
 

 

View original
Did this topic help you find an answer to your question?

BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 728 replies
  • August 30, 2022

Hi @taranjitgill! You can make the “Period:” it’s own text box and so that the expression is just the formula.

For the formula there are probably several ways to accomplish this but the first thing that comes to mind is to do something like =Iif(Month(Now())<10, '0'+Month(Now()), Month(Now()))+'-'+Right(Year(Now()), 2).

The result looks like this:

 


Thank for your reply @BenjaminCrisman, it seems like you are coding it to pull in the exact date of “08-22”, sorry I did not clarify I am running a report that uses a Start and End Period for the date parameters, and I want the “Period: ___” to include the 2 periods used within the parameters used to run the report data. Is it possible to have a dash in between the month and years on the Format used in my formula? 

For example if I ran a YTD report, I’d want it to say “01-2022 to 08-2022” utilizing both “@StartPeriod” and “@EndPeriod”.


  • Author
  • Freshman II
  • 6 replies
  • Answer
  • September 1, 2022

@BenjaminCrisman 

I was able to write this out to get what I wanted:

='Period: ' +  Report.FormatPeriod(@StartPeriod) + ' to ' + Report.FormatPeriod(@EndPeriod)

 

 

I wanted the dates to be in this format, and was able to figure out that removing the “Format(‘{0: MM/yyyy})” was causing the bunching of the month and year together. Hope this helps and this is what I was aiming for. I added in the “Report.FormatPeriod” which I honestly do not know what it does LOL, but I was it on another report I inherited and plugged it in and saw that it was able to get the format to show the date as “MM-YYYY”.
 

 


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 728 replies
  • September 1, 2022

@taranjitgill nice work! Yeah I missed the mark a little bit with the first suggestion and I hadn’t had time to follow up yet, but glad to see it was worked out.

I hadn’t seen the Report.FormatPeriod used like this, typically I see it in a parameter or something, but great work!


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • September 1, 2022

Thank you for sharing your solution with the community @taranjitgill !


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings