I'm currently stuck on trying to fix this printing function on a project i'm working on, i've been trying for quite some time now with no good results. Keep in mind this is an in-house program with non-standard ways of programming, hence I fully expect to not get an answer if it's just too far complicated to understand with a block of code.
With CrystalReport2
.Connect = oItemUtil.oDBItem.CrystalRptConnection 'sReportConnect
Select Case oItemUtil.AccountType
Case "Comm" .ReportFileName = My.Application.Info.DirectoryPath & "\Reports\item.rpt"
Case Else
.ReportFileName = My.Application.Info.DirectoryPath & "\Reports\item2.rpt"
End Select
.SelectionFormula = "{Itemizations.Account_Number} = '" & oItemUtil.Account & "'"
If Trim(oItemUtil.StartDate) <> "" Then
.SelectionFormula = "{Itemizations.account_number} = '" & oItemUtil.Account & "'"
.SelectionFormula = .SelectionFormula & " And {Itemizations.Trans_Date} >= date("
.SelectionFormula = .SelectionFormula & VB6.Format(oItemUtil.StartDate, "yyyy, mm, dd") & ") and {Itemizations.Trans_Date} < date("
.SelectionFormula = .SelectionFormula & VB6.Format(DateAdd(Microsoft.VisualBasic.DateInterval.Day, 1, CDate(oItemUtil.EndDate)), "yyyy,mm,dd") & ")"
End If
If bPrintPreview Then
.WindowShowPrintSetupBtn = True
.Destination = Crystal.DestinationConstants.crptToWindow
Else
.Destination = Crystal.DestinationConstants.crptToPrinter
End If
.Action = 1
End With
lblStatus.Text = "Printing Complete"
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
Exit Sub
The program errors out when it hits the .Action = 1 line of code, i'm not sure of another way to get around this error, i'm not very familiar with integrating crystal reports into a vb.net program so if there's a better way to go about showing a crystal report viewer i'd love to hear it. There was nothing helpful on the internet about my specific error.
If this is fixable, however, that would be preferred, I've just spent too much time on this error and have came up with no progress I would love to know the way to get this route working.
Any info, hints, etc would be greatly appreciated, I want to tackle this thing and get it over with.
Thanks
Attached File(s)
-
printinIssue.doc (32K)
Number of downloads: 13

New Topic/Question
Reply



MultiQuote




|