Home » Developer & Programmer » Forms » freeze headings in excelsheet generated using TEXT_IO
freeze headings in excelsheet generated using TEXT_IO [message #201092] Thu, 02 November 2006 08:46 Go to next message
yogen
Messages: 39
Registered: October 2006
Location: UK
Member
Hi Gurus,

I am working on oracle forms 6i and generating a report in excelsheet in a format required by user.this i am doing in a when-button-pressed trigger and writing a procedure which select data from a table and will put it in aexcel file using TEXT_IO package.

the report contain nearly 40000 rows and first row is the heading in my excel sheet.I need to freeze these headings in excel sheet so that it's always visible to user no matter at which record user currently is.

thanks in advance.
Re: freeze headings in excelsheet generated using TEXT_IO [message #201160 is a reply to message #201092] Thu, 02 November 2006 17:22 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
I assume that as you are writing the file using 'text_io' then you are writing it as a 'csv' file. Is this true?

David

[Updated on: Thu, 02 November 2006 17:22]

Report message to a moderator

Re: freeze headings in excelsheet generated using TEXT_IO [message #201232 is a reply to message #201160] Fri, 03 November 2006 04:03 Go to previous messageGo to next message
yogen
Messages: 39
Registered: October 2006
Location: UK
Member
DECLARE
file1 TEXT_IO.FILE_TYPE;
v_filedate VARCHAR2(20);
v_header Varchar2(2000);

Cursor c1 is
Select col1||CHR(9)||col2||CHR(9)||col3||CHR(9)||col4||CHR(9) key
From tab1;

BEGIN
SELECT to_char(sysdate,'ddmmyyyyhh24miss')
INTO v_filedate
FROM DUAL;
--file1 := TEXT_IO.FOPEN( 'C:\'||v_filedate||'.xls', 'w' );

-- Create the Header

Select 'COL1'||CHR(9)||'COL2'||CHR(9)||'COL3'||CHR(9)||'COL4'||CHR(9) Into v_header From Dual;
TEXT_IO.PUT(file1, v_header);
TEXT_IO.NEW_LINE(file1,1);
-- Dump the data in the excel
For c1_rec in c1 Loop
TEXT_IO.PUT( file1, c1_rec.key) TEXT_IO.NEW_LINE(file1,1);
End Loop;
-------------------end------------
TEXT_IO.FCLOSE( file1 );
web.show_document'C:\'||v_filedate||'.xls','_blank');
--Message('Report is generated');
-- Message('Report is generated');

-- GO_BLOCK('B1');
EXCEPTION
WHEN OTHERS THEN
message(substr(sqlerrm,1,200));
TEXT_IO.FCLOSE( file1 );

End;

and my output in excel

COL1 COL2 COL3 COL4
abc bcd aec sed
aaa bbb ccc ddd
.
.
.
.
.

like this i am having records...

so 'COL1 COL2 COL3 COL4' headings must always be visible to user.that's my requirement is .if it is possible please let me know otherwise i will have to convience to the user that it's not possible.thanks .

[Updated on: Fri, 03 November 2006 04:05]

Report message to a moderator

Re: freeze headings in excelsheet generated using TEXT_IO [message #201546 is a reply to message #201232] Sun, 05 November 2006 17:18 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
From your response the answer to my question concerning 'csv' is 'yes'. Once you created this file, close it and then reopen it using 'ora_ffi' and make the necessary excel API calls to do that which you wish to do.

Search this forum 'excel ora_ffi'.

David
Previous Topic: how to integrate form to Microsoft Outlook calender
Next Topic: Problem in Locking
Goto Forum:
  


Current Time: Thu Dec 08 16:32:53 CST 2016

Total time taken to generate the page: 0.10592 seconds