PC Review


Reply
Thread Tools Rate Thread

Crystal Reports printing error

 
 
Anne-Marie Buki via .NET 247
Guest
Posts: n/a
 
      11th Aug 2004
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("printerApprovisionnement")
rptDemande.PrintToPrinter(1, False, 0, 0)
rptDemande.Close()

whereConfigurationSettings.AppSettings("printerApprovisionnement") is
<add key="printerApprovisionnement"value="\\bl_proxy1\blmagi3" />

Thank you very much

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

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

<Id>DOkQaYtpWkSP+B4fRCuS/Q==</Id>
 
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
vb.net printing w/o Crystal Reports steve-russell@hotmail.com Microsoft Dot NET 2 7th Nov 2006 03:47 PM
Crystal Reports not printing skrishnan68@gmail.com Microsoft Dot NET 0 19th Sep 2006 09:57 PM
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
Printing in Crystal Reports ? Shreyas Madwanna Microsoft ASP .NET 0 31st Oct 2003 07:29 AM
Printing Crystal Reports Brian P. Hammer Microsoft Dot NET Framework Forms 0 22nd Sep 2003 04:22 AM


Features
 

Advertising
 

Newsgroups
 


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