服务端导出为 pdf doc
服务器连接的打印机打印(对客户端要授权,显然实际用处不大,网吧时)
各位老大,有什么高招呀? 急
17 个解决方案
#1
http://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/episode.aspx?newsID=1242276
#2
水晶报表10企业版
支持打印功能
支持打印功能
#3
直接用CSS, 画在web上然后打印吧
#4
http://www.weste.net/2004/12-20/11440068743.html
可以导入excel
可以导入excel
#5
up
#6
report service 实现吧,不过只能用 sqlserviec 数据库...
到 ms 网站上找找...
到 ms 网站上找找...
#7
水晶报表导出为pdf,doc,xls格式
//ddlFileType为Dropdownlist控件,里面有3项,击pdf,doc,xls,供下面判断
string filetype = "";
filetype = ddlFileType.SelectedValue;
string contenttype = "";
string myfilename = Request.MapPath(".")+"\\ReportExportFile\\"+Session.SessionID+"."+filetype;//路径
CrystalDecisions.Shared.DiskFileDestinationOptions mydiskfiledestinationoptions = new CrystalDecisions.Shared.DiskFileDestinationOptions();
mydiskfiledestinationoptions.DiskFileName = myfilename;
CrystalDecisions.Shared.ExportOptions myExportOptions = myreport.ExportOptions;
myExportOptions.DestinationOptions = mydiskfiledestinationoptions;
myExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
switch(ddlFileType.SelectedItem.Value)
{
case "pdf":
contenttype = "application/pdf";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
break;
case "doc":
Response.ContentType = "application/ms-excel";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
break;
case "xls":
contenttype = "application/vnd.ms-excel";
this.EnableViewState = false;
myExportOptions.ExportFormatType =CrystalDecisions.Shared.ExportFormatType.Excel;
break;
}
myreport.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = contenttype;
Response.WriteFile(myfilename);
Response.Flush();
Response.Close();
System.IO.File.Delete(myfilename);
//ddlFileType为Dropdownlist控件,里面有3项,击pdf,doc,xls,供下面判断
string filetype = "";
filetype = ddlFileType.SelectedValue;
string contenttype = "";
string myfilename = Request.MapPath(".")+"\\ReportExportFile\\"+Session.SessionID+"."+filetype;//路径
CrystalDecisions.Shared.DiskFileDestinationOptions mydiskfiledestinationoptions = new CrystalDecisions.Shared.DiskFileDestinationOptions();
mydiskfiledestinationoptions.DiskFileName = myfilename;
CrystalDecisions.Shared.ExportOptions myExportOptions = myreport.ExportOptions;
myExportOptions.DestinationOptions = mydiskfiledestinationoptions;
myExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
switch(ddlFileType.SelectedItem.Value)
{
case "pdf":
contenttype = "application/pdf";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
break;
case "doc":
Response.ContentType = "application/ms-excel";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
break;
case "xls":
contenttype = "application/vnd.ms-excel";
this.EnableViewState = false;
myExportOptions.ExportFormatType =CrystalDecisions.Shared.ExportFormatType.Excel;
break;
}
myreport.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = contenttype;
Response.WriteFile(myfilename);
Response.Flush();
Response.Close();
System.IO.File.Delete(myfilename);
#8
sunnystar365(一个人的天空) 的方法是对的,把水晶报表导出成pdf再发送给客户端。只要客户端装有
Adobe Acrobat就可以了。效果特别好,要保存或者打印都可以在客户端实现。这是推荐的asp.net报表打印方法.
Adobe Acrobat就可以了。效果特别好,要保存或者打印都可以在客户端实现。这是推荐的asp.net报表打印方法.
#9
Dim myReport As New ReportDocument
myReport = New rsglreport
'rsglreport为制作好的水晶报表文件名,一定要加入解决方案中。
CrystalReportViewer1.DisplayToolbar = False
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
myExportFile = "C:\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = myReport.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
myReport.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
这是vb.net的代码,和上面的C#代码差不多了。楼主可以参考一下。
myReport = New rsglreport
'rsglreport为制作好的水晶报表文件名,一定要加入解决方案中。
CrystalReportViewer1.DisplayToolbar = False
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
myExportFile = "C:\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = myReport.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
myReport.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
这是vb.net的代码,和上面的C#代码差不多了。楼主可以参考一下。
#10
1.直接用table画,然后调用ie的打印功能.
2.crystalreport导出pdf,然后打印.
前一种偶用过,不过有一定的局限性.
2.crystalreport导出pdf,然后打印.
前一种偶用过,不过有一定的局限性.
#11
第一种我也用过,画一个TABLE就可以了
#12
还是用水晶报表表,功能算很强大了,只要客户端装有Adobe Acrobat就可以
#13
顶,我今天也开始做报表.win程序我都是用PrintDocument做报表,web程序还不知道怎么做.
#14
感谢大家的热心,两天内结贴。
看来,服务端水晶报表生成pdf ,doc,客户端下载,可能是报表质量比较高的一种,
也许到成 doc, xls 要好一些,在客户端收到后,也可以再加工一下
看来,服务端水晶报表生成pdf ,doc,客户端下载,可能是报表质量比较高的一种,
也许到成 doc, xls 要好一些,在客户端收到后,也可以再加工一下
#15
doc, xls格式不太好。doc每个字段是一个标签,有时候显示不完整。xls显示的表格很不规则,编辑也很麻烦的。我感觉导成pdf的打印效果最好,这也是asp.net报表打印的最佳方法。
#16
我来正在找这种方法,我画的报表是用是 table TR和TD 组合出来的,累死了。
如何打印时只打印表格而不打印页面上的,按扭。
如何打印时只打印表格而不打印页面上的,按扭。
#17
CrystalReportViewer1.DisplayToolbar = False
#1
http://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/episode.aspx?newsID=1242276
#2
水晶报表10企业版
支持打印功能
支持打印功能
#3
直接用CSS, 画在web上然后打印吧
#4
http://www.weste.net/2004/12-20/11440068743.html
可以导入excel
可以导入excel
#5
up
#6
report service 实现吧,不过只能用 sqlserviec 数据库...
到 ms 网站上找找...
到 ms 网站上找找...
#7
水晶报表导出为pdf,doc,xls格式
//ddlFileType为Dropdownlist控件,里面有3项,击pdf,doc,xls,供下面判断
string filetype = "";
filetype = ddlFileType.SelectedValue;
string contenttype = "";
string myfilename = Request.MapPath(".")+"\\ReportExportFile\\"+Session.SessionID+"."+filetype;//路径
CrystalDecisions.Shared.DiskFileDestinationOptions mydiskfiledestinationoptions = new CrystalDecisions.Shared.DiskFileDestinationOptions();
mydiskfiledestinationoptions.DiskFileName = myfilename;
CrystalDecisions.Shared.ExportOptions myExportOptions = myreport.ExportOptions;
myExportOptions.DestinationOptions = mydiskfiledestinationoptions;
myExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
switch(ddlFileType.SelectedItem.Value)
{
case "pdf":
contenttype = "application/pdf";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
break;
case "doc":
Response.ContentType = "application/ms-excel";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
break;
case "xls":
contenttype = "application/vnd.ms-excel";
this.EnableViewState = false;
myExportOptions.ExportFormatType =CrystalDecisions.Shared.ExportFormatType.Excel;
break;
}
myreport.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = contenttype;
Response.WriteFile(myfilename);
Response.Flush();
Response.Close();
System.IO.File.Delete(myfilename);
//ddlFileType为Dropdownlist控件,里面有3项,击pdf,doc,xls,供下面判断
string filetype = "";
filetype = ddlFileType.SelectedValue;
string contenttype = "";
string myfilename = Request.MapPath(".")+"\\ReportExportFile\\"+Session.SessionID+"."+filetype;//路径
CrystalDecisions.Shared.DiskFileDestinationOptions mydiskfiledestinationoptions = new CrystalDecisions.Shared.DiskFileDestinationOptions();
mydiskfiledestinationoptions.DiskFileName = myfilename;
CrystalDecisions.Shared.ExportOptions myExportOptions = myreport.ExportOptions;
myExportOptions.DestinationOptions = mydiskfiledestinationoptions;
myExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
switch(ddlFileType.SelectedItem.Value)
{
case "pdf":
contenttype = "application/pdf";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
break;
case "doc":
Response.ContentType = "application/ms-excel";
myExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows;
break;
case "xls":
contenttype = "application/vnd.ms-excel";
this.EnableViewState = false;
myExportOptions.ExportFormatType =CrystalDecisions.Shared.ExportFormatType.Excel;
break;
}
myreport.Export();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = contenttype;
Response.WriteFile(myfilename);
Response.Flush();
Response.Close();
System.IO.File.Delete(myfilename);
#8
sunnystar365(一个人的天空) 的方法是对的,把水晶报表导出成pdf再发送给客户端。只要客户端装有
Adobe Acrobat就可以了。效果特别好,要保存或者打印都可以在客户端实现。这是推荐的asp.net报表打印方法.
Adobe Acrobat就可以了。效果特别好,要保存或者打印都可以在客户端实现。这是推荐的asp.net报表打印方法.
#9
Dim myReport As New ReportDocument
myReport = New rsglreport
'rsglreport为制作好的水晶报表文件名,一定要加入解决方案中。
CrystalReportViewer1.DisplayToolbar = False
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
myExportFile = "C:\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = myReport.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
myReport.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
这是vb.net的代码,和上面的C#代码差不多了。楼主可以参考一下。
myReport = New rsglreport
'rsglreport为制作好的水晶报表文件名,一定要加入解决方案中。
CrystalReportViewer1.DisplayToolbar = False
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
myExportFile = "C:\" & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = myReport.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
myReport.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
这是vb.net的代码,和上面的C#代码差不多了。楼主可以参考一下。
#10
1.直接用table画,然后调用ie的打印功能.
2.crystalreport导出pdf,然后打印.
前一种偶用过,不过有一定的局限性.
2.crystalreport导出pdf,然后打印.
前一种偶用过,不过有一定的局限性.
#11
第一种我也用过,画一个TABLE就可以了
#12
还是用水晶报表表,功能算很强大了,只要客户端装有Adobe Acrobat就可以
#13
顶,我今天也开始做报表.win程序我都是用PrintDocument做报表,web程序还不知道怎么做.
#14
感谢大家的热心,两天内结贴。
看来,服务端水晶报表生成pdf ,doc,客户端下载,可能是报表质量比较高的一种,
也许到成 doc, xls 要好一些,在客户端收到后,也可以再加工一下
看来,服务端水晶报表生成pdf ,doc,客户端下载,可能是报表质量比较高的一种,
也许到成 doc, xls 要好一些,在客户端收到后,也可以再加工一下
#15
doc, xls格式不太好。doc每个字段是一个标签,有时候显示不完整。xls显示的表格很不规则,编辑也很麻烦的。我感觉导成pdf的打印效果最好,这也是asp.net报表打印的最佳方法。
#16
我来正在找这种方法,我画的报表是用是 table TR和TD 组合出来的,累死了。
如何打印时只打印表格而不打印页面上的,按扭。
如何打印时只打印表格而不打印页面上的,按扭。
#17
CrystalReportViewer1.DisplayToolbar = False