 悬赏园豆:40
                [已关闭问题] 
            
                    关闭于 2016-12-19 16:54
                悬赏园豆:40
                [已关闭问题] 
            
                    关闭于 2016-12-19 16:54
                 
        现在我项目中的报表导出是用的
// //Word文件头
// HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename + ".doc", System.Text.Encoding.UTF8));
// HttpContext.Current.Response.ContentType = "application/ms-word";
// HttpContext.Current.Response.Charset = "UTF-8";
// HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
// Page.EnableViewState = false;
// //输出
// HttpContext.Current.Response.Write(html);
// HttpContext.Current.Response.Flush();
这种简单导出,现客户要求打印的时候纸张是横向的,请问怎么解决?
现在想到的是先不输出到浏览器,而是保存到服务器端,再通过npoi读取调整方向导出来,最后删除文件。
打印自己调整呗
客户的要求你无法体会
在网上搜了搜主要就是通过css样式把要导入的html设置为横向的
首先在页面的head中加下面的一段代码 
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 <style>
 <!--
 @page
     {mso-page-border-surround-header:no;
     mso-page-border-surround-footer:no;}
 @page Section1
     {size:841.9pt 595.3pt;
     mso-page-orientation:landscape;
     margin:89.85pt 72.0pt 89.85pt 72.0pt;
     mso-header-margin:42.55pt;
     mso-footer-margin:49.6pt;
     mso-paper-source:0;
     layout-grid:15.6pt;}
 div.Section1
     {page:Section1;}
 -->
 </style>
 </head>
 然后用div包含整个的显示内容,会调用上面的style
<div class="Section1">
</div>
我试了,html没有横着