在ActiveReport中如何直接打印,而不进行预览?

zhaoliang_dlmedu 2005-03-02 04:14:54
我做的是webform,点打印按钮后,利用ActiveReport直接进行打印,而不在ie中进行预览,请高人指点!!
...全文
416 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhaoliang_dlmedu 2005-03-08
  • 打赏
  • 举报
回复
//这是源代码
using System;
using System.Data;
using System.Net.Sockets;
using DataDynamics.ActiveReports;
namespace Flt.JM00000BC
{
public class Flt_JM00000BC
{

public static bool PrintActiveReport(Object objTextFile)
{
//test
DataSet myDataSet = null;
DataTable MyDataTable = null;

bool bolPrintSuccess = false;

try
{
myDataSet = (DataSet)objTextFile;
MyDataTable = myDataSet.Tables["test"];

Flt.EUL001.Flt_EUL001 rpt = new Flt.EUL001.Flt_EUL001(); //MyActiveReport
rpt.DataSource = MyDataTable;
rpt.Run(true);
rpt.Document.Print(false,false);
}
catch(Exception e)
{
Console.Write(e.Message);
}
return(bolPrintSuccess);
}
}
}
zhaoliang_dlmedu 2005-03-08
  • 打赏
  • 举报
回复
using System;
using System.Data;
using System.Net.Sockets;
using DataDynamics.ActiveReports;
namespace Flt.JM00000BC
{
public class Flt_JM00000BC
{

public static bool PrintActiveReport(Object objTextFile)
{
//test
DataSet myDataSet = null;
DataTable MyDataTable = null;

bool bolPrintSuccess = false;

try
{
myDataSet = (DataSet)objTextFile;
MyDataTable = myDataSet.Tables["test"];

Flt.EUL001.Flt_EUL001 rpt = new Flt.EUL001.Flt_EUL001(); //MyActiveReport
rpt.DataSource = MyDataTable;
rpt.Run(true);
rpt.Document.Print(false,false);

// rpt.Document.Print(false,false,true);
// rpt.Document.Print();
//
// rpt.Run();
// rpt.Document.Save("C:\\Inetpub\\wwwroot\\PHOENIX\\ReportOutput\\Flt_EUL001.rdf", DataDynamics.ActiveReports.Document.RdfFormat.AR20);
// rpt.Document.Load("C:\\Inetpub\\wwwroot\\PHOENIX\\ReportOutput\\Flt_EUL001.rdf");
// rpt.Document.Print(false,false);
}
catch(Exception e)
{
Console.Write(e.Message);
}
return(bolPrintSuccess);
}
}
}
这是我做的打印方法,当rpt.Document.Print(false,false);时,没有异常,但是打印机没有打印,rpt.Document.Printer属性中PrinterName:“已经设定的打印机无效“,VisibleBounds:"有异常产生{System.Drawing.Printing.InvalidPrinterException}";当rpt.Document.Print(true,false);时,
有执行异常:“Application 的 UserInteractive mode 没有执行、model dialog 的 form 不能表示。显示从 server application 得到的通知 、将 ServiceNotification 的 style 指定为 DefaultDesktopOnly 。”。因为是第一次使用C#的class调用activereport打印,没有找到相关的例子,对于出现的问题不知如何解决,请高人指点!!
zhaoliang_dlmedu 2005-03-08
  • 打赏
  • 举报
回复
using System;
using System.Data;
using System.Net.Sockets;
using DataDynamics.ActiveReports;
namespace Flt.JM00000BC
{
public class Flt_JM00000BC
{

public static bool PrintActiveReport(Object objTextFile)
{
//test
DataSet myDataSet = null;
DataTable MyDataTable = null;

bool bolPrintSuccess = false;

try
{
myDataSet = (DataSet)objTextFile;
MyDataTable = myDataSet.Tables["test"];

Flt.EUL001.Flt_EUL001 rpt = new Flt.EUL001.Flt_EUL001(); //MyActiveReport
rpt.DataSource = MyDataTable;
rpt.Run(true);
rpt.Document.Print(false,false);

// rpt.Document.Print(false,false,true);
// rpt.Document.Print();
//
// rpt.Run();
// rpt.Document.Save("C:\\Inetpub\\wwwroot\\PHOENIX\\ReportOutput\\Flt_EUL001.rdf", DataDynamics.ActiveReports.Document.RdfFormat.AR20);
// rpt.Document.Load("C:\\Inetpub\\wwwroot\\PHOENIX\\ReportOutput\\Flt_EUL001.rdf");
// rpt.Document.Print(false,false);
}
catch(Exception e)
{
Console.Write(e.Message);
}
return(bolPrintSuccess);
}
}
}
这是我做的打印方法,当rpt.Document.Print(false,false);时,没有异常,但是打印机没有打印,rpt.Document.Printer属性中PrinterName:“已经设定的打印机无效“,VisibleBounds:"有异常产生{System.Drawing.Printing.InvalidPrinterException}";当rpt.Document.Print(true,false);时,
有执行异常:“Application 的 UserInteractive mode 没有执行、model dialog 的 form 不能表示。显示从 server application 得到的通知 、将 ServiceNotification 的 style 指定为 DefaultDesktopOnly 。”。因为是第一次使用C#的class调用activereport打印,没有找到相关的例子,对于出现的问题不知如何解决,请高人指点!!
whmjw 2005-03-03
  • 打赏
  • 举报
回复
rptTest rpt=new rptTest();
rpt.DataSource=dt;
rpt.Run(true);
rpt.Document.Print(true,false);
zhaoliang_dlmedu 2005-03-02
  • 打赏
  • 举报
回复
Symptoms: The WebViewer will not automatically print a report without displaying it.
Cause: The WebViewer provides convenience in automating many of the steps involved in providing a
reporting solution, but the cost of this automation is a loss of control of these steps.
Solution: In order to provide no touch printing in ASP.NET, stream the file to the ActiveX viewer control
and then print using vbscript in the ASP code (not the ASP code behind).
1. Place the ActiveX Control on the page as an object. Setting the version to -1,-1,-1,-1 forces Internet
Explorer to check for updates each time the page is rendered. Setting the height and width to 0
allows you to print the report without displaying it. Here is the code that goes in the ASPX page:
<OBJECT id=arv codeBase=bin/arview2.cab#version=-1,-1,-1,-1
height=0
width=0
classid=CLSID:8569d715-ff88-44ba-8d1d-ad3e59543dde>
2. Load the data into the report. Set the DataPath of the viewer object. This can be anything from a
byte array to a hard coded path:
<script language=vbscript>
<!--
sub window_onload()
arv.datapath = "Default.aspx?ReturnReport=1"
end sub
3. Print the report. This is done by syncing the LoadCompleted event of the viewer. Inside a call is made
to the Viewer's PrintReport method with False indicating that no UI is to be displayed:
sub arv_loadcompleted()
arv.PrintReport False
end sub
-->
</script>
这是帮助文档上的说明,我有个几个问题没弄懂
1.asp页面代码编辑窗口,在对象口中,windows、form对象可以显示,但是我自己声明的arv对象不是道啥时候显示、啥时候不显示
2.当arv对象选中后,事件窗口没有arv_loadcompleted()方法,其他的方法可以看到,我用的是C#自己添加如下代码:但是不能自动调用
function arv_loadcompleted()
{
arv.PrintReport(false);
}
3.原码中arv.datapath = "Default.aspx?ReturnReport=1"这个Default.aspx是个啥样的asp页面不大清楚,里面有啥没啥就更没头脑了,我做了如下修改:不知道是否合理
function window_onload(){
arv.datapath = "OutputReport/myactivereport.rtf";
}
请高人指点迷经!!!
 支持ASP.NET-ActiveReports在WebForms应用程序通过使用ASP.NET 服务器控件来使用。这个控件支持分布式web报表,可使用HTML,ActiveX,.NET 和PDF浏览器。完全代码集成-使用Microsoft Visual Studio.NET编辑器用C#或VB.NET编写报表的代码,非常灵活。报表向导-报表向导帮助您开始创建使用集成设计器来定制的简单报表。设计器-对象模版完全显现的对象模版。允许您动态的建立和修改报表Report Creation API提供了完整的运行时访问报表对象和成员功能。最终用户报表设计器终端用户设计器为您提供了向您应用程序加入设计器的功能,同时提供了终端用户报表编辑功能。控件的方法和属性能方便的存储和加载报表布局,监测和控制设计环境,并可根据终端用户的需要定制外观。与ASP.NET集成Web浏览器控件为您提供了web上的快速浏览ActiveReports 以及打印功能,并具有ActiveX浏览器和Acrobat Reader 浏览器类型的属性。RPX 文件HTTP处理器为您提供了在web服务器上轻松的放置报表的功能,并可使您的Internet用户采用HTML 或PDF进行浏览,而不需要编写任何代码。编译的报表HTTP处理器提供了直接访问服务器的程序集编译的ActiveReports,而不需要编写任何ASPX页面。发布-容易部署报表引擎是一个简单处理强名称程序集。程序集可以使用XCopy发布或放置于程序集全局存储器(GAC)。专业版包括HTTP 处理器和服务器并行web控件,用于ASP.NET 报表。设计器-容易学习与.NET 环境完全集成熟悉的用户界面支持C#和Visual Basic.NET报表将作为您应用程序的一部分进行编译,以加快处理速度,增强安全性,并且用户可以有选择的分别发布。初学者报表向导和Microsoft Access 报表导入向导设计器拥有第三方控件(图表控件,图像控件等)。数据访问-容易连接包括OLEDB和SqlClient报表数据源包括灵活的xml数据源绑定到Dataset,DataView,DataTable和任何IListSource 控件数据源属性能在运行时修改,生成ad hoc(动态)报表灵活的非绑定数据预览和输出-容易显示支持C#代码小型部署程序集,适用于Internet 上使用TOC/Bookmarks超链接输出过滤文件格式为RTF、PDF、EXCEL、HTML、TIFF 和文本文件。
1,mruxdzip.exe
在菜单上最近打开文件的历史记录控件(1453KB)
2,applogger.zip
具有删除到回收站、读写 INI 文件、计算剩余磁盘空间,复制文件和添加到 Windows 文档列表(57KB)
3,ccrpbd10.zip
Windows 游览对话框控件(75KB)
4,ccrpdrg.zip
增强了的列表框控件(71KB)
5,ccrpfd.zip
Windows 文件对话框控件,功能强劲,可制作出 VB 的文件对话框(95KB)
6,ccrphky.zip
键盘控件(69KB)
7,ccrpprg.zip
进程杆控件(150KB)
8,ctlist.exe
一个增强的 ListView 控件(376KB)
9,ctlistbar.exe
Microsoft Outlook 风格的列表框控件(287KB)
10,cttree.exe
一个增强的 TreeView 控件(424KB)
11,dprogressw.exe
DameWare 公司出品进程杆控件(177KB)
12,proplistw.exe
DameWare公司出品类似 VB 的属性列表控件(291KB)
13,buttnbar6.zip
Outlook 列表框控件(700KB)
14,fsi.zip
系统信息控件(24KB)
15,fsshr20d.exe
应用程序交换数据控件,不需要使用 DDE,COM 和剪贴板(289KB)
16,gbarocx.zip
进程杆控件(171KB)
17,graphic.zip
不需要调用 API ,创建一个 Office Ani 精灵助手(50KB)
18,ctlbar.ZIP
用过Oicq的用户,一定熟悉这个控件(59KB)
19,big2gb.zip
一个BIG5码<=>GB码互换的完全免费的ActiveX控件(81KB)
20,capscreen.zip
这是一个屏幕拷贝的控件,可以实现全屏的拷贝并支持另存为位图类型的文件 (28KB)
21,digital.zip
能够以液晶字体方式显示数字的一个小控件(15KB)
22,eqpro.zip
一个调整系统音量的控件,控制音量包括;很方便地控制,控件也很小巧(15KB)
23,flatbar.zip
一个工具栏控件,可变VB5.0的工具栏为Office或IE类型的平面工具栏(27KB)
24,lyftools.zip
这是一个封装了500多个Windows API的控件(229KB)
25,masflc.zip
一个用来播放 FLC,FLI 的 3DS 动画格式控件(60KB)
26,xzipdemo.zip
Xceed Zip控件 (98KB)
27,lfbb.zip
兰花打印控件(预览打印输出,它支持多列,文本自动换行,页头和页尾,表格及段落)(186KB)
28,keyboard.zip
检测键盘按键控件(13KB)
29,winapi.zip
这是一个封装了部分Windows API的控件(例如:发EMail、改变分辨率等)(92KB)
30,dbdemo.zip
3D立体按钮控件(138KB)
31,spelltxt.zip
一个文档拼音检查的控件(337KB)
32,swflash.zip
播放的Flash文件的控件(160KB)
33,185.zip
EasySound 一个封装了DirectSound API的控件 (565KB)
34,157.zip
子分类控件,包含控件源码(44KB)
35,132.zip
MikoUtil系列控件(184KB)
36,109.zip
GB-Big5语言编码转换的控件源码(39KB)
37,108.zip
微软的DirectX 7 for VB开发库文件(187KB)
38,11.zip
MsgHook 用于子分类、截获消息的控件(147KB)
39,c1.zip
Windows 9x注册表控件(35KB)
40,c8.zip
只要点击就可以打开超连接的控件(10KB)
41,c9.zip
GIF98(24KB)
42,c10.zip
sysmenu(9KB)
43,c11.zip
小型控件集(40KB)
44,c12.zip
anigif(40KB)
45,cst.zip
圆盘仪表控件 V3.1(4143KB)
46,EZX.zip
让你能在VB使用DirectX的控件,附例子和源代码(1619KB)
47,NCTDesignBox.exe
NCTDesignBox 1.01(513KB)
48,c_arp.zip
Activereport 1.1的破解文件(1KB)
49,clock.zip
显示时间和日期信息控件(5KB)
50,InputeDate.zip
日期输入框控件(13KB)
51,api21.zip
封装了500多个Windows API的控件,覆盖了网络、系统、界面、多媒体、图形、文字等各个方面(261KB)
52,ARRegistry.zip
访问系统注册表的控件(25KB)
53,isysinfo.zip
是一个可以获得系统信息的ActiveX控件,该控件是由VB5.0编写,使用这个控件可以获得系统的内存大小、CPU类型、显示器的分辩率、颜色数系统各个驱动器、CPU占用率、Windows版本等信息 (19KB)
54,MsgHoo32.zip
同样是Windows消息处理控件(22KB)
55,MsgBlst32.zip
这是一个拦截、处理消息的控件(18KB)
56,threed32.zip
一个3D控件(73KB)
57,vfoutbar.zip
这里还有另一个控件 OutLook 风格的 BAR(39KB)
58,ovalbutton.zip
椭圆形按钮控件(8KB)
59,3dbdemo.zip
3D立体按钮控件(138KB)
60,tubPrinter.zip
直接打印DataGrid,ListView,MsFlexGrid(53KB)
61,shape.zip
椭圆、三角、星...形按钮控件(131KB)
62,command.zip
千千平面按钮(35KB)
63,Chat.zip
Chat控件(16KB)

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧