Hi all,
I have a requirement to export data to excel. This is all fine.
But the problem is it should of fixed lenght excel lines and if the respective data from Ax is less than the intended length it should be padded with spaces to reach the length.
Can anyone help on this.
I am able to create a field with all spaces and export to excel. But coudld'nt get this padding of spaces work.
Thanks
*This post is locked for comments
In this scenario, it can not be a excel import.
you need to create a fixed width text file
so you sould consider AsciiIO class for this purpose
and for each column you need to check and see it the field is having space and Zeros padded
Please find more details about AsciiIo class in following link
msdn.microsoft.com/.../asciiio.aspx
please verify and let us know with your findings
Hi All,
Thanks for your responses.
I am exporting the data from AX to import into another system for data integration.
To import this into the other application the excel need to satisfy the below criteria -
"Each line in the interface file has a fixed length of 307 characters. Any fields not populated or not using all allocated characters must be padded with spaces (if defined as character fields) or zeroes (if defined as numeric). "
So each column is already allocated fixed space. If the data from Ax falls short of this I need to get this padded with spaces.
I am using SysExcelApplication to create the output excel file.
Thanks
What is the purpose of this requirement
are you looking to manage the width of excel cell this padding of spaces?
if yes then its not possible this way...
for this purpose while exporting values to excel cell, you need to set the width of the excel cell
Please verify and update us with more details.
Hi
What do you use for create the XLS file?
COM Classes?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156