ascheffer, I have some questions. Why file always has "_____" (long or short underscore) name? I set filename like a region title in settings.
And why a "Problems during load Workbook Settings" error occurs when I try to open downloaded xml file from Excel 2003? There is an explanation of the error in the log:
XML PARSE ERROR: Missing whitespace between attributes
Error occurs at or below this element stack:
I investigated this problem. Character encoding mismatch caused such situation. All data in my report consists of Cyrillic characters. Created .xml file has Unicode UTF-8 encoding (<?xml version="1.0"?> tag). When I changed it to <?xml version="1.0" endcoding="windows-1251"?> problem was solved. But this is not a final solution, because I have to add encoding attribute to the first tag or save file with "UTF-8 without BOM" encoding for every new file. What should I do ?
May be you can add encoding option to plugin settings ?
The plugin produces a XML-file in the database character set, but without a encoding attribute. And that can lead to problems, as you discovered. The easiest solution is to change one line in the plugin source:
dbms_lob.converttoblob( t_excel, t_tmp, dbms_lob.lobmaxsize, t_dest_offs, t_src_offs, dbms_lob.default_csid, t_lang_ctx, t_warning );
dbms_lob.converttoblob( t_excel, t_tmp, dbms_lob.lobmaxsize, t_dest_offs, t_src_offs, nls_charset_id( 'AL32UTF8' ), t_lang_ctx, t_warning );
If the filename is a problem, you can try changing another line
owa_util.mime_header( wwv_flow_utilities.get_excel_mime_type, false );
owa_util.mime_header( wwv_flow_utilities.get_excel_mime_type, false, 'windows-1251' );
About file name... The other way is:
owa_util.mime_header( p_file_mime, false );
htp.p ('content-length: ' || DBMS_LOB.getlength( lob_loc => p_file_blob ) );
if INSTR(UPPER(OWA_UTIL.GET_CGI_ENV('HTTP_USER_AGENT')), 'MSIE') > 0 then
htp.p ('Content-Disposition: attachment; filename="' || UTL_URL.ESCAPE( p_file_name, FALSE, 'UTF-8' ) || '"');
htp.p('Content-Disposition: attachment; filename*=UTF-8'''''||UTL_URL.ESCAPE( p_file_name, FALSE, 'UTF-8' ));
wpg_docload.download_file( p_file_blob );