ActiveX Smartviewer in CR 9

Posted on 2004-09-03
Last Modified: 2011-10-03

I am using ActiveX smartviewer in Crystal Reports 9.0 integrated in ASP.  

We have a Pre-printed invoice format in Fanfold 11 x 8.5 inch.  We have designed the report with the same settings in Epson LQ-2080 printer driver(our target printer).  The preview is ok in Crystal designer.  But when we see the same in Viewer the Paper settings is changed to Letter and the output is not proper.  But to our great surprise it is working fine in one of our machine.

We are using Windows 2000.

Could not trace what is problem is.

Please help us.

we would be thankful to you
Question by:Vidya_Srinivasan
  • 4
  • 3
  • 2
  • +1

Expert Comment

ID: 11970977
i think it should help.

refers to Microsoft Knowledge Base Article – 184291 as follow.

SYMPTOMSA COM object that sends output to a printer fails when called from Active Server Pages (ASP), but functions correctly when called from an interactive application. This COM object could be either a commercial product such as a Microsoft Office application, or a custom third-party object. A common error message is "ClassName error '800a01e2' Printer error." CAUSEThe standard APIs that most objects use to print depend on registry entries located in HKEY_CURRENT_USER. This registry hive is dynamic. Depending on which user context the process is running under, different information will be loaded into this hive. ASP pages run under IIS, which is running as the SYSTEM account. When you create an instance of a COM object in your ASP code, by default, it will also run as the SYSTEM account. By default, the SYSTEM account does not have any printers set up in the registry. RESOLUTIONYou can set up printers for the SYSTEM account to resolve this problem. To set up printers for the SYSTEM account, perform the following:This method requires you to modify the registry using the Registry Editor. WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.

1.Ensure that the user you are currently logged into on the server has the desired printers installed.
2.Launch the Registry Editor (Regedit.exe).
3.Select the following key:      
HKEY_CURRENT_USER         \Software\Microsoft\Windows NT\Current Version\Devices      
4. From the Registry menu, click Export Registry File.
5. In the File Name text box, type c:\Devices.reg.
6. Select the following key:    
 HKEY_CURRENT_USER         \Software\Microsoft\Windows NT\Current Version\PrinterPorts
7.From the Registry menu, click Export Registry File.
8.In the File Name text box, type c:\PrinterPorts.reg.
9.Select the following key:    
 HKEY_CURRENT_USER         \Software\Microsoft\Windows NT\Current Version\Windows10.From the Registry menu, click Export Registry File.
11.In the File Name text box, type c:\Windows.reg.
12.From the Start button, select Run. Open Devices.reg in Notepad by typing Notepad Devices.reg in Run dialog box.
14.Save the file. Then import it into the registry by double-clicking the file in Windows Explorer.
15.Repeat steps 13 through 15 for PrinterPorts.reg and Windows.reg.
LVL 42

Expert Comment

ID: 11971469
Crystal uses the default printer driver to render the report.  I suspect that the difference between working properly on one machine and not on another is due to different printer drivers.

Even though this is an asp application, the printing happens client-side so it's the client's printer driver that comes into play not the server's driver.

LVL 100

Expert Comment

ID: 11978564
Agree with frodoman.


Author Comment

ID: 11978914
Hi Maxwai,

Thanks for your reply.  As per your guidance I changed the registry in the server and preview is ok.  But when seen in Layout tab of Print, it shows different paper sizes in different client machines, but works fine in few machines.  What can be the problem.  

Since this is done in ASP we cannot afford to change in all client machines as it can be browsed from any where.

Awaiting your reply
Vidya. S
LVL 42

Accepted Solution

frodoman earned 168 total points
ID: 11979877
The problem with serving up Crystal over the web is the same as serving up any web page - you can't control the client's environment.  If different clients have different printers then there is a very good chance that the reports will appear somewhat differently, will print somewhat differently, etc.

Crystal has finally come up with server-side printing which can help work around this problem, but I believe it's a new feature that is only in version 10.

Another option is to schedule your reports for export to PDF and then just allow users to see the PDF pages (which will still vary somewhat but not as much as Crystal).  This only works though if you have the tools to schedule the reports and if they are static reports that aren't generating dynamically based on parameters, etc.

Otherwise the best you can do is to use a generic font that everyone will have (Times New Roman, Arial, Courier), leave plenty of space around the margins of your report and between fields, and view from as many machines as you can to get a feel for how it looks to the general population.

There is, I'm sorry to say, no real solution.


How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline


Author Comment

ID: 11979920
Hi Frodoman,

Thanks for your reply.  Our problem is not with the font, it is with the paper size.  

We have informed that for proper view Client should have the specified Epson LQ-2080 ESC P/2.  So the Driver installed in same in Server and Client machine.  The print paper size is same as Fanfold 11 x 8.5 in Server and some of the client machines but the same is not applicable in some of the machines.

How to make it available.  Even if a Custom size is defined, it is not displayed in those machines with the same driver.

Please help us to resolve this.

With Thanks
Vidya. S
LVL 100

Assisted Solution

mlmcc earned 166 total points
ID: 11980275
The specified printer must be the default printer.


Assisted Solution

maxwai earned 166 total points
ID: 11986750
what you should do is to delete all paper size registry in the client and import those registry defined in server including the customized paper size.

this is because every paper size has its own identify number in each machine. one paper size, for example  Fanfold 11 x 8.5, will has different id in different machines. let say 12 in machine A and 18 in machine B.

so you must synchronize the paper size id between server and client by cleaning up all the paper size in the client and importing those in server.

LVL 42

Expert Comment

ID: 11987038
As I said in my posting on Sept 3, and as mlmcc has re-itterated, it's the *default* printer driver that is important.

LVL 42

Expert Comment

ID: 12199731
Recommend split: frodoman & mlmcc.

Relevant postings

Comment from frodoman
Date: 09/04/2004 07:42AM EDT

Comment from mlmcc
Date: 09/04/2004 10:29AM EDT

Author Comment

ID: 12245682

Sorry for the delayed reply, I could not see mails for past few days due to many reasons.

In the recommended list I would like to add Maxwai also, as his registry suggestion for good, but cannot be applied everywhere.

with Thanks
Vidya. S

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now