码迷,mamicode.com
首页 > 数据库 > 详细

Formatting Excel File Using Ole2 In Oracle Forms

时间:2016-12-25 18:27:08      阅读:764      评论:0      收藏:0      [点我收藏+]

标签:lan   ase   mesi   ace   rac   forms   import   分享   change   

Below is the some useful commands of Ole2 to format excel file in Oracle Forms.

-- Change font size and name in ole2
-- Declare as cfont ole2.obj_type;
CFONT := OLE2.GET_OBJ_PROPERTY(CELL, ‘Font‘);
OLE2.SET_PROPERTY(CFONT, ‘Name‘,‘Calibri‘);       
OLE2.SET_PROPERTY(CFONT, ‘Bold‘,1);  
OLE2.SET_PROPERTY(CFONT, ‘Size‘,11);
ole2.release_obj(CFONT);
--
-- Changing number format with ole2 
OLE2.SET_PROPERTY(cell, ‘NumberFormat‘, ‘00,0,0,000.00‘);
--
-- Changing background color in ole2
-- Declare colour ole2.obj_type;
colour:=ole2.get_obj_property(cell, ‘Interior‘);
ole2.set_property(colour, ‘ColorIndex‘, 33);
-- Border color
colour:=ole2.get_obj_property(cell, ‘Borders‘);
ole2.set_property(colour, ‘ColorIndex‘, 1);
--

技术分享
  
-- Wrapping text in ole2
args:=OLE2.CREATE_ARGLIST; 
OLE2.ADD_ARG(args, 2);
OLE2.ADD_ARG(args, 1);
cell:=OLE2.GET_OBJ_PROPERTY(worksheet, ‘Cells‘, args);
ole2.set_property(cell, ‘WrapText‘, ‘True‘);
OLE2.DESTROY_ARGLIST(args);
--
-- Autofit columns in ole2
range := OLE2.GET_OBJ_PROPERTY( worksheet,‘UsedRange‘);
range_col := OLE2.GET_OBJ_PROPERTY( range,‘Columns‘);
OLE2.INVOKE( range_col,‘AutoFit‘ );
OLE2.RELEASE_OBJ( range );
OLE2.RELEASE_OBJ( range_col );
--
-- Saving a excel file in ole2
args := OLE2.Create_Arglist; 
filen := ‘c:\myfile.xls‘;
OLE2.ADD_ARG(args,filen); 
OLE2.INVOKE(workbook, ‘SaveAs‘, args); 
OLE2.DESTROY_ARGLIST(args);
--
See also: Create Excel File in Oracle Forms 
http://foxinfotech.blogspot.com/2013/02/creating-excel-file-in-oracle-d2k-forms.html

Formatting Excel File Using Ole2 In Oracle Forms

标签:lan   ase   mesi   ace   rac   forms   import   分享   change   

原文地址:http://www.cnblogs.com/quanweiru/p/6219931.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!