﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-★Daniel's Blog★-文章分类-报表</title><link>http://www.blogjava.net/Daniel2005/category/4918.html</link><description>URL:http://www.blogjava.net/Daniel2005</description><language>zh-cn</language><lastBuildDate>Tue, 26 Jun 2007 18:39:14 GMT</lastBuildDate><pubDate>Tue, 26 Jun 2007 18:39:14 GMT</pubDate><ttl>60</ttl><item><title>WEB打印方式!</title><link>http://www.blogjava.net/Daniel2005/articles/125849.html</link><dc:creator>泌鲁沙夫</dc:creator><author>泌鲁沙夫</author><pubDate>Fri, 22 Jun 2007 07:21:00 GMT</pubDate><guid>http://www.blogjava.net/Daniel2005/articles/125849.html</guid><wfw:comment>http://www.blogjava.net/Daniel2005/comments/125849.html</wfw:comment><comments>http://www.blogjava.net/Daniel2005/articles/125849.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Daniel2005/comments/commentRss/125849.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Daniel2005/services/trackbacks/125849.html</trackback:ping><description><![CDATA[<p><span style="COLOR: red">1).NET &nbsp; Framework &nbsp; 类库</span> &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; PrinterSettings &nbsp; 成员请参见 &nbsp; <br>&nbsp; PrinterSettings &nbsp; 类 &nbsp; | &nbsp; System.Drawing.Printing &nbsp; 命名空间 &nbsp; | &nbsp; C++ &nbsp; 托管扩展编程 &nbsp; &nbsp; <br>&nbsp; PrinterSettings &nbsp; 概述 &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 公共构造函数 &nbsp; <br>&nbsp; PrinterSettings &nbsp; 构造函数 &nbsp; 初始化 &nbsp; PrinterSettings &nbsp; 类的新实例。 &nbsp; &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 公共属性 &nbsp; <br>&nbsp; CanDuplex &nbsp; 获取指示打印机是否支持双面打印的值。 &nbsp; &nbsp; <br>&nbsp; Collate &nbsp; 获取或设置一个值，该值指示打印文档是否逐份打印。 &nbsp; &nbsp; <br>&nbsp; Copies &nbsp; 获取或设置要打印的文档份数。 &nbsp; &nbsp; <br>&nbsp; DefaultPageSettings &nbsp; 获取此打印机的默认页设置。 &nbsp; &nbsp; <br>&nbsp; Duplex &nbsp; 获取或设置双面打印的打印机设置。 &nbsp; &nbsp; <br>&nbsp; FromPage &nbsp; 获取或设置要打印的第一页的页码。 &nbsp; &nbsp; <br>&nbsp; InstalledPrinters &nbsp; 获取安装在计算机上所有打印机的名称。 &nbsp; &nbsp; <br>&nbsp; IsDefaultPrinter &nbsp; 获取一个值，该值指示 &nbsp; PrinterName &nbsp; 属性是否指定默认打印机（用户显式设置 &nbsp; PrinterName &nbsp; 的情况除外）。 &nbsp; &nbsp; <br>&nbsp; IsPlotter &nbsp; 获取指示该打印机是否是绘图仪的值。 &nbsp; &nbsp; <br>&nbsp; IsValid &nbsp; 获取一个值，该值指示 &nbsp; PrinterName &nbsp; 属性是否指定了有效的打印机。 &nbsp; &nbsp; <br>&nbsp; LandscapeAngle &nbsp; 获取旋转纵向方向以生成横向方向的角度，以度为单位。 &nbsp; &nbsp; <br>&nbsp; MaximumCopies &nbsp; 获取打印机允许一次打印的最多份数。 &nbsp; &nbsp; <br>&nbsp; MaximumPage &nbsp; 获取或设置可以在 &nbsp; PrintDialog &nbsp; 中选定的最大的 &nbsp; FromPage &nbsp; 或 &nbsp; ToPage。 &nbsp; &nbsp; <br>&nbsp; MinimumPage &nbsp; 获取或设置可以在 &nbsp; PrintDialog &nbsp; 中选定的最小的 &nbsp; FromPage &nbsp; 或 &nbsp; ToPage。 &nbsp; &nbsp; <br>&nbsp; PaperSizes &nbsp; 获取该打印机支持的纸张大小。 &nbsp; &nbsp; <br>&nbsp; PaperSources &nbsp; 获取打印机上可用的纸张来源纸盒。 &nbsp; &nbsp; <br>&nbsp; PrinterName &nbsp; 获取或设置要使用的打印机的名称。 &nbsp; &nbsp; <br>&nbsp; PrinterResolutions &nbsp; 获取该打印机支持的所有分辨率。 &nbsp; &nbsp; <br>&nbsp; PrintRange &nbsp; 获取或设置用户已指定要打印的页码。 &nbsp; &nbsp; <br>&nbsp; PrintToFile &nbsp; 获取或设置一个值，该值指示打印输出是否发送到文件，而不发送到端口。 &nbsp; &nbsp; <br>&nbsp; SupportsColor &nbsp; 获取指示该打印机是否支持彩色打印的值。 &nbsp; &nbsp; <br>&nbsp; ToPage &nbsp; 获取或设置要打印的最后一页的页码。 &nbsp; &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 公共方法 &nbsp; <br>&nbsp; Clone &nbsp; 创建此 &nbsp; PrinterSettings &nbsp; 对象的一个副本。 &nbsp; &nbsp; <br>&nbsp; CreateMeasurementGraphics &nbsp; 返回 &nbsp; Graphics &nbsp; 对象，该对象包含创建 &nbsp; PrintDocument &nbsp; 时有用的打印机信息，例如，打印机的 &nbsp; TextMetric &nbsp; 对象。 &nbsp; &nbsp; <br>&nbsp; Equals（从 &nbsp; Object &nbsp; 继承） &nbsp; 已重载。确定两个 &nbsp; Object &nbsp; 实例是否相等。 &nbsp; &nbsp; <br>&nbsp; GetHashCode（从 &nbsp; Object &nbsp; 继承） &nbsp; 用作特定类型的哈希函数，适合在哈希算法和数据结构（如哈希表）中使用。 &nbsp; &nbsp; <br>&nbsp; GetHdevmode &nbsp; 已重载。创建与打印机设置相对应的 &nbsp; DEVMODE &nbsp; 结构的句柄。 &nbsp; &nbsp; <br>&nbsp; GetHdevnames &nbsp; 创建与打印机设置相对应的 &nbsp; DEVNAMES &nbsp; 结构的句柄。 &nbsp; &nbsp; <br>&nbsp; GetType（从 &nbsp; Object &nbsp; 继承） &nbsp; 获取当前实例的 &nbsp; Type。 &nbsp; &nbsp; <br>&nbsp; SetHdevmode &nbsp; 将相关信息从给定句柄复制到 &nbsp; PrinterSettings &nbsp; 中。 &nbsp; &nbsp; <br>&nbsp; SetHdevnames &nbsp; 将相关信息从给定句柄复制到 &nbsp; PrinterSettings &nbsp; 中。 &nbsp; &nbsp; <br>&nbsp; ToString &nbsp; 已重写。参见 &nbsp; Object.ToString。 &nbsp; &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 受保护的方法 &nbsp; <br>&nbsp; Finalize（从 &nbsp; Object &nbsp; 继承） &nbsp; 已重写。允许 &nbsp; Object &nbsp; 在&#8220;垃圾回收&#8221;回收 &nbsp; Object &nbsp; 之前尝试释放资源并执行其他清理操作。 &nbsp; &nbsp; <br>&nbsp; 在 &nbsp; C# &nbsp; 和 &nbsp; C++ &nbsp; 中，使用析构函数语法来表示终结程序。 &nbsp; <br>&nbsp; &nbsp; &nbsp; <br>&nbsp; MemberwiseClone（从 &nbsp; Object &nbsp; 继承） &nbsp; 创建当前 &nbsp; Object &nbsp; 的浅表副本。 &nbsp; &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; 请参见 &nbsp; <br>&nbsp; PrinterSettings &nbsp; 类 &nbsp; | &nbsp; System.Drawing.Printing &nbsp; 命名空间 &nbsp; | &nbsp; C++ &nbsp; 托管扩展编程</p>
<span style="COLOR: red">2)1、控制"纵打"、 横打&#8221;和&#8220;页面的边距。 <br>（1）<font color=#000000>&lt;OBJECT id="factory" codeBase="smsx.cab" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" viewastext&gt;&lt;/OBJECT&gt; </font><br><span style="COLOR: #000000">&lt;</span></span>script defer&gt; <br>function SetPrintSettings() { <br>　// -- advanced features <br>　factory.printing.SetMarginMeasure(2) // measure margins in inches <br>　factory.SetPageRange(false, 1, 3) // need pages from 1 to 3 <br>　factory.printing.printer = "HP DeskJet 870C" <br>　factory.printing.copies = 2 <br>　factory.printing.collate = true <br>　factory.printing.paperSize = "A4" <br>　factory.printing.paperSource = "Manual feed" <br><br>　// -- basic features <br>　factory.printing.header = "This is MeadCo" <br>　factory.printing.footer = "Advanced Printing by ScriptX" <br>　factory.printing.portrait = false <br>　factory.printing.leftMargin = 1.0 <br>　factory.printing.topMargin = 1.0 <br>　factory.printing.rightMargin = 1.0 <br>　factory.printing.bottomMargin = 1.0 <br>} <br>&lt;/script&gt; <br><br><span style="COLOR: red">（3）</span> <br>&lt;script language="javascript"&gt; <br>　　function printsetup(){ <br>　　// 打印页面设置 <br>　　wb.execwb(8,1); <br>　　} <br>　　function printpreview(){ <br>　　// 打印页面预览 <br>　　　　 <br>　　wb.execwb(7,1); <br>　　　　　 <br>　　　　 <br>　　} <br><br>　　function printit() <br>　　{ <br>　　if (confirm('确定打印吗？')) { <br>　　wb.execwb(6,6) <br>　　} <br>　　} <br>　　&lt;/script&gt; <br>&lt;/head&gt; <br>&lt;body&gt; <br>&lt;OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0&gt;&lt;/OBJECT&gt; <br>&lt;input type=button name=button_print value="打印" onclick="javascript:printit()"&gt; <br>&lt;input type=button　name=button_setup value="打印页面设置" onclick="javascript:printsetup();"&gt; <br>&lt;input type=button　name=button_show value="打印预览" onclick="javascript:printpreview();"&gt; <br>&lt;input type=button name=button_fh value="关闭" onclick="javascript:window.close();"&gt; <br><br>
<img src ="http://www.blogjava.net/Daniel2005/aggbug/125849.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Daniel2005/" target="_blank">泌鲁沙夫</a> 2007-06-22 15:21 <a href="http://www.blogjava.net/Daniel2005/articles/125849.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>