私はvb.netのExcelにレポートをエクスポートしようとしています。.NETへのエクスポート - IEのバグ?
ChromeとFFではすべて正常に動作しますが、IEで行うと、アクティブなディレクトリのログインポップアップが引き続き表示されます。
私がそれをキャンセルすると(4-5回のように)ファイルはちょうど良い結果を保存します...なぜそれがポップアップしているのですか>周囲に道があるのですか?
以下の私のコードを参照してください。
Protected Sub lnkExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkExport.Click
Dim ds As DataSet = cSource.FindSources(Session("uid"), True, txtID.Text)
Dim response As HttpResponse = HttpContext.Current.Response
Dim filename As String = "AASD"
' first let's clean up the response.object
response.Clear()
response.Charset = ""
' set the response mime type for excel
response.ContentType = "application/vnd.ms-excel"
response.AddHeader("Content-Disposition", "attachment;filename=""" & filename & """")
' create a string writer
Using sw As New StringWriter()
Using htw As New HtmlTextWriter(sw)
' instantiate a datagrid
Dim dg As New DataGrid()
dg.DataSource = ds.Tables(0)
dg.DataBind()
dg.RenderControl(htw)
response.Write(sw.ToString())
response.[End]()
End Using
End Using
End Sub
Excelシートの送信に使用したコードをブラウザに投稿できますか? –
実行しているIEのバージョンは何ですか?私は同様の問題を抱えていて、それは魔法のように最新のバージョンをインストールしたときに消えました... –
8 ..しかし、ユーザーも8を使用します。多分私はサイトや何かに免責を置くでしょう...もしこれを修正する他の方法がないなら。 –