@Ramkumar. This package uses the Excel 1904 date format. There’s no setting to change that.
By: Anton Scheffer
By: stf174
Hi Anton,
great package. Thanks for sharing. I’m finding a problem between oracle 10 and 11.2. In the first case i create a report with 150000 rows in 132 seconds; in the second case i create the same report, but only 5000 rows, in 900 seconds. can you help me about some different parameter to increase in 11.2?
By: Ajit Bakshi
Hi Anton,
Great to have this package in my ammo.
But i am tired of getting below error.
ORA-04030: out of process memory when trying to allocate 65572 bytes (PLS non-lib hp,PL/SQL STACK)
ORA-06512: at “SYS.UTL_SYS_COMPRESS”, line 17
ORA-06512: at “SYS.UTL_SYS_COMPRESS”, line 202
ORA-06512: at “SYS.UTL_COMPRESS”, line 59
ORA-06512: at “IRMAEXT.AS_XLSX”, line 271
ORA-06512: at “IRMAEXT.AS_XLSX”, line 1280
ORA-06512: at “IRMAEXT.AS_XLSX”, line 1342
ORA-06512: at “IRMAEXT.AS_XLSX”, line 2504
ORA-06512: at line 14
I am trying to generate excel with 900000 Records. Memory consumption for oracle exe goes to 2,000,000 K just before getting this error.
My oracle version is 10.2.0.3.0 Oracle Database 10g Enterprise Edition.
Looking forward for some help. Tried out most of google suggestions but nither of them worked. Guess the creator himself will show some light on This.
- Ajit
By: youssef
Very useful, Anton! Thanks for sharing.
How i could use query2sheet to write data into an existing excel file.
Thanks
By: Moritz Klein (@commi235)
Hi Anton,
I have been using your xlsx package quite a lot lately and also did some customization.
Another thing I successfully used your package for is creating an APEX IR Downloader with full coloring and so on.
If you are interested in the things I did just contact me on twitter.
A huge thank your for providing this package.
Moritz
By: Elad
Hi Anton,
Thanks a lot. This Plugin seem to be very useful, but I need to export data from a TABLE TYPE (and not with select, as you wrote). how can I implement this?
TYPE Elad_Tbl_T IS TABLE OF Elad_Rec_T index by binary_integer;
l_my_tbl_inst Elad_Tbl_T;
In my procedure, I enter all the business logic, in that table type (l_my_tbl_inst).
instead of:
as_xlsx.query2sheet( ‘select * from dual’ );
I want to write, something like that:
as_xlsx.query2sheet( ‘l_my_tbl_inst’ );
Thanks in advanced,
Elad
By: Greg
Hi Anton, I just discovered your as_xlsx.
First of all, thank you VERY much for posting it for us. It really looks like the miracle I’ve been looking for…
I have one quick question, I hope you ‘ll answer:
I intend to use as_xlsx to produce excel report sheets from sql queries. A typical query will produce a result like this:
area_id area_value area_factor
————– ————— ————–
123456789 1234.5 62.5
234567890 987.8 0
345678901 12345 35
456789012 23456 .32 <–(this is 0.32)
… etc
Trying to avoid pestering you with details, my question is:
Is there a way, while using query2sheet, to declare an entire column's format as, say, number with 1 decimal?
If not, can I invoke cell formatting (always, inside a query2sheet call…)?
Thank you in advance for your time and patience.
Regards
Greg
By: Joseph Charpak
Anton, thanks for creating this. Is this code released under a specific license?
By: Tony Miller
Anton,
I know you released this a while ago into the public and I have REALLY gotten a GREAT DEAL of usage from it for my users.
I need to ask a question about performance. When I try using this package with a query returning 20000 or so rows, the routine seems to get bogged down and takes forever to return a file. Is there anything I can do to improve performance?
By: Anton Scheffer
@Tony Miller. Performance is an issue. The package needs to store everything in memory before it can create an Excel-file. If your database doesn’t have that much memory (XE-database) it can be a problem. If have tried to improve the performance, but haven’t found a way yet.
By: Tony Miller
Very strange issue here.. Ran code days ago that was dragging VERYYY slowly, ran the same code today after re-compiling your package and the code I am using with it and I am getting SIGNIFICANT improvement of performance..
We are running on an 11g r2 Enterprise instance (VM on a Linux server).. I do appreciate what you have done with this package..
Might have been a server issue with memory getting hogged by other processes and now its free..
Either way, thanks for the help!!
By: Michael Gilmore
I’m running the package from a Linux server with a remote Oracle DB RAC where the package is installed. I replaced the “MY_DIR” with “/stage” which the correct path related to root (/). I get the error below. How does this package handle linux directories? What should I be using?
ERROR at line 1:
ORA-29280: invalid directory path
ORA-06512: at “SYS.UTL_FILE”, line 29
ORA-06512: at “SYS.UTL_FILE”, line 448
ORA-06512: at “HPM.AS_XLSX”, line 140
ORA-06512: at “HPM.AS_XLSX”, line 1837
ORA-06512: at line 3
By: Charles Tannenbaum
We have had the same performance issues, we solved it by changing the following;
In function finish, declare a local var
lc_rows tp_rows;
See changes below
..
‘;
add1xml( t_excel, ‘xl/theme/theme1.xml’, t_xxx );
for s in 1 .. workbook.sheets.count()
loop
t_col_min := 16384;
t_col_max := 1;
/* vvvvvv CHANGED vvvvvvv */
— t_row_ind := workbook.sheets( s ).rows.first();
lc_rows := workbook.sheets( s ).rows;
/* while t_row_ind is not null
loop
t_col_min := least( t_col_min, workbook.sheets( s ).rows( t_row_ind ).first() );
t_col_max := greatest( t_col_max, workbook.sheets( s ).rows( t_row_ind ).last() );
t_row_ind := workbook.sheets( s ).rows.next( t_row_ind );
end loop;
*/
t_row_ind := lc_rows.first();
loop
exit when t_row_ind is null;
t_col_min := least( t_col_min, lc_rows( t_row_ind ).first () );
t_col_max := greatest( t_col_max, lc_rows( t_row_ind ).last() );
t_row_ind := lc_rows.next( t_row_ind );
end loop;
/* ^^^^^^ CHANGED ^^^^^^^ */
..
..
..
/* vvvvvv CHANGED vvvvvvv */
/*
t_xxx := t_xxx || ”;
t_row_ind := workbook.sheets( s ).rows.first();
t_tmp := null;
while t_row_ind is not null
loop
t_tmp := t_tmp || ”;
t_len := length( t_tmp );
t_col_ind := workbook.sheets( s ).rows( t_row_ind ).first();
while t_col_ind is not null
loop
t_cell := ”
|| to_char( workbook.sheets( s ).rows( t_row_ind )( t_col_ind ).value, ‘TM9′, ‘NLS_NUMERIC_CHARACTERS=.,’ )
|| ”;
if t_len > 32000
then
dbms_lob.writeappend( t_xxx, t_len, t_tmp );
t_tmp := null;
t_len := 0;
end if;
t_tmp := t_tmp || t_cell;
t_len := t_len + length( t_cell );
t_col_ind := workbook.sheets( s ).rows( t_row_ind ).next( t_col_ind );
end loop;
t_tmp := t_tmp || ”;
t_row_ind := workbook.sheets( s ).rows.next( t_row_ind );
end loop;
*/
/* New */
t_xxx := t_xxx || ”;
t_row_ind := lc_rows.first();
t_tmp := null;
while t_row_ind is not null
loop
t_tmp := t_tmp || ”;
t_len := length( t_tmp );
t_col_ind := lc_rows( t_row_ind ).first();
while t_col_ind is not null
loop
t_cell := ”
|| to_char( lc_rows( t_row_ind )( t_col_ind ).value, ‘TM9′, ‘NLS_NUMERIC_CHARACTERS=.,’ )
|| ”;
if t_len > 32000
then
dbms_lob.writeappend( t_xxx, t_len, t_tmp );
t_tmp := null;
t_len := 0;
end if;
t_tmp := t_tmp || t_cell;
t_len := t_len + length( t_cell );
t_col_ind := lc_rows( t_row_ind ).next( t_col_ind );
end loop;
t_tmp := t_tmp || ”;
t_row_ind := lc_rows.next( t_row_ind );
end loop;
/* ^^^^^^ CHANGED ^^^^^^^ */
Another change was made in procedure clear_workbook;
procedure clear_workbook
is
t_row_ind pls_integer;
t_clear_rows tp_rows;
begin
for s in 1 .. workbook.sheets.count()
loop
workbook.sheets( s ).rows := t_clear_rows;
/*
t_row_ind := workbook.sheets( s ).rows.first();
while t_row_ind is not null
loop
workbook.sheets( s ).rows( t_row_ind ).delete();
t_row_ind := workbook.sheets( s ).rows.next( t_row_ind );
end loop;
*/
workbook.sheets( s ).rows.delete();
..
Hope this will help.