2012-03-13 49 views
0

テキストと画像を含むレポートを印刷しようとしています。私は、印刷機能を呼び出すためにJavaScript関数を使用しています。ページ上の画像が新しいプリントウィンドウに表示されない限り、すべてがうまく機能します。私はそれにすべてのCSSファイルを含むが、まだ私のイメージは、新しい印刷ウィンドウに表示されません。たとえ私がCSSリンクを含んでいなくても同じです。JavaScript印刷機能を使用して画像を印刷できない

印刷への私のjavascript機能は次のとおりです。

function printfun(){ 
     var disp_setting = "toolbar=no,location=no,directories=no,menubar=no,"; 
     disp_setting += "scrollbars=no,left=0,top=0,resizable=yes,width=900 height=650,modal=yes,"; 
     var content_vlue = document.getElementById('<%= tblCharts.ClientID %>').innerHTML; 
     var docprint = window.open("", "", disp_setting); 
     docprint.document.write('<html><head>'); 
     docprint.document.write('</head>'); 
     docprint.document.write('<body onLoad="self.print()">'); 
     docprint.document.title = ""; 
     docprint.document.write('<link href="../style/design.css" rel="Stylesheet" type="text/css" />'); 
     docprint.document.write('<link href="../App_Themes/style/graphs.css" rel="Stylesheet" type="text/css" />'); 
     docprint.document.write(content_vlue); 
     docprint.document.write(tblCharts);   
     docprint.document.write("</body></html>"); 
     docprint.document.close(); 
     docprint.focus(); 
} 

答えて

1

は、CSS内の画像の背景画像はありますか?その場合、ブラウザはデフォルトで印刷するように設定されていない可能性があります。それはユーザーを設定するブラウザが変更する必要があります。

+0

OPの声明では「」と書いてあります。「CSSリンクを含めなくても同じです」「...しかし、私はこのサイトでは見知らぬものを聞いたことがあります。何かを当然のものとしてください。 –

+0

いいえ背景画像はありません。それらはバーグラフやそのようなものです –

+0

あなたが印刷しようとしているinnerHTMLを表示できますか? –

関連する問題