How to export a csv with fixed column widths ?

149 views
Skip to first unread message

Nicolas Micoud

unread,
Nov 12, 2015, 7:48:10 AM11/12/15
to iDempiere
Hi,

I've created a report with iReport that exports accounting data for importing them into another software.
The file must be exported as a flat file with fixed column width.

For instance :
 - from column 1 to 6, i put the date in DDMMYY format
 - from column 7 to 8, i put the description
[...]

I've created a new report/process with the jrxml file in attachment.
When the report is shown, i can select csv and a file is downloaded, but with comma separator.

The file is ok when exported from iReport.
And i can't find a way to do the same within iDempiere.

Is it possible or is it a missing piece ?

Thanks,

Nicolas

Carlos Antonio Ruiz Gomez

unread,
Nov 12, 2015, 10:31:41 AM11/12/15
to idem...@googlegroups.com
Hi Nicolas, I don't know if iReport supports fixed column.

I had a similar need some time ago and what I did was to create a view
with my required output column formatted.

Regards,

Carlos Ruiz

Nicolas Micoud

unread,
Nov 12, 2015, 10:56:25 AM11/12/15
to iDempiere
Hi Carlos,

What I tried to do is using RPAD functions and concatenate all columns in a single jasper fields (something like $F{CODE_JOURNAL} + $F{DATEACCT} + "  " + $F{NUM_COMPTE} + $F{INVOICENO} + $F{DESCRIPTION} ...)

You said you create a view, but how do you export the data in a file.
Does the view was displayed in a report and then the report is exported (using csv/ssv/txt) ?

Thanks,

Nicolas

Carlos Antonio Ruiz Gomez

unread,
Nov 12, 2015, 11:05:15 AM11/12/15
to idem...@googlegroups.com
Ah, sorry, reviewed that old program - what I did was a view plus a process - trying to export will surround it with quotes

Regards,

Carlos Ruiz

Nicolas Micoud

unread,
Nov 12, 2015, 11:10:16 AM11/12/15
to iDempiere
And the process was writing the file, right ?

Carlos Antonio Ruiz Gomez

unread,
Nov 12, 2015, 11:23:14 AM11/12/15
to idem...@googlegroups.com
Yes

Nicolas Micoud

unread,
Nov 12, 2015, 12:09:19 PM11/12/15
to iDempiere
ok thanks
Reply all
Reply to author
Forward
0 new messages