Wednesday, March 28, 2012

Print Barcodes with the Active X print control

We are having problems printing Reports (when printing by clicking on the AcitiveX print control), where the font for the fields are set to "C39HrP24DhTt" (barcode).

While viewing the report it displays as Barcodes but while printing, the Barcode does not get printed, but the string gets printed.

Environment: SSRS 2005

Using the ReportViewer Control in a .Net 2.0 Web App to render the reports.

BarCodes print fine in the following situations:

1. When the Report is exported to Excel and when printed from there

2. When you click on the print button on Internet Explorer

3. When saving as html (from view source) and opening that html document and printing.

BarCodes do NOT get printed in the following situation:

1. When printing by clicking on the "Print" (Active X Control) icon. Even the "Print Preview" does not show the Barcode.

We figured the problem. Here is the solution.

Unlike other printing which happens on the client side, with the Active X print control provided with SSRS, it creates an image of what needs to be printed on the server side and then issues the print command, and the processed image is sent from the client side. So, for the special fonts like barcode to work correctly we have to have it on the client machine (for viewing) and also on the report servers (for printing through the active X print control) .

1. Install the font on the Reporting Services machine using the following steps:

a. Open the C:\winnt\fonts folder directly on the machine. (Do not use a file share to do this operation)

b. Drag and drop the font you want to install into this folder.

c. Do an IISRESET from a command prompt to make sure the font will get loaded correctly when a user views a report.

sql

No comments:

Post a Comment