How to indent a data item of a dataport?

How to indent a data item in a dataport?

not possible but why do you need this?

I would like to export the bank ledger entry in a special format.

can you be more clear on special format?

As of now it is not possible to indent dataitems in dataports…

Actually this format is reffered by the bank to make payment against our client’s vendor. They required the payment details in their own format. If any record exists, then first line will be the bank ledger details and next two lines will be recipients details(vendor contact person emails, etc). Next three lines will be any narration or special comments which is to be passed to the vendors. It is to be printed in a CSV format. Most of the fields are hard coded. I have given here an example for one transaction.

IFH,IFILE,CSV,ABC34884001,INHBAPGIN11223344,HSBC_PVT200705100001,2007/05/10,17:56:12,A,1.0,39**- File Header**
BATHDR,LTR,1,HSBC_PVT200705100000,@1ST@,20070510,071123456001,INR,100.00,IN,HBAP,INR,CLIENT INTEGRATION TEAM BGE,IAT-1**- Batch header**
SECPTY,071123456006,BENEFICIARY NAME,100.00,20070710,Y,N,@HVP@,IAT-1,INR,SWF,HSBCINBB,IN,IAT-1,IAT TESTING CHARGES,OUR**-ledger entry**
ADV,R,2,1,ebssupport.bgepcm,F,Y,1,ebssupport.bgepcm@hsbc.co.in,IN-recipient1
ADV,,R,,,,,2,2,beneficiaryname,,,,,,,F,Y,1,beneficiaryname@benename.com,IN-recipient2
ADV-FREETXT,1,Dear EB SUPPORT BGE-txt/comments
ADV-TBLTXT,6,15,L,ADVCOL HEADER-1,15,L,ADVCOL HEADER-2,15,L,ADVCOL HEADER-3,15,L,ADVCOL HEADER-4,15,L,ADVCOL HEADER-5,15,L,ADVCOL HEADER-6-txt/comments
ADV-TBLBDY,ADVDETAIL COL-1,15,ADVDETAIL COL-2,15,ADVDETAIL COL-3,15,ADVDETAIL COL-4,15,ADVDETAIL COL-5,15,ADVDETAIL COL-6,15txt/comments

Why dont you write a report and export the details as you wish?

How can I export the data in CSV format by using a report?

Try

OnPreDataItem()

IF NOT FILE.EXISTS(‘C:\Test\abc.csv’) THEN
FILE.ERASE(‘C:\Test\abc.csv’);

fileExport.CREATE(‘C:\Test\abc.csv’);
fileExport.TEXTMODE := TRUE;
fileExport.WRITEMODE := TRUE;

OnAfterGetRecord()
fileExport.WRITE(STRSUBSTNO(’%1;%2;%3;%4;…",
);

OnPostDataItem()
fileExport.CLOSE;

Hi Mohana,

What is the datatype/Subtype of fileExport?

Datatype FILE

Thank you Mohana. Its working fine.

welcome

Hi Mohana,

I need one more clarification from you regarding this issue. How to create a new row in this CSV file?. I have given some value in First dataitem- OnAfterGetRecord(). This is printing properly. And the values given in second dataitem(indented to 1st)- OnAfterGetRecord() is not printing.

Mohana,

Sorry, I found my mistake and corrected. One more issue is that if the no. of fields is more than 16 it gives the error “Reduce the expression so it is less complex”.

Is there any no. of fields restriction?

Are you passing more than 16 fields to a function?

If yes, may be a restriction…

check http://www.mibuso.com/forum/viewtopic.php?f=23&t=12549

Yes. You are absolutely right. I have used two separate functions and now its working fine.

Thank You.

hai,mohana how to create new row (csv file) by using file.write();

Thanks in advance

http://mibuso.com/blogs/mohana/2011/09/11/how-to-create-a-text-file-and-writeappend-text-into-the-file/

Hi

How to create new row in the csv file

What part of Mohana’s explanation in the link are you having trouble with?

http://mibuso.com/blogs/mohana/2011/09/11/how-to-create-a-text-file-and-writeappend-text-into-the-file/