-
Apr 28th, 2017, 02:19 PM
#1
Thread Starter
New Member
print without preview the crystal report
Hi,
I am trying to send my crystal report directly to a printer without preview. Some how my code is not working. Any help? Thanks.
Here is the code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ds As New System.Data.DataSet
Dim objDataLink As New HSC_College.DataLink
Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
rpt.Load(Server.MapPath("reports\" & Request.QueryString("ReportID") & ".rpt"))
If Request.QueryString("ReportID") = "Clinical_Competency" Then
If Not Request.QueryString("EvaluationID") Is Nothing Then
If Request.QueryString("EvaluationID").ToString.Length > 0 Then
Session("EvaluationID") = Request.QueryString("EvaluationID")
End If
End If
Dim intEvaluationID As Integer = Session("EvaluationID")
ds = objDataLink.spMED_GEN_ReportClinComp(intEvaluationID)
rpt.Database.Tables(0).SetDataSource(ds.Tables(0))
rpt.PrintToPrinter(1, False, 0, 0)
End If
End Sub
-
May 3rd, 2017, 01:27 PM
#2
Re: print without preview the crystal report
Possibly useful link:
https://www.codeproject.com/Question...tplusviewplusr
Code:
RptObject.PrintToPrinter(1, false, 0, 0)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|