Tuesday, October 27, 2015

Oracle Report 6i generated to Excel

Examples from Metalink:

               1.

Use the following given method to print report which can be used to open in MS Excel.

1. The SELECT statement should produce a string of data separated by commas. For example:

SELECT deptno||','||dname||','||l
oc the_string FROM dept;

2. The report must be created as a Character mode report and the output filename must have a .csv extension.
So set the following System Parameters under the Data Model node in the Object Navigator.

System Parameter Name Default Value
---------------------- -------------------

MODE Character
DESTYPE File
DESNAME x.csv
DESFORMAT dflt

( In the preivewer adjust the width of the fields properly by running report into previewer )

3. Now run the report - it will create the output file x.csv.

The file x.csv can be opened in MS Excel. There will be three columns of data.
----------------------------------------------------------------------------------

               2.

In Reports 6 and 6i you can use parameter DELIMITER

Delimited Output

Delimited output enables you to specify a delimiter, a character, or string of characters, to separate the data in your report output.  Using this feature, you can create report output that is easily imported into spreadsheets, such as Microsoft Excel.

You can specify the delimiter in either of the following ways:

1.  On the command line, use the DELIMITER parameter with DESFORMAT.
2.  In the Delimited Output dialog box use, the Delimiter option.

No comments:

Post a Comment