自动打印报告 [英] Print Report automatically

查看:98
本文介绍了自动打印报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我使用Visual Studio 2008,并且想自动在reportviewer中打印报告.以下代码我必须打开报告:

Dear All,

I use Visual Studio 2008 and I want to print a report in a reportviewer automatically. The following code I have to open the report:

Dim rptDataSource As New Microsoft.Reporting.WebForms.ReportDataSource
rptDataSource.Name = "dsInvoice_Invoice"
rptDataSource.Value = Me.ObjectDataSource5


Me.ReportViewer.LocalReport.DataSources.Clear()
Me.ReportViewer.LocalReport.DataSources.Add(rptDataSource)

Try
    With Me.ReportViewer.LocalReport
        .ReportPath = "Secure/Reports/" & Request.QueryString("Report") & ".rdlc"
        Dim Parameters(0) As ReportParameter
        Parameters(0) = New ReportParameter("Factuurnummer", Request.QueryString("Factuurnummer"))
        .SetParameters(Parameters)
    End With
Catch ex As Exception
    ErrorHandling("Invoice Load Details -- " & ex.Message.ToString)
End Try



我想在打开页面时自动打印报告.

你能帮我吗?

亲切的问候,

Dennis Huisman



I want to print the report automatically when the page is opened.

Can you please help me?

With kind regards,

Dennis Huisman

推荐答案

您可能需要呈现报告,然后将其发送到PrintDocument对象.

这是WinForms还是基于Web的?
You probably need to render the report and then send it to a PrintDocument object.

Is this WinForms or Web-based?


这篇关于自动打印报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆