Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

WebUtil and Microsoft Excel: Setting cell border properties

624699Nov 4 2008 — edited Apr 28 2009
I'm using the CLIENT_OLE2 package shipped with WebUtil to create a Microsoft Excel spreadsheet from an Oracle 10g Form and, so far, have managed to:

- Create multiple worksheets
- Populate cells with values and formulae
- Format cells, including setting font name and size, setting bold italic and underline attributes

The final requirement is to set a border on a cell or group of cells, but this is where I'm stumped. My code thus far looks like this:
DECLARE

  l_application   CLIENT_OLE2.OBJ_TYPE ;

  l_workbooks     CLIENT_OLE2.OBJ_TYPE ; 
  
  l_workbook      CLIENT_OLE2.OBJ_TYPE ;
  
  l_worksheets    CLIENT_OLE2.OBJ_TYPE ;

  l_worksheet     CLIENT_OLE2.OBJ_TYPE ;
  
  l_cell          CLIENT_OLE2.LIST_TYPE ;

  l_borders       CLIENT_OLE2.OBJ_TYPE ;
    
BEGIN    

  l_application := CLIENT_OLE2.CREATE_OBJ('Excel.Application') ;

  l_workbooks := CLIENT_OLE2.GET_OBJ_PROPERTY(l_application,'Workbooks') ;

  l_workbook := CLIENT_OLE2.GET_OBJ_PROPERTY(l_workbooks,'Add') ;

  l_worksheets := CLIENT_OLE2.GET_OBJ_PROPERTY(l_workbook,'Worksheets') ; 

  l_arguments := CLIENT_OLE2.CREATE_ARGLIST ; 

  CLIENT_OLE2.ADD_ARG(l_arguments,'Sheet1') ; 

  l_worksheet := CLIENT_OLE2.GET_OBJ_PROPERTY(l_workbook,'Worksheets',l_arguments) ;
  
  CLIENT_OLE2.DESTROY_ARGLIST(l_arguments) ;

--
--  Select cell A1
--    

  l_arguments := CLIENT_OLE2.CREATE_ARGLIST ;

  CLIENT_OLE2.ADD_ARG(l_arguments,1) ;

  CLIENT_OLE2.ADD_ARG(l_arguments,1) ;

  l_cell := CLIENT_OLE2.GET_OBJ_PROPERTY(l_worksheet,'Cells',l_arguments) ;

  CLIENT_OLE2.DESTROY_ARGLIST(l_arguments) ;

  l_borders := CLIENT_OLE2.GET_OBJ_PROPERTY(p_cells,'Borders') ;

--
--  What happens next...?
--

--
--  Clean up
--

  CLIENT_OLE2.RELEASE_OBJ(l_borders) ;

  CLIENT_OLE2.RELEASE_OBJ(l_worksheet) ;

  CLIENT_OLE2.RELEASE_OBJ(l_worksheets) ;

  CLIENT_OLE2.RELEASE_OBJ(l_workbook) ;

  CLIENT_OLE2.RELEASE_OBJ(l_workbooks) ;
        
  CLIENT_OLE2.RELEASE_OBJ(l_application) ;

END ;
I'd be obliged for a pointer in the right direction!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2009
Added on Nov 4 2008
2 comments
1,326 views