Automatically Printing Crystal Reports in ASP.NET
This server-based method is documented in the Visual Studio help files. Open the Help Index, and enter PrintToPrinter in the "Look for:" box. The syntax for this method is:
Report.PrintToPrinter(<copies as int>, <collated as True/False>, <startpage as int>, <endpage as int>)
'Collated' in this context has nothing to do with database collation. Some advanced printers (like copier/printers) will sort each document into its own shelf. Not every printer supports this functionality, so check the printer dialog before setting to true. To print the entire report, set startpage and endpage each to 0.
An example in use might look like
MyReport.PrintToPrinter(1,False,0,0)
One limitation of this method is that a printer name must be specified. You can set the default printer at design time in the report, and you can change the printer name at run time by setting the ReportDocument.PrintOptions.PrinterName property (the PrintOptions are also where you can assign page margins, portrait/landscape, etc.). Keep in mind that this method prints from the server itself, not from the client machine. This means that any printer you wish to use must be accessible from the server. You cannot print to a client's desktop printer using this method unless that printer is shared on the network and mapped to the server.
If your LAN has networked printers, you can make some guesses as to which printer to assign as the default in each report. For instance, if the Accounting Department has a departmental printer, that would be a good choice to use for the default in an accounting report. You can provide users the option to choose a networked printer by enumerating the printers mapped to the server and populating a drop-down list. The PrinterSettings.InstalledPrinters property returns a collection of installed printers, and can be bound to a DropDownList as below.
相关文档:
配置ASP.NET平台时遇到的“访问IIS元数据库失败”
(2007-05-18 09:20:08)
标签:
asp
分类:技术随笔
实习也结束了,最近终于有时间正式地搞毕业设计了……
课题是关于搭建一个基于ASP.NET网站框架的,当然配置开发平台是第一步,装上IIS后,在本地访问.aspx页面时总出现如下报错信息:
访 ......
先看看ASP.NET页面刷新的实现方法:
第一:
C# code
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Redirect( Request.Url.ToString( ) );
}
第二:
C# code
private void Button2_Click( object sender, System.EventArgs e )
{
Response.Write( " < script lang ......
///C#中的媒体播放类
using System;
namespace ConfigTools
{
/// <summary>
/// PlayClass 的摘要说明。
///原作CSDN,经本人稍加修改
/// </summary>
public class PlayClass
{
public PlayClass()
{
......
这里是我的一个简单的jquery+json的连库操作,只是一个简单查询,
//后台代码
<%@ WebHandler Language="C#" Class="show" %>
using System;
using System.Web;
using System.Collections.Generic;
using Model;
using DAL;
using System.Web.Script.Serialization;
public class show ......
从csdn下载了使用案例,但发现很多人依然会遇到中文文件名乱码的问题,原因如下:
一般在单位的开发中在xml.config文件中都使用gb2312,如下:
<globalization responseEncoding="gb2312" requestEncoding="gb2312"/>
而swfupload是按照utf-8来编码的,所以你需要在使用sufupload的程序文件目录下重新 ......