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

时间: 2024-10-12 16:13:21

Formatting Excel File Using Ole2 In Oracle Forms的相关文章

Creating Excel File in Oracle Forms

Below is the example to create an excel file in Oracle Forms. Pass the Sql query string to the below procedure to generate an Excel file using Ole2 package. PROCEDURE Create_Excel_File (CSQL Varchar2)Is   source_cursor    Integer;   l_colCnt        

Freebie - Utility Form: Generate Excel Report From SQL Query In Oracle Forms 6i And 11g

Sharing a form to generate Excel file report from SQL query in Oracle Forms. This form can be used in Oracle Forms 6i and 10g / 11g. Below is the screen shot of this form and could be download from the following link: Excel_Rep.Fmb A procedure Create

Writing Text File From A Tabular Block In Oracle Forms

The example given below for writing text file or CSV using Text_IO package from a tabular block in Oracle Forms. Suppose there is a tabular grid data block "Job_History" in your forms and you want to write a CSV on click of a button by reading w

Giving Data Backup Option in Oracle Forms 6i

Suppose you want to give the data backup option in Oracle Forms application to some client users, where you have installed Oracle 11g client or direct from server. The following procedure executes a batch file placed in current working directory of t

csharp:OpenXml SDK 2.0 and ClosedXML read excel file

https://openxmlexporttoexcel.codeplex.com/ 引用: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using DocumentForma

Oracle Forms 10g Tutorial Ebook Download - Oracle Forms Blog

A step by step tutorial for Oracle Forms 10g development. This guide is helpful for freshers in Oracle forms 10g. To download this ebook click the below button: Download Oracle Forms 10g eBook See Also: Oracle Forms Recipes - Get it from Google Playh

Create Hierarchical Tree To Control Records In Oracle Forms

Download Source Code Providing an example form for creating hierarchical trees in Oracle Forms to control data block records. In this form whenever user selects any node in tree menu then corresponding record is displayed at right side. This form is

Define Custom Data Filter Using Pre-Query Trigger In Oracle Forms

Oracle Forms is having its default records filter, which we can use through Enter Query mode to specify some search criteria or to filter records before display, but you can also create your own filter, which can be more user friendly and easy to use

Freebie: Date Picker Calendar Demo Form For Oracle Forms 6i

I have already posted and provided the required PLSQL Library and the Calendar FMX file in my previous blog post Date Picker Calendar For Oracle Forms but some people were still not able to use this utility in their forms, so I thought to provide a d