The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Friday 8 March 2013

Creating excel file from PeopleSoft


Recently I have seen a piece of code over internet which is intended to create excel file from peoplesoft in a much easier way. I thought it is worth sharing it over here.



2 comments:

  1. Do you have an example of how to write data to the cells? I have the following but want to see if there's a more effcient way.
    Also, where can I find more information on formating?

    &Rec = CreateRecord(Record.MYWRK);
    &I = 15;
    &SQL_Line = GetSQL(SQL.OUTSQL);
    While &SQL_Line.Fetch(&Rec)
    &oWorkSheet.Cells(&I, 3).Value = &Rec.DATE_STR.Value;
    &oWorkSheet.Cells(&I, 4).Value = &Rec.TRANS_ID.Value;
    &oWorkSheet.Cells(&I, 5).Value = &Rec.AMT_STR.Value;
    ...
    &I = &I + 1;
    End-While;

    ReplyDelete
    Replies
    1. Dorothea,

      I think this is the simplest method of writing data to the cells. Are you looking for a method whereby the entire data of record to be copied to the cells with single statement? If that is the case then you need to create your own framework for it and use it. As of my best knowledge there is no framework delivered by Oracle to handle office applications.

      Regarding formatting the cells, you can do all the formats that you do with the excel in peoplecode. You can refer msdn library to get the properties or methods available for this COM object. The examples quoted in the Microsoft site may be another language; but yes you can use the properties and methods. Refer the below site as a start.

      http://msdn.microsoft.com/en-us/library/office/ff834673.aspx

      Delete

Note: only a member of this blog may post a comment.

Followers