You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

How to generate excel file using File layout out bound.

3 replies [Last post]
sandeep05's picture
User offline. Last seen 12 years 13 weeks ago. Offline
Joined: 09/23/2008
Posts: 2

How to generate excel file using File layout out bound.
Out bound means reading the data from the record and pushing the dat into desired excel format.

Any help is appriciated.

Lepa's picture
User offline. Last seen 2 years 20 weeks ago. Offline
Joined: 06/23/2008
Posts: 591
Re: How to generate excel file using File layout out bound.

Hi sandeep05,
You can't generate an Excel file using file layout. Did you mean csv file instead? I know the file layout has the excel option but it is really not excel, it is csv.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

sandeep05's picture
User offline. Last seen 12 years 13 weeks ago. Offline
Joined: 09/23/2008
Posts: 2
Re: How to generate excel file using File layout out bound.

Hello Lepa,

You are right , it is CSV format only.
My concern is , how to print the header and footer in the CSV format.
Any sample example is appriciated.
I think need to write peoplecode to generate the header and footer in the CSV format.
Question is how to write the peoplecode??.

Thanks for your suggestion.

Lepa's picture
User offline. Last seen 2 years 20 weeks ago. Offline
Joined: 06/23/2008
Posts: 591
Re: How to generate excel file using File layout out bound.

>> My concern is , how to print the header and footer in the CSV format.

Am assuming then that you know how to grab data from the Database and write it to the file using file layout. If so, then have you tried something like this?

While &SQL.Fetch(&RecLine)
           /*write my header before the 1st row*/
 &MYFILE.WriteLine("This is my header line");
            &rowCount = &rowCount + 1;
            &MYFILE.WriteRecord(&RecLine);
End-While;
/*write my footer after all records(rows) has been written to the file*/
 &MYFILE.WriteLine("This is my footer line");

Good luck!

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog