I know about CSV and Classic Report. But appropriate format for me are: xml , html , xls(xlsx). I read about Print Attributes for reports. It requires print server configuration ,but now I have no access to Oracle configuration ,so I can't try this method.
Pars , I have already read this article. But I couldn't find any links to his package in demo application pages.
ascheffer, thanks. I saw your plugin , but forgot to download and try it. Now I can do it.
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 don't know what you have done. That doesn't happen when I use the plugin, and I've never heard it from someone else neither.
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 ?
1 person found this helpful
Have you tried wrapping all text columns from your report in a TO_NCHAR() call ? This way the database should be converting to its NCHAR type, which is likely some UTF (AL16UTF16, typically).
Excel worksheet has name as a region title. So it also consists of Cyrillic characters.
1 person found this helpful
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 );