社区
C#
帖子详情
用reportViewer 实现直接打印的功能
ad9329
2008-03-05 09:25:47
我想在用户看到报表的 同时 自动就把报表打印出来。
但查了下 reportViewer. 没有打印功能。
问问高手们。。。。。。如何实现。
...全文
3109
16
打赏
收藏
用reportViewer 实现直接打印的功能
我想在用户看到报表的 同时 自动就把报表打印出来。 但查了下 reportViewer. 没有打印功能。 问问高手们。。。。。。如何实现。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
16 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
kkk444dsfsa
2011-02-10
打赏
举报
回复
如果是server中的rdl呢 要怎么做?
w_p_
2011-01-21
打赏
举报
回复
很好,支持一下~
lppcoding
2010-09-21
打赏
举报
回复
很好很强大,就是不知道怎么改那个字体的大小.
lppcoding
2010-09-21
打赏
举报
回复
多谢啊,这个问题也搞我半天,从来不留言的,特此感谢。
ch5201314zt
2009-08-21
打赏
举报
回复
谢谢楼主 解决一个大问题啊
lyl222
2009-02-03
打赏
举报
回复
不错~学习
shinaterry
2008-03-10
打赏
举报
回复
恭喜
ad9329
2008-03-10
打赏
举报
回复
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
System.Drawing.Imaging.Metafile pageImage = new System.Drawing.Imaging.Metafile(m_streams[m_currentPageIndex]);
e.Graphics.DrawImage(pageImage, 0,0);
m_currentPageIndex++;
e.HasMorePages = (m_currentPageIndex < m_streams.Count);
}
ad9329
2008-03-10
打赏
举报
回复
问题 解决 。。
将
Export(reportViewer1.LocalReport);
m_currentPageIndex = 0;
printDocument1.Print();
/// <summary>
/// 自动打印
/// </summary>
/// <param name="report"></param>
private void Export(LocalReport report)
{
string deviceInfo =
"<DeviceInfo>" +
" <OutputFormat>EMF</OutputFormat>" +
" <PageWidth>8.5in</PageWidth>" +
" <PageHeight>11in</PageHeight>" +
" <MarginTop>0.15in</MarginTop>" +
" <MarginLeft>0.1in</MarginLeft>" +
" <MarginRight>0.1in</MarginRight>" +
" <MarginBottom>0.1in</MarginBottom>" +
"</DeviceInfo>";
Warning[] warnings;
m_streams = new List<Stream>();
report.Render("Image", deviceInfo, CreateStream, out warnings);
foreach (Stream stream in m_streams)
stream.Position = 0;
}
private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek)
{
Stream stream = new FileStream(name + "." + fileNameExtension,
FileMode.Create);
m_streams.Add(stream);
return stream;
}
ad9329
2008-03-07
打赏
举报
回复
或者 有什么报表控件 可以实现 自动打印
shinaterry
2008-03-06
打赏
举报
回复
-_-!!! 我在4楼说的已经是最好的建议, 要么你就改用其它...
ad9329
2008-03-06
打赏
举报
回复
就没人能给我个好的建议???????
shinaterry
2008-03-05
打赏
举报
回复
那你可以使用Reflector反编译ReportViewer查看打印(按钮)调用了什么方法, 然后再利用反射动态调用即可...
ad9329
2008-03-05
打赏
举报
回复
我现在 就是想把 点那一下的动作 用编程实现。
shinaterry
2008-03-05
打赏
举报
回复
^ō^ ReportViewer 不支持直接打印的! 改用其他报表控件...
yifuzhiming
2008-03-05
打赏
举报
回复
看到报表时,还要点一下打印才能行啊
RDLC ReportView
直接
打印
功能
RDLC ReportView 没有
直接
打印
功能
,不过可以通过展现方式来
实现
直接
打印
功能
C#不使用
ReportViewer
直接
打印
Report文件(rdlc)的
实现
代码
C#不使用
ReportViewer
直接
打印
Report文件(rdlc)的
实现
代码 本文和大家讲下C#不使用
ReportViewer
直接
打印
Report文件(rdlc)的
实现
代码,主要讲如何不使用报表预览控件(
ReportViewer
),
直接
将报表的内容在...
ReportViewer
直接
打印
Report文件(rdlc)
本文和大家讲下C#不使用
ReportViewer
直接
打印
Report文件(rdlc)的
实现
代码,主要讲如何不使用报表预览控件(
ReportViewer
),
直接
将报表的内容在
打印
机上
打印
出来。 一般情况下,我们设计好报表后,在程序运行的...
在vs2005中的
ReportViewer
(RDLC报表)中使用
直接
打印
功能
,在vs2005使用
ReportViewer
2008
打算在新的项目中使用Visual Studio 2005中自带的Micosoft
ReportViewer
,但VS2005中的Micosoft
ReportViewer
在浏览的时候不能
直接
打印
,只能先导出为Excel或者PDF文件再使用Excel或PDFReader里边的
打印
实现
打印
,...
C#
110,571
社区成员
642,568
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章