Home
Analytics
Saveing xls files are corrupt
android272
<p>[BIRT 4.2.2] - I am still having a problem with saving xls (excel) files. when I try to open the xls files I get his error:</p>
<pre class="_prettyXprint _lang-">
The file format and extension of 'export.xls' don't match. The file coould be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?
Yes, no, help
</pre>
<p>When I click yes I get a report with only one column, were as other file formats have 9 columns. Here is where I am setting the mimeType.</p>
<pre class="_prettyXprint _lang-">
String mimeType = null;
if (format.equals("xls")) {
resp.setContentType("application/vnd.ms-excel");
mimeType = "application/vnd.ms-excel";
}</pre>
<p>And here is where I am setting the render options.</p>
<pre class="_prettyXprint _lang-">
if (format.equalsIgnoreCase("xls")) {
options = new EXCELRenderOption();
options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
options.setOutputFormat(format);
}
</pre>
<p>what am I doing wrong here?</p>
Find more posts tagged with
Comments
JFreeman
<p>Instead of using EXCELRenderOption to define your options object, trying using RenderOption instead:</p>
<pre class="_prettyXprint _lang-js">
IRenderOption options = new RenderOption();
</pre>