Formatting Excel File Using Ole2 In Oracle Forms
Posted ORACLE EBS
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Formatting Excel File Using Ole2 In Oracle Forms相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章