0

私は、別のプログラマーによって 5 年以上作成および維持された後に渡された (VB.NET) サイトで作業しています。このサイトでは、Linq to XML を使用してファイルを Excel (2003) .xls ファイルとして生成します。

#Region "Download Excel"
    <Authorize()>
    Sub DownloadListForFile()
        Dim folder As String = ConfigurationManager.AppSettings("UserFiles") & "\" & UserId.ToString
        Dim file As String = "file.xls"
        Dim path As String = folder & "\" & file

        If Not (New IO.DirectoryInfo(folder)).Exists Then
            MkDir(folder)
        End If

        Dim xml = (New ReportsXML.GetXML).GetListForFile()
        xml.Save(path)

        Response.ContentType = "application/vnd.ms-excel"
        Response.Charset = ""
        Response.TransmitFile(path)
        Response.AddHeader("content-disposition", "filename=" & file)
        Response.End()
    End Sub

...

Function GetListForFile() As System.Xml.Linq.XDocument

...

Dim sml = <?xml version="1.0"?>
                  <?mso-application progid="Excel.Sheet"?>
                  <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
                      xmlns:o="urn:schemas-microsoft-com:office:office"
                      xmlns:x="urn:schemas-microsoft-com:office:excel"
                      xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
                      xmlns:html="http://www.w3.org/TR/REC-html40">

...等。

このサイトを 100% iPad 対応にしたいと考えていますが、これが唯一の障害です。(ContentType または拡張子の変更は機能しません。ファイルが Excel で開かないか、ファイルが Numbers の XML のプレーンテキストとして読み取られます。)

有料アプリであっても、これらのファイルをスプレッドシートとして読み取れるアプリを見つけることができれば、それは可能です。可能であれば、これらのファイルを Numbers および Excel と互換性を持たせる方法を見つけたいと思います。

私はあちこち検索しましたが、これを達成する方法が見つからないようです。

4

0 に答える 0