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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 101

Expert Comment

ID: 11978564
Agree with frodoman.

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT


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.



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 101

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

624 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