jueves, 17 de mayo de 2018

Leading Zeros when exporting Grid to Excel

Working in a client an issue was reported when downloading a PeopleSoft grid to an Excel spreadsheet.

There is a page where the following grid is shown.
In the specific grid, the EMPLID field may have a 0 at the beginning.
Then, a user tries to download this grid to Excel, by clicking the following button (notice private date was hidden just in case).



As a result, the Excel spreadsheet is built and shown as you could see below



So this is the issue, the 0 character dissapeared although the EMPLID field is a Char field.

In order to solve this issue we can change an Applicaiton Server configuration called FormatIntsInCharFldsForDownloadToExcel


When setting this value to 0, the Character columns are still treated like that even though they contain numbers.

So I'm  going to set this value to 0:



After this step Application Server must be bounced, in order to take this change into account.

Once it's up again, I enter the same page and download the same information:



Now the 0 appears at the EMPLID column.




And that's all.

I hope this blog could be so useful to you as it is to me.

Regards.
Facundo Salerno.