Skip to Content
0
Former Member
Sep 28, 2009 at 12:34 AM

Report developed in Visual Studio 2003 not printing to Fuji Xerox Printer

52 Views

I have a Crystal Report that was developed months ago, that was successfully printing to a specific Printer and Tray, using the commands:

crReport.PrintOptions.PrinterName = "HPPrinter"

crReport.PrintOptions.PaperSource = 259

259 is the Hewlett Packard code for tray 4.

This was effectively forcing the report to print to the HPPrinter, and to tray 4. This is because specific company letterhead was kept in that tray.

My company, about 3 weeks ago, purchased new printers, and these are Fuji Xerox. I have attempted to do the same thing for this Crystal Report. So, the commands are now:

crReport.PrintOptions.PrinterName = "NewFXPrinter"

crReport.PrintOptions.PaperSource = 262

262 is the Fuji Xerox code for tray 4.

However, this does not work for the Fuji Xerox printer now. It is instead picking up the default tray.

I have contacted Fuji Xerox to ask them to assist, but they do not have someone that is familiar with Crystal Reports or Visual Studio. They have suggested I contact "Crystal".

As a work-around I am having to export the Crystal Report, then open it in Microsoft Word within Visual Studio, then force the papersource and papertray from the Word commands. This is working effectively, however is not ideal as thousands of reports are being created within this procedure, and each of these are now having to be exported, and opened within word.

So am now having to add in these extra lines:

With crSStatement.ExportOptions

.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.WordForWindows

.ExportDestinationType = CrystalDecisions.[Shared].ExportDestinationType.DiskFile

optDisk.DiskFileName = sDocumentPath & ".doc"

.DestinationOptions = optDisk

End With

crReport.Export

Dim wd as New Microsoft.Office.Interop.Word.Application

wd.Visible = False

wd.Documents.Open(sDocumentPath)

wd.ActiverPrinter = "NewFXPrinter"

wd.ActiveDocument.PageSetup.FirstPageTray = 262

wd.ActiveDocument.PrintOut()

wd.ActiveDocument.Close()

wd.Application.Quit()

Has anyone else seen a similar problem with Fuji Xerox printers?