473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Crystal Reports: Margins problem

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.ReportDocum ent
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

Jul 21 '05 #1
0 2475

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
17
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far says it's a .net problem. Here's the problem, we're...
0
by: Wayne Wengert | last post by:
I am using VB in VSNET 2003 and I have a project that includes some reports imported from Crystal Reports 10. Everything works fine but I need to change the margins at runtime and I can't find the...
0
by: Ioannis Demetriades | last post by:
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...
1
by: Lyners | last post by:
Hello all, I have created an ASP.NET website that uses Crystal Reports that works on the localhost (my PC), but when I copy it to the server it does not. The problem is...
0
by: vinamb2006 | last post by:
yes,Iam using button onclick event. the code is as under 'PrintReport() prtdoc.PrinterSettings.PrinterName = comboInstalledPrinters.SelectedItem.Text Dim...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.