ACS AEM Common Report Builder: Add report column with value of "NOW" | Community
Skip to main content
ShaggySPFLD
Level 2
September 29, 2023
Solved

ACS AEM Common Report Builder: Add report column with value of "NOW"

  • September 29, 2023
  • 1 reply
  • 1762 views

Anyone know how to add a column to the output of a ACS AEM Commons Report where the value of the output column is based off the current date, not off the returned data.  The reason why i need this is I'm using the report excel output as input to a SQL database and I plan on running this report monthly and want to be able to distinguish between runs so adding a "Report Date" field to the output would be the easiest way.  I know i could add it during the ingest, but it would take more work then just adding it to the default output from AEM.

 

I tried adding a "Report Date Column" with:

Heading: Report Date

Property: now()

Date Format: dd-MM-yyyy

 

But that just resulted in an empty column.  I also tried another suggestion of "Property = currentPage/jcr:createDate" with the same result.  Any help would be greatly appreciated

Best answer by Saravanan_Dharmaraj

@shaggyspfld It looks like you need to write the custom code to extend the report column functionality.

please check this documentation for adding new column(Creating a Report Column)

https://adobe-consulting-services.github.io/acs-aem-commons/features/report-builder/extending.html 

 

Example given in code: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/6e88e55789ed72cd8433f7482343812f85a35cf1/ui.apps/src/main/content/jcr_root/apps/acs-commons/components/utilities/report-builder/columns/containing-page/results.jsp

 

in the result.jsp, you can print the current date and it should be shown in column.

 

1 reply

Saravanan_Dharmaraj
Community Advisor
Saravanan_DharmarajCommunity AdvisorAccepted solution
Community Advisor
October 2, 2023

@shaggyspfld It looks like you need to write the custom code to extend the report column functionality.

please check this documentation for adding new column(Creating a Report Column)

https://adobe-consulting-services.github.io/acs-aem-commons/features/report-builder/extending.html 

 

Example given in code: https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/6e88e55789ed72cd8433f7482343812f85a35cf1/ui.apps/src/main/content/jcr_root/apps/acs-commons/components/utilities/report-builder/columns/containing-page/results.jsp

 

in the result.jsp, you can print the current date and it should be shown in column.

 

shikhasoni1
Level 3
March 19, 2025

Hi  @saravanan_dharmaraj 

 

How can I add this custom field to the csv as well. Could you please guide. I am not able to see this in the downloaded csv.