This is a migrated thread and some comments may be shown as answers.

Cannot open exported reports (Mac OS X/Office 2004)

13 Answers 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
xav
Top achievements
Rank 1
xav asked on 14 Apr 2008, 12:07 PM
I have a client who is running Mac OS X and Office 2004 (for Mac) and she cannot open the documents from your demo site.  Please inform.

 -- xavier

13 Answers, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 16 Apr 2008, 09:19 AM
Hello xav,

Thank you for contacting Telerik Support.

In order to help you with this problem we need some more information. Which exact document causes the problem? Also, what is the actual problem that the application reports? Please make sure that exactly the same documents work in Windows and the Windows version of Office.  Any additional information that you find helpful will be appreciated.

Greetings,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
xav
Top achievements
Rank 1
answered on 18 Apr 2008, 03:21 PM
Svetoslav, thank you for your reply

>> Which exact document causes the problem? <<

All of them from your online demo of the reporting components.  Basically, just export to Excel. Then try to open the exported Excel documents and they will not open.  

The same document:

1. Cannot be opened by Office 2004 for the MAC OS X.
2. Can be opened under Windows versions of Office.

There is something wrong with the report format because I can create an excel document from Excel and open it with the mac.

Any help would be appreciated. Thanks.

>>
0
xav
Top achievements
Rank 1
answered on 18 Apr 2008, 06:03 PM
Svetoslav,

I have more info for you.  Using the demo (Adventure Cycle Works) from this site, I exported an excel document.  Straight out of the demo the Mac/OSX user cannot open it.  I can on my WindowsXP/MS Office computer.  After I opened it, I saved it again. The user can now open the file that I saved (a copy of the one from Telerik's export).

You can get the two files from here:

The bad file ProductLineSales.xls

The good file: ProductLineSales2.xls

I hope this helps.
 -- xavier
0
Steve
Telerik team
answered on 21 Apr 2008, 02:18 PM
Hello xav,

To our deepest regret we must confirm that we were able to reproduce the problem in the "Product Line Sales" online example under Office 2004 for Mac. Unfortunately at this time we do not have any direct pointers what is causing the issue and the fact that it happens on some reports and not all, makes it even harder to identify the issue. Therefore we would need more time to look into the issue and we would get back to you with more info, once we get to the bottom of it.

Thank you for the patience and understanding. Your Telerik points have been updated for pointing this problem out.

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
xav
Top achievements
Rank 1
answered on 08 May 2008, 08:13 PM
Steve, has there been any further development on this issue. We have still not decided on a reporting tool.  This is the one hangup for us using Telerik. I'm wondering if there's any options.

What is most interesting is that if I take the report, open it with office 2003 (windows), save it, then it can be opened with the Office 2004 product for the mac.

Is there a case number for this?

 -- xavier
0
Rossen Hristov
Telerik team
answered on 09 May 2008, 10:32 AM
Hi xav,

We generate Excel BIFF8 (Excel97) format according to the official specification, which should generally be compatible with applications reading that format. We suppose that this is probably an issue of Mac Office Excel, but we will continue researching it. As of now we were not able to understand that weird behavior, but we will go on.

By the way, have your customers been able to open an Excel file with a newer version (Office 2008) of the Mac Excel?

Greetings,
Ross
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Aditya
Top achievements
Rank 1
answered on 14 Jul 2008, 06:24 PM
Hi,
  Does Excel need to be installed on the local machine in order to generate an Excel report using the Reporting tool?

In other words, does the reporting tool depend on other components (aka MS Office) to generate a Excel file?


Thanks
Aditya
0
Vassil Petev
Telerik team
answered on 14 Jul 2008, 09:32 PM
Hi Aditya,

No, Microsoft Excel is not needed to be installed on the server nor on the local machine. Telerik Reporting uses its built-in exporting mechanism - it does not depend on other software, be it Excel, Adobe PDF, etc.

For more information on the Telerik Reporting features, please review www.telerik.com/reporting.

Best wishes,
Vassil
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kirill Bykov
Top achievements
Rank 1
answered on 07 Oct 2009, 12:24 PM
Greetings!

It is being a year+ since the last activity on this thread and unfortunately we're now being reported that our reports exported to Excel can't be opened on Mac having Office 2008 installed.

Any updates on this issue?

Thanks,
-Kirill.
0
Steve
Telerik team
answered on 08 Oct 2009, 04:04 PM
Hi Kirill bykov,

We've just tried exporting our demo reports (http://demos.telerik.com/reporting/default.aspx) to excel and opened the files with MS Office 2008 for Mac. No errors were encountered whatsoever, and we are not sure where to look. Any additional information would be highly appreciated.

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kirill Bykov
Top achievements
Rank 1
answered on 15 Oct 2009, 01:57 PM
I'm sorry for this confusion.
Both our customers and us were confused by the fact that Excel reports were not opened automaticaly like other formats were, and excel file was remaining in downloads window underneath the browser window.

However, Office 2004 is still an Issue.
Initial installation of Office 2004 just hangs after opening Excel report.
Installing Office 11.5.5 update did not resolve the issue.

Is there a fix or known work around for this issue? Unfortunately we're made to support Office 2004 also...

Thanks,
-Kirill.
0
Steve
Telerik team
answered on 15 Oct 2009, 03:03 PM
Hi Kirill,

As my colleague Ross explained a few posts up, the exported excel files are according to the Excel BIFF8 (Excel97) format following the official specification, which guarantees compatibility with applications reading that format. The very fact that this is no longer an issue in MS Office 2008 for Mac, brings us to the conclusion that this was an issue in Office 2004 that they have addressed. I am afraid there is little we can do at this point and our advise is to contact MS Š˛ffice for Mac support for more information. They should be able to provide more info once they review the file.

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Kirill Bykov
Top achievements
Rank 1
answered on 15 Oct 2009, 06:21 PM
Ok, here is  a solution:

The code is bad, unoptimal, insecure, but it works for the moment and that's what we need most of all. I believe anyone who may need to have this issue resolved bay use it as a basis and make it perfect.

This class needs to be used instead of Telerik.ReportViewer.WebForms.HttpHandler in your web.config.
The trick is to "touch" xls file with JET engine after ht has been created but before it is returned to the user.

 

using System;  
using System.Web;  
using System.Web.SessionState;  
 
using System.Reflection;  
using System.IO;  
using System.Data.OleDb;  
 
namespace Foo  
{  
    public class ReportViewer :IHttpHandler,   
        IRequiresSessionState  
 
    {  
        class CaptureStream : Stream  
        {  
            Stream _innerStream;  
            MemoryStream ms = null;  
            public CaptureStream(Stream innerStream)  
            {  
                _innerStream = innerStream;  
            }  
 
            public override bool CanRead  
            {  
                get 
                {  
                    return _innerStream.CanRead;  
                }  
 
            }  
 
            public override bool CanSeek  
            {  
                get   
                {  
                    return _innerStream.CanSeek;  
                }  
            }  
 
            public override bool CanWrite  
            {  
                get   
                {  
                    return _innerStream.CanWrite;  
                }  
            }  
 
            public override void Flush()  
            {  
                if (ms != null)  
                {  
                    try 
                    {  
                        string fname = Path.GetTempFileName();  
                        FileStream fs = File.Open(fname, FileMode.OpenOrCreate);  
                        try 
                        {  
                            ms.WriteTo(fs);  
                            ms.Flush();  
                        }  
                        finally 
                        {  
                            fs.Close();  
                        }  
 
                        OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fname + ";Persist Security Info=False;Extended Properties=\"Excel 8.0\"");  
                        con.Open();  
                        OleDbCommand cmd = new OleDbCommand();  
                        cmd.Connection = con;  
                        cmd.CommandText = "CREATE TABLE [foo]([Full Name] char(255))";  
                        cmd.ExecuteNonQuery();  
                        cmd.CommandText = "DROP TABLE [foo]";  
                        cmd.ExecuteNonQuery();  
                        con.Close();  
                        fs = File.Open(fname, FileMode.Open);  
                        MemoryStream ms2;  
                        try 
                        {  
                            ms2 = new MemoryStream((int)fs.Length);  
                            ms2.SetLength(fs.Length);  
                            fs.Read(ms2.GetBuffer(), 0, (int)fs.Length);  
                              
                        }  
 
                        finally 
                        {  
                            fs.Close();  
                        }  
                        File.Delete(fname);  
                        ms.Position = 0;  
                        _innerStream.Write(ms2.GetBuffer(), 0, (int)ms2.Length);  
                    }  
                    catch 
                    {  
                        _innerStream.Write(ms.GetBuffer(), 0, (int)ms.Length);  
                    }  
                }  
                _innerStream.Flush();  
            }  
 
            public override long Length  
            {  
                get   
                {  
                    return _innerStream.Length;  
                }  
            }  
 
            public override long Position  
            {  
                get 
                {  
                    return _innerStream.Position;  
                }  
                set 
                {  
                    _innerStream.Position = value;  
                }  
            }  
 
            public override int Read(byte[] buffer, int offset, int count)  
            {  
                return _innerStream.Read(buffer, offset, count);  
            }  
 
            public override long Seek(long offset, SeekOrigin origin)  
            {  
                return _innerStream.Seek(offset, origin);  
            }  
 
            public override void SetLength(long value)  
            {  
                _innerStream.SetLength(value);  
            }  
 
            public override void Write(byte[] buffer, int offset, int count)  
            {  
                if (ms == null)  
                    ms = new MemoryStream();  
                ms.Write(buffer, offset, count);  
            }  
        }  
        Telerik.ReportViewer.WebForms.HttpHandler m_nested;  
        public ReportViewer()  
        {  
            m_nested = new Telerik.ReportViewer.WebForms.HttpHandler();  
 
   
 
        }
        #region IHttpHandler Members  
 
        bool IHttpHandler.IsReusable  
        {  
            get   
            {  
                return (m_nested as IHttpHandler).IsReusable;  
            }  
        }  
 
        void IHttpHandler.ProcessRequest(HttpContext context)  
        {  
              
                if (context.Request.QueryString["optype"].Equals("Export") &&  
                    context.Request.QueryString["ExportFormat"].Equals("XLS"))  
                {  
                    HttpResponse resp = context.Response;  
                    Stream orig = resp.Filter;  
                    CaptureStream cap = new CaptureStream(orig);  
                    resp.Filter = cap;  
                    (m_nested as IHttpHandler).ProcessRequest(context);  
                }  
                else 
                {  
                    (m_nested as IHttpHandler).ProcessRequest(context);  
                }  
              
 
              
        }
        #endregion  
    }  
}  
 

Tags
General Discussions
Asked by
xav
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
xav
Top achievements
Rank 1
Steve
Telerik team
Rossen Hristov
Telerik team
Aditya
Top achievements
Rank 1
Vassil Petev
Telerik team
Kirill Bykov
Top achievements
Rank 1
Share this question
or