473,385 Members | 1,673 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,385 software developers and data experts.

Crystal Reports printing error

Hi,
I'm having problemes printing with Crystal Reports using VB.NET.Whenever I try printing on the local printer, when I don'tspecify a PrinterName, everything works fine. However, when Ichange the PrinterName, it always gives me the same error"Object reference not set to an instance of an object". I'vetried looking on the CR website but the only fix they give isfor Windows 98/ME and I'm running Windows 2000. I know thatCrystal Reports needs the complete and exact printer name.

Here's my code :

Dim rptDemande As RapportDemande
rptDemande = New RapportDemande
Dim ds As New DataSet
Dim daRapportCrystal As New SqlDataAdapter
daRapportCrystal.SelectCommand = New SqlCommand
daRapportCrystal.SelectCommand.CommandText ="procRapportDemande"
daRapportCrystal.SelectCommand.CommandType =CommandType.StoredProcedure
daRapportCrystal.SelectCommand.Connection =SqlConnection1
daRapportCrystal.SelectCommand.Parameters.Clear()
daRapportCrystal.SelectCommand.Parameters.Add("@No ",intNoCommande)
Try
daRapportCrystal.Fill(ds, "procRapportDemande")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
rptDemande.Load()
rptDemande.SetDataSource(ds)
rptDemande.PrintOptions.PrinterName =ConfigurationSettings.AppSettings("printerApprovi sionnement")
rptDemande.PrintToPrinter(1, False, 0, 0)
rptDemande.Close()

whereConfigurationSettings.AppSettings("printerApp rovisionnement") is
<add key="printerApprovisionnement"value="\\bl_proxy1\b lmagi3" />

Thank you very much

--------------------------------
From: Anne-Marie Buki

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>DOkQaYtpWkSP+B4fRCuS/Q==</Id>
Nov 21 '05 #1
0 1031

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...
0
by: Pierre | last post by:
hey everyone i have a project with 1 crystal reports, for printing the data in a tabel. but when i run it, and i want to print the report , i get the error:"a crystal reports job failed because...
7
by: Robert Schuldenfrei | last post by:
Dear NG, I am just learning object orientated programing in general and C# in particular. My first real project is an inventory application using a SQL database. I have an item master editor...
7
by: Sink | last post by:
Hi, Looking at reporting tools and was wondering if anyone else has gone thru this. Crystal seems rediculously expensive once you take into account licensing, while Active is runtime-free meaning...
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....
7
by: mrwoopey | last post by:
I have a asp.net application that uses the crystal report viewer control. It displays all of my reports but all of a sudden it started giving me the following error on ONLY two reports: "Fail...
0
by: John Smith | last post by:
Hello, I have 7 different crystal reports that need to be collated. Since I want to end up with a page of each (which all together make a single report), I created a blank main report and then...
1
by: Kbalz | last post by:
Having a really hard time finding solid examples on deploying a CR .NET applcation on my intranet. I'll explain what I've done so far, and toward the bottom is where I can't print using the report...
3
by: Peter | last post by:
I have .NET3.5 Windows Service application which prints Crystal Reports and once in a while I get the following error, if I try to print right after the error everything works just fine. Does...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.