473,787 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(ByVa l ReportName As String, ByVal ds As DataSet, ByVal
ParentForm As Form, ByVal ReportCaption As String, ByVal
SendToPrinterDi rectly 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
CrystalDecision s.CrystalReport s.Engine.Report Document
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.Sta rtupPath & "\Reports\" & ReportName
FileName = Application.Sta rtupPath & "\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 SendToPrinterDi rectly Then
r.PrintToPrinte r(1, False, 0, 0)
Else

Dim CrystalForm As New CrystalReportFo rm
If Parent_AS_Owner Then
CrystalForm.Own er = ParentForm
Else
CrystalForm.Mdi Parent = ParentForm
End If
CrystalForm.Tex t = "Report: " & ReportCaption
CrystalForm.Cry stalViewer.Repo rtSource = r

CrystalForm.Sho w()
CrystalForm.Bri ngToFront()

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

End Try
End Sub

Jul 21 '05 #1
0 2505

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

Similar topics

13
15180
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 designer it shows up very fast. When the report is printed from my application it takes about ten times as long to get the report to appear. When printing straight from the Crystal Reports
3
6917
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
5026
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. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version, which I did, then reran WebSetup.msi and keeps giving me this error. "The installer was interrupted...
19
3882
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 ReuseParameterValuesOnRefresh="True" in a viewer, but it still doesn't work. Did anyone run into this problem. What's the solution? Please help. Thank you
17
8452
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 using crystal reports 9 and vb.net and we're using the crystalrepotViewer to show our reports. But every time we open a report the connection to or sql server remains, so if I open 5 forms with the report viewer I've got 5 sleeping connections in...
0
3134
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 way to do that. If my report is "ActiveReport" and I try the code: ActiveReport.PrintOptions.PageMargins.topMargin = 0.40 I get an error saying that the expression is a value and cannot be the target of expression
0
309
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 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
1
4318
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 ExcelUseConstantColumnWidth = False. On my PC when exporting a report, it works - columns are varible width to fit the field, from the server it does not - I get constant width columns. I suspect it is a DLL issue, but so far all my comparisons are coming out the same.
0
1220
by: vinamb2006 | last post by:
yes,Iam using button onclick event. the code is as under 'PrintReport() prtdoc.PrinterSettings.PrinterName = comboInstalledPrinters.SelectedItem.Text Dim strDefaultPrinter As String = prtdoc.PrinterSettings.PrinterName 'Dim rap As New CrystalDecisions.CrystalReports.Engine.ReportDocument() 'report1.Load("c:\inetpub\wwwroot\ticket\printrpt.rpt") Dim margins As PageMargins
0
9655
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9497
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.