PC Review


Reply
Thread Tools Rate Thread

Crystal Reports: Margins problem

 
 
Ioannis Demetriades
Guest
Posts: n/a
 
      20th May 2004
Hi,


I have a crystal report that prints OK when I send the report directly to
the printer. If i display the report on the screen and then click on the
print icon I get the first couple of characters of each line chopped off on
the printout.
(I am always printing on the same printer and using the same printer driver)

PS: I am using VS.NET 2003 and the version of crystal that ships along with
vs.net 2003


Thanks
Ioannis Demetriades

===== CODE ========
Friend Sub ShowReport(ByVal ReportName As String, ByVal ds As DataSet, ByVal
ParentForm As Form, ByVal ReportCaption As String, ByVal
SendToPrinterDirectly As Boolean, Optional ByVal PrinterName As String = "",
Optional ByVal Parent_AS_Owner As Boolean = False)
Dim StrMsg As String = " ** Unable to Print ** "
Dim Flag As Boolean = False
Try
Dim r As New
CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim FileName As String

'All the reports are expected to be located in
'in a subdir called \Reports within the
'current working directory
'FileName = Application.StartupPath & "\Reports\" & ReportName
FileName = Application.StartupPath & "\Reports\" & ReportName
'Filename = application.

r.Load(FileName)
Flag = True
If PrinterName <> "" Then
'Make sure the specified printer is valid
'IsValidPrinter: Sets PrinterName to the default printer
'if the specified printername is not a valid printer
If IsValidPrinter(PrinterName) Then
r.PrintOptions.PrinterName = PrinterName
End If
End If
r.SetDataSource(ds)
ds.Dispose()


If SendToPrinterDirectly Then
r.PrintToPrinter(1, False, 0, 0)
Else

Dim CrystalForm As New CrystalReportForm
If Parent_AS_Owner Then
CrystalForm.Owner = ParentForm
Else
CrystalForm.MdiParent = ParentForm
End If
CrystalForm.Text = "Report: " & ReportCaption
CrystalForm.CrystalViewer.ReportSource = r

CrystalForm.Show()
CrystalForm.BringToFront()

End If
Catch err As Exception
If Flag Then
ShowException(err, StrMsg)
Else
ShowException(err)
End If

End Try
End Sub



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crystal reports problem in asp.net/vb.net NEWS Microsoft ASP .NET 0 22nd Feb 2007 09:55 AM
Crystal Reports Does Not Display BLOB Field Correctly in IBlobField Control Using Crystal Reports for VS.NET 2003 Jeff Microsoft Dot NET 0 4th May 2006 09:21 PM
Set Crystal Reports Margins at Runtime Wayne Wengert Microsoft VB .NET 0 5th Apr 2005 11:09 PM
Problem with Crystal Reports schapopa Microsoft ASP .NET 3 26th Feb 2005 09:36 AM
Crystal Reports problem Brian Henry Microsoft VB .NET 4 16th Apr 2004 03:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:43 AM.