Reporting Servicesを使用してPDFレポートを生成しており、ブラウザウィンドウにレンダリングし、ブラウザに埋め込む必要があります。私たちはこれを長い間行ってきましたが、IE9まではいつも働いていました。動的に作成されたPDFは64ビットIE9ウィンドウにインライン展開されていません
IE6、IE7、およびIE8では、PDFレポートを表すReporting Servicesからバイト配列を生成し、バイナリをブラウザに書き出します。すべてうまく動作します。 PDFはブラウザに埋め込まれて表示されます。
IE9では、同じことを試みますが、PDFはブラウザウィンドウに埋め込まれていません。ブラウザウィンドウは開いたまま空白/空白になり、PDFは別のウィンドウでAdobe Readerで開かれます。
は、ここに私たちのコードの抜粋です:
try
{
// Set all the Reporting Services variables and parameters and render the report
// ...
byte[] result = rs.Render(format, devInfo, out extension, out mimeType, out encoding, out warnings, out streamIDs);
// Force the render out of the report to the browser
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AppendHeader("content-length", result.Length.ToString());
Response.AppendHeader("Pragma", "cache");
Response.AppendHeader("Expires", "3600");
Response.Buffer = true;
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.CacheControl = "private";
Response.Charset = System.Text.UTF8Encoding.UTF8.WebName;
Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
switch (outputformat)
{
case "PDF":
Response.AppendHeader("content-disposition", "inline; filename=report.pdf");
Response.ContentType = "application/pdf";
break;
default:
break;
}
Response.BinaryWrite(result);
Response.Flush();
Response.Close();
Response.End();
}
catch (System.Exception ex)
{
// ...
}
我々はPDFがIE9のbroswerウィンドウでレンダリングされ、埋め込まれた取得することができますか?
ありがとうございます!
アクロバットリーダーのバージョン情報を追加できますか? (IE 6/7/8 boxenとIE9と組み合わせて使用されるもの) –
情報ありがとう、Lynn。それは役に立ちました。私は、Adobe Readerバージョン9.4.6と10.1.1(2つの別々のコンピュータ - Windows Server 2008 R2とIE9の両方)を試しましたが、Readerの両方のバージョンに同じ問題がありました。この問題は、IE9の64ビット版の使用に起因するように見えます。 IE9の64ビット版を使用している場合、ブラウザウィンドウではなくAdobe ReaderアプリでPDFが開きます。 IE9の32ビット版を使用すると、以前のバージョンのIEおよびAdobe Readerと同じように、PDFがブラウザウィンドウに表示されます。したがって、注意すべき点は、この状況では32ビットIEを使用してください。 – lmttag
私の既存の回答に追加されました。 httpやhttpsで送信していますか? –