This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
I'm currently facing an issue with exporting data to Microsoft Excel. When I use the option to send a list to MS-Excel, it downloads the file as a .CSV with a single line and semicolon separators. However, I need the list to be downloaded in the .XLS format with well-defined rows and columns.
Can anyone guide me on how to export a list directly to an .XLSX file instead of .CSV? Any advice or guidance would be greatly appreciated.
You have to check the list separator defined in your Windows Regional Settings.
By example, if you want to open CSV files produced by VLF-One one a French OS you need to change the list separator proposed by default.
£uSystem.DefaultCSVSeparator := £MyCSVseparator /*Séparateur de colonnes */
Replace the MyCSVSeparator with the value you have in your regional settings.
Typically, you can add this line in a method routine in your Custom Manager component.
Then you can open CSV files with MS Excel with data well formated.
Yes, I'm already opening .CSV files, but the problem is with the format of the data. I changed the list separator from ';' to ','. However, the display of the data remains the same. Is there a way to download SQL filtered list data into an Excel .XLSX file?
Another point, please, how can I modify DF_T68H4O and run it from VLF after changing its name, since we know that the prefixes DF_ and UF_ need to be changed ?
In French, the decimal separator is a coma so you cannot not use a coma as list separator. It is why in your regional settings the defautl value for List separator is a semicolon (;). So, if you use in VLF-ONE the MS Excel export feature you need to replace the default CSV separator by a semicolon.
You just need to add a line of code £USYSTEM.DefaultCSVSeparator := ';' in your own version of UF_OSYSTM reusable part.
* Initialization
Mthroutine Name(uInitialize) Options(*REDEFINE)
* Do any ancestor logic
£COM_ANCESTOR.uInitialize
* Do custom logic
£MaximumOpenFilterandHandlerPanes := 10
£MaxiumQuickSearchSize := 200
£SharedMessageSetinTabletMode := True /* Use a single shared message set in tablet mode */
£USYSTEM.DefaultCSVSeparator := ';' /* List separator CSV pour MS Excel en Français */
* Only allow a restart button on small or medium size devices
£AVFRAMEWORKMANAGER.avShowRestartButton := (£AVFRAMEWORKMANAGER.avLargeScreen.Not)
Endroutine
Then automatically the generated CSV file will be open like an Excel Spreedsheet. No need to use code to do a conversion CSV => XLS or LANSA Integrator service to do that, it is nativly proposed by VLF-ONE !