nice work, i hope someone can help me about the date system too, im using windows, i have an extracted excel and after copying its cell in date format into another excel file, the date becomes different. this is excel’s issue “1904 / 1900″, is there a way that we set the package to just be in 1900? your help is appreciated. Thanks!
By: carzmetic
By: Mike Chambers
I found my problem. I formatted the cell for Text using as_xlsx.get_numFmt(‘@’). What I didn’t know was that formulas entered into fields formatted as Text are just that…TEXT. By changing to get_numFmt(‘General’) I was able to get the results I wanted and allow my users to enter formulas after downloading the XLSX file.
By: tony miller
I am trying to use this package with a slight twist.. Since you have an existing plugin that will allow download of a report via Excel 2007 format file, but it can only handle reports up to 26 columns, I was wanting to use this library and just have it determine the active sql select from an interactive report (code already added) and run the query like it does now into a return BLOB and then download t he BLOB via wpg_docload.download_file..
However, the last step of downloading via wpg_docload.download_file is not producing an error, but also not producing a download to the users browser..
Any suggestions?
By: Chuck Wolf
Anton
Is their a whitepaper on how to implement this from both Apex, where I am just opening a .xlsx file and from a stored Proc where I am emailing the xlsx file and passing in the SQL statement on both instances?
Chuck
By: Anton Scheffer
No
By: Chuck Wolf
So is it meant to only save to the network?
By: tony miller
I have been working with Anton to have a modified version of this build a xlsx file and allow the user to download/save it locally..
By: Chuck Wolf
My business requirement is to transition from sending .xls files (we are currently using xml Spreadsheet by Matzberger) to .xlsx files.
Would love to use this, as it seems to be widely regarded, but not sure how to use.
By: Anton Scheffer
No, I don’t have a whitepaper. But using the function finish you will get a blob. You can store that blob in a table, use it as an attachment for a email, throw it away, what ever you want.
By: tony miller
Anton is right, once the procedure runs and builds the Finish blob item, you can do what you want with it. In my case I am downloading it via a wpg_docload.download_file call to the user for either a save to disk or open right there option…
Thank you,
Tony Miller
LuvMuffin Software
By: Albain DSM
Works even better w/ autoflush
utl_file.put_raw( file => t_fh
, buffer => dbms_lob.substr( p_blob
, t_len
, i * t_len + 1
)
, autoflush => true
);
By: Anton Scheffer
I must say I never had any problems without the autoflush = true. But you are right, it’s better. And if you have trouble writing out a file, it might even help to add max_linesize => 32767 to the utl_file.fopen statement.
By: Newbie
Hello Anton,
I’ve been using your pl/sql package to create an excel file. It works great !!!
I have two questions. How do I rename the sheets (ie. Sheet1) and how can I create a excel document with multiple sheets within the same excel document? Below is what I’m trying to attempt. When I run the following query, the output file is created but when I try to open the file with excel I get multiple errors.
DECLARE
v_dir VARCHAR2(30) := Course_dir;
v_file VARCHAR2(30) := ‘my_course.xls’;
begin
pwg_create_xlsx.clear_workbook;
pwg_create_xlsx.new_sheet(‘Course 24967′);
pwg_create_xlsx.query2sheet(‘select * from courses where course_numb = 24967′ );
pwg_create_xlsx.new_sheet(‘Course 24293′);
pwg_create_xlsx.query2sheet(‘select * from courses where course_numb = 24293′ );
pwg_create_xlsx.save(v_dir, v_file);
end;
By: Anton Scheffer
@Newbie. Any reason why you renamed the package?
Use the parameter p_sheet, for instance
pwg_create_xlsx.query2sheet(‘select * from courses where course_numb = 24967′, p_sheet => 2 );
By: Newbie
Hello Anton,
Thank you for the update. The package was renamed to match or naming standards. This is only for testing. How can I change the font on the entire sheet and how can I specify the column widths? Can each column have its own column width?
Newbie.
By: Ralph Bieber
Hi Anton,
first let me thank you for this great package.
Please note that I had an issue getting ORA-6502. I got this error when appliying “Auto Filter” in procedure “finish”. I debugged the procedure and found out an issue with concatination variable t_xxx.
When replacing this code using dbms_lob.writeappend resolves the issue.
I propose to replace all concatinations with pipe by dbms_lob.writeappend for t_xxx.
– ############################### CHANGED CODE #############
for a in 1 .. workbook.sheets( s ).autofilters.count()
loop
t_tmp:= ”;
t_len := length( t_tmp );
dbms_lob.writeappend( t_xxx, t_len, t_tmp );
end loop;
– ############################### CHANGED CODE #############
– ############################### ORIGINAL CODE #############
for a in 1 .. workbook.sheets( s ).autofilters.count()
loop
t_xxx := t_xxx || ”;
end loop;
– ############################### ORIGINAL CODE #############
kind regards
Ralph
By: Bill
Hello,
Thank you for this source code. it works great and is close to what we are looking for in our system. However, we support clients with previous versions of Excel (mainly 97-03 and above) but not all clients have the compatibility pack installed (some are unable to). The comments are not easy to read through since there is no scrollbar on them but I know it was asked. Is there a way to adapt this to create an .xls file instead of xlsx?
Maybe i am doing something wrong. When I try to name the file .xls and open it i am prompted that the file type and extension are different. can anyone confirm that you can save .xls files and open them normally without modifying the code.
Thanks,
Bill
By: Anton Scheffer
You can’t create xls files with this package.
By: Bill
That is what I was afraid of. Thank you for the quick reply and again for the code.
By: Robertson
Your package is great , Really it helps me lot.
I have problem , if am writing more than 10k rows and it is taking for ever. is there any limit to write, please help me
Thanks