Click to See Complete Forum and Search --> : Crystal Error


HELENAVI
August 4th, 2005, 03:49 AM
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 lot

HELENAVI
August 4th, 2005, 05:13 AM
HI ,

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

Martijnbm
August 4th, 2005, 09:10 AM
Glad that's sorted :D