All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
Sql,Server数据库定时自动备份_[SQL,Server教程]
SQL,Server,7.0,入门(三)_mssql学习_编程技术
保护,SQL,Server,数据库的十大绝招_[SQL,Server教程]
PHP实例:用PHP将mysql数据表转换为excel文件格式_[PHP教程]
从草根到大腕,PHP技术发展历程_php资料_编程技术
visual c++中滚动视图的使用
FreeBSD5.3下安装Apache+PHP+MySQL+Tomcat_php资料_编程技术
php5.0升级5.2全过程_php资料_编程技术
VS,2008和.NET,3.5,Beta2新特性介绍_[Asp.Net教程]
《Effective,C#》:值类型和引用类型_[Asp.Net教程]
Reading number is top 10 pictures
The money of more than 100 countries and regions21
The real super beauty3
The little woman's bright wire3
陪睡门马睿菈自曝写真 称首拍大尺度照片1
男人巳快沦落成动物了
抗日又出雷剧情
乳娘帕梅拉安德森2
Is said to be a Chinese female artist fame explicit pictures before2
职场回春术
A man's favorite things15
Download software ranking
linux高级编程
网络管理员第三版
The Bermuda triangle3
Boxer vs Yellow5
超级战舰
好色的外科大夫
Jinling thirteen stock
致我们终将逝去的青春
The king of fighters 97(Mobile phone games-apk)
功夫熊猫2(上集)
delv published in(发表于) 2014/1/6 8:49:06 Edit(编辑)
Asp.net,水晶报表之打印和导出格式_[Asp.Net教程]

Asp.net,水晶报表之打印和导出格式_[Asp.Net教程]

Asp.net 水晶报表之打印和导出格式_[Asp.Net教程]

在ASP.NET中水晶报表没有象在Windows Form中那样提供报表的导出和打印功能,需要我们自己动手添加代码来控制,下面给个DEMO:

  导出:
myReport ReportDoc = new myReport();//表表的名称
private void btnExport_Click(object sender, System.EventArgs e)
{
CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new CrystalDecisions.Shared.DiskFileDestinationOptions();
ReportDoc.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
switch (DropDownList1.SelectedItem.Text)
{
case "Rich Text (RTF)":
  ReportDoc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.RichText;
  DiskOpts.DiskFileName = "d:\\demo.rtf";
break;
case "Portable Document (PDF)":
  ReportDoc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
  DiskOpts.DiskFileName = "d:\\demo.pdf";
break;
case "MS Word (DOC)":
  ReportDoc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
  DiskOpts.DiskFileName = "d:\\demo.doc";
break;
case "MS Excel (XLS)":
  ReportDoc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.Excel;
  DiskOpts.DiskFileName = "d:\\demo.xls";
break;
default:
break;
}
ReportDoc.ExportOptions.DestinationOptions = DiskOpts;
  ReportDoc.Export();
}

  打印:
private void btnPrint_Click(object sender, System.EventArgs e)
{
string strPrinterName; // 指定打印机名称
strPrinterName = @"Canon Bubble-Jet BJC-210SP";
PageMargins margins; // 设置打印页边距
margins = ReportDoc.PrintOptions.PageMargins;
margins.bottomMargin = 250;
margins.leftMargin = 350;
margins.rightMargin = 350;
margins.topMargin = 450;
ReportDoc.PrintOptions.ApplyPageMargins(margins);
ReportDoc.PrintOptions.PrinterName = strPrinterName; //应用打印机名称
// 打印报表.startPageN 和 endPageN
// 参数设置为 0 表示打印所有页。
ReportDoc.PrintToPrinter(1, false,0,0);
}


来源:网页教学网







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.