473,322 Members | 1,736 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,322 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 2472

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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.