Wednesday, March 7, 2012

Crystal Error

HI ,

I'm trying to print a rpt. file ( C.R. 8.5) from a VB.net program
code :

Dim Reporte As New crAlmacen
Dim x As String = Reporte.FilePath()
Dim x1 As String = Reporte.ResourceName
Reporte.SetDatabaseLogon("termi", "termi", "SERVIDOR1", "mestres")
Reporte.Refresh()
' Reporte.PrintOptions.PrinterName = "Lexmark Optra S 2455"

Reporte.PrintToPrinter(1, False, 1, 1)

An unhandled exception of type 'CrystalDecisions.CrystalReports.Engine.InvalidArgumentException' occurred in crystaldecisions.crystalreports.engine.dll

Additional information: Error in File C:\DOCUME~1\ADMINI~1\CONFIG~1\Temp\temp_50488d2a-21be-4a5a-a4df-ad83112d6274.rpt:
Invalid printer specified.

thanks a lotHI ,

I HAVE SOLVED THE PROBLEM

Dim Reporte As New crAlmacen
Dim x As String = Reporte.FilePath()
Dim x1 As String = Reporte.ResourceName
Reporte.SetDatabaseLogon("termi", "termi", "SERVIDOR1", "mestres")
Reporte.Refresh()

NEW CODE LINE
---------------------
Reporte.PrintOptions.PaperSource = CrystalDecisions.[Shared].PaperSource.Auto
---------------------
' Reporte.PrintOptions.PrinterName = "Lexmark Optra S 2455"
Reporte.PrintToPrinter(1, False, 1, 1)

AND NOW GO RIGHT

BEST REGARDS|||Glad that's sorted :D

No comments:

Post a Comment