Skip to main content
Answer

Using @YearStart and @YearEnd in Report Designer as a FROM and TO date without using any date fields

  • October 21, 2024
  • 5 replies
  • 216 views

Forum|alt.badge.img+1

We are designing a new form where by we need to have a FROM: and a TO: using the first of the current year and the last of current year for the period. We would like to use @YearStart, and @YearEnd but are not quite sure where and how to code it in the Report Designer, or if parameters need to be stated first in the Schema. Most, if not all, of our reports have a date already associated with the type of report needed, but in this case, none of that is present. The initial form will be a “blanket” form just to get started. My code in the groupHeaderSection1: I have one text box: [=’FROM:’ + [@DateFrom]], another text box: [=’TO:’ + [@DateTo]]. but these are not showing up on the report in preview at all. My Parameter Schema has DateFrom as Name, Data Type Date Time, Prompt: Start Date, Default Value @YearStart, Visible, Required, and the DateTo has its’ appropriate parameters set up also basically the same way.

Best answer by Laura03

Hi,

I performed additional tests for you, to hide and then to remove the printed Now() date in the corner of this Acumatica report. My test report still prints year beginning and year end dates,

  1. When Now() date is hidden and
  2. When is completely removed from the report, and
  3. It prints in any section of the report.

My test was performed in version 2024 R1 Build 24.112.0026 .

Last, I started a completely blank report:  with No Tables/DACs in the report, date calculations shown above do not work. My “Only Year End Date” report printed nothing.

As soon as I add one table, even if I don’t display any fields from the table, my date works (I selected Company):

 

Laura

5 replies

Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • October 21, 2024

What I meant by “without using any date fields” is that there are no date fields to pull any data from. We would just like to use a period with @YearStart, and @YearEnd.


Laura03
Captain II
Forum|alt.badge.img+19
  • Captain II
  • October 22, 2024

Hello,

I have an idea that may work for you.  I noticed Acumatica displays today’s date on many reports using the Now() formula.

I tried using Now() inside another formula to “Hard-Code” the first and last day of the current year onto a report:

These formulas worked for me, to display the first & last dates of the current year on my report.  I don’t think you need to print today’s date Now() on the report, for the new calculated dates to work.

Laura


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • October 22, 2024

Hello,

I used a textbox, the formula is =’01/01/’+Year(Now()), nothing. My box shows up because i’ve drawn lines around it, but the date does not. I’ve even tried using just =Year(Now()) and the textbox is still blank.

 


Laura03
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • October 22, 2024

Hi,

I performed additional tests for you, to hide and then to remove the printed Now() date in the corner of this Acumatica report. My test report still prints year beginning and year end dates,

  1. When Now() date is hidden and
  2. When is completely removed from the report, and
  3. It prints in any section of the report.

My test was performed in version 2024 R1 Build 24.112.0026 .

Last, I started a completely blank report:  with No Tables/DACs in the report, date calculations shown above do not work. My “Only Year End Date” report printed nothing.

As soon as I add one table, even if I don’t display any fields from the table, my date works (I selected Company):

 

Laura


Forum|alt.badge.img+1
  • Author
  • Semi-Pro I
  • October 22, 2024

Who would have thought? It works on mine also. Sheesh. This one is for the books. I appreciate the help on this one. There is no way I would have thought of that. Very enlightening and I hope that this will help someone else.