Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328869

Summary: Error opening exported Excel document for specific report
Product: z_Archived Reporter: Casey Crockett <linxuser>
Component: BIRTAssignee: Jun Ouyang <jouyang>
Status: CLOSED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: minor    
Priority: P3 CC: arielt1985, bluesoldier, haifengl, wenfeng.fwd, yChen
Version: 2.6.1Keywords: helpwanted
Target Milestone: 3.7.0 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Report that fails to open in Excel
none
Same report but in PDF as example
none
screenshot of error
none
log file created by Excel upon attempted opening
none
Report design
none
Report_R2A.xls ---uploaded by Hai Feng to show the opening error related NamedRange name none

Description Casey Crockett CLA 2010-10-27 14:04:49 EDT
Created attachment 181858 [details]
Report that fails to open in Excel

Error upon opening Excel document exported from BIRT viewer for specific report.

Error from Excel 2010 reads: The file is corrupt and cannot be opened.
I then select "unblock" in the file's properties and attempt to open again.  The next message is: Problems came up in the following areas during the load: Workbook Settings.  There is also a log file that supposedly gets generated, but I can never navigate to it.  After clicking OK, Excel stays open but does not open the document.

Other reports open fine in Excel and this report opens fine in PDF exported from BIRT viewer.  I will attach the report in PDF and Excel, and screenshots of the error if possible.  The only difference in this report that I can see is grouping and colorized sections.

This report worked for the excel export in BIRT viewer 2.5.2 on WinXP, I think.  Though, I'm not 100% sure I ever exported it when I had that version installed.

Thank You for working on an excellent reporting tool!
Comment 1 Casey Crockett CLA 2010-10-27 14:09:56 EDT
Created attachment 181859 [details]
Same report but in PDF as example

Same report as the Excel attachment but exported as PDF to show what report looks like.
Comment 2 Casey Crockett CLA 2010-10-27 14:13:35 EDT
Created attachment 181860 [details]
screenshot of error

screenshot of error about worksheet settings.  Log file that is mentioned can not be found.
Comment 3 Casey Crockett CLA 2010-10-27 15:33:57 EDT
Created attachment 181869 [details]
log file created by Excel upon attempted opening

This log was hard to find because it was located deep in hidden system folders, but here it is.  Not much in there either.
It was created when I attempted to open the Excel document exported from BIRT viewer.
Comment 4 Xiaoying Gu CLA 2010-10-27 22:51:35 EDT
Hi Casey,

Could you please upload your report design here?
Comment 5 Casey Crockett CLA 2010-10-29 18:46:12 EDT
Created attachment 182089 [details]
Report design

Report design for the report that fails to export as an excel file.  Runs great in BIRT preview and web viewer running on Tomcat except for the export to excel.
This report was first created with BIRT 2.5.2, then opened and saved in BIRT 2.6.1.  Reset of the database connection was the only change. Thanks!
Comment 6 Xiaoying Gu CLA 2010-11-01 04:52:03 EDT
(In reply to comment #5)
> Created an attachment (id=182089) [details]
> Report design
> 
> Report design for the report that fails to export as an excel file.  Runs great
> in BIRT preview and web viewer running on Tomcat except for the export to
> excel.
> This report was first created with BIRT 2.5.2, then opened and saved in BIRT
> 2.6.1.  Reset of the database connection was the only change. Thanks!

Ok, I can reproduce this issue in latest 2.6.2 build.
Comment 7 Hai Feng Luo CLA 2010-11-23 02:42:35 EST
Hello there, I'm also met excel opening error after export it from my report. Both in plug-in version 2.3.2 and 2.5.2.

Most of the senario is similar to the description, the only difference is the log.
My log is shown as below:

XML ERROR in Workbook Setting
REASON:	Bad Value
FILE:	E:\DEV\Defect\20101019_32788_Reports exported as an excel file will not open correctly in Excel\Report.xls
GROUP:	Names
TAG:	NamedRange
ATTRIB:	Name
VALUE:	R2A

And I found an NamedRange with the name R2A in the exported excel file. 

<Names>
		<NamedRange ss:Name="R2A" ss:RefersTo="=Sheet1!R7C1"/>
</Names>
I can confirm the error is realted with the name string format, ss:Name="R2A",  as the excel can be opened correctly after I change the ss:Name="R2A" to ss:Name="RA". 
I tested the name, if it's A,or B, or other letters, it will not occur. And if the name formate is like Cxx_(XX is number here), the error also will shows up.

The report can be exported to PDF and word file successfully.

Add the excel file for reference.

Should this the same bug as this item? 
Or should I open a new one to track this?

Thanks a lot!
Haifeng
Comment 8 Hai Feng Luo CLA 2010-11-23 02:44:39 EST
Created attachment 183636 [details]
Report_R2A.xls ---uploaded by Hai Feng to show the opening error related NamedRange name

uploaded by Hai Feng to show the opening error related NamedRange name
Comment 9 Xiaoying Gu CLA 2010-11-23 03:08:35 EST
(In reply to comment #8)
> Created an attachment (id=183636) [details]
> uploaded by Hai Feng to show the opening error related NamedRange name
> 
> uploaded by Hai Feng to show the opening error related NamedRange name

Could you please build a simple report that can reproduce this issue and attached here? Thanks,
Comment 10 Hai Feng Luo CLA 2010-11-23 10:32:32 EST
(In reply to comment #9)
> (In reply to comment #8)
> > Created an attachment (id=183636) [details] [details]
> > uploaded by Hai Feng to show the opening error related NamedRange name
> > 
> > uploaded by Hai Feng to show the opening error related NamedRange name
> 
> Could you please build a simple report that can reproduce this issue and
> attached here? Thanks,

Hi Xiao Ying, Thanks for your reply! The simple report is in progress, I will attach that to this WI when it available.

Also I have another question related with this. As you can see from my uploaded excel file, there is a element named 
<Names>
      <NamedRange ss:Name="R2A" ss:RefersTo="=Sheet1!R11C1"/>
</Names>
In most of the reports, it is shows up like <Names/>, my question is when the NamesRange will show up as a child of <Names> element? Can I say it is because of group by function in the report table? Would you pls give some detail info? Thanks!
Comment 11 Yu Chen CLA 2011-01-25 05:04:50 EST
Fixed.
Comment 12 Ariel Tal CLA 2012-09-04 10:45:42 EDT
This issue is still happening in BIRT 4.2.0.


Another detail from MSDN:
http://msdn.microsoft.com/en-us/library/office/aa140066(v=office.10).aspx#odc_xmlss_ss:namedrange:
"The NamedRange cannot resemble an R1C1-style reference. "

Examples:
Resembles: Web1, kvm3, xfd12345
Doesn't resemble: xfe12345 

Explanation:
Cell indexes in excel are made of letter combinations and numbers. The letters go up to xfd, which is why xfd.. resembless and xfe... doesn't.



Is there a way around this issue by modifying the report?


Thanks