cancel
Showing results for 
Search instead for 
Did you mean: 

Printing Problem

Former Member
0 Kudos

Hi,

I have been struggling with an upgrade of a VB6 & CR IX application. Due to issues printing a MICR (printer) embedded font. I have needed to use the PrintOutputController method of printing instead of PrintToPrinter.

The first problem I encountered was the compiled application (CR for VS 2010 SP2) produced an error "Class not registered - CrystalPrintControl". After a long search of the forum I found that the PrintControl.dll was not registered. I checked the client and the install of CRRuntime_32bit_13_0_2.msi did NOT install the ActiveXControls directory to the client. I then copied the ActiveXControls from the development computer and registered the PrintControl.dll. This worked!

However I tried to use the crPrintReportOptions.PaperSource = CrPaperSourceEnum.crPaperSourceUpper command to set the printer tray but this did not work on the HP 4250 printer. I used GetAvailableBins(printername) and GetAvailableBinNames(printername) to determine the correct values for the trays (tray 1 - 262 and tray 2 - 261). This all worked outstandingly well on the development computer but caused an "External component has thrown an exception" error on the client computer when the GetAvailableBins or GetAvailableBinNames were executed.

So,

1. Why did the ActiveXControls folder and files fail to be created on the client computer when the CRRuntime_32bit_13_0_2 was installed?

2. Suggestions on why I am now getting the "External component has thrown an exception" when using the GetAvailableBins command? The commands work OK on the development computer so I assume there is a problem with the client installation. As a possibility I thought it may have something to do with csprintdlg.dll which is in the ActiveXControls folder (which did not get created in the install) so I tried to manually register the dll in the ActiveXControls folder but received the error "the dllregisterserver point was not found".

Thanks,

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Kevin,

We'll have to test the MSI issue.

Do your customers use the same HP 4250 and same version? Are they using a 32 bit version or 64 bit version? HP and Crystal have a history, try installing their latest drivers and be aware that there are differences between the OD versions and platforms.

Place a Try/Catch around the API and catch the exception either to a log file or a message box. What can happen is, from my history, the HP drivers return the wrong MEMStruct Size and that causes CR to throw an exception. Even though CR is using the .NET Framework Printer dependencies, it's likely the same type of issue.

Thanks

Don

0 Kudos

Can you look in C:\Program Files (x86)\SAP BusinessObjects\InstallData\logs and then a date stamp folder, at the log file and see what's missing or any errors reported?

I looked in the MSI file and both the Viewer folder and Print control files are in there....

The install log file may show you what dependency is missing possibly.

Ludek is going to test this when gets off his call.

Don

Former Member
0 Kudos

Hi Don,

The application is being installed to a Windows 2003 Standard Edition server. I have checked for the InstallData folder you suggested and it does not exist. When I installed the CRRuntime it exited normally and gave no indication of any problems.

I did have a try/catch around the GetAvailableBins and the the error message is "External component has thrown an exception"

The development computer is a Windows XP so the dev and production environments are both 32 bit. The printer driver on the production server is slightly older than the dev driver so I will update the production driver.

NOTE: The application works perfectly on the dev computer. The problem occurs only on the production server with the compiled application and CRRuntime. My thought is a problem with the CRRuntime especially since the ActiveXControls folder was not created during installation.

I will post the result of the updated printer driver soon.

Thanks,

Kevin

0 Kudos

Hi Kevin,

Ludek verified the installer doesn't create the folder. Try doing a repair install of the runtime to see if that works. i take that back... Ludek is doing more testing.

did you include them in your Project Dependencies/references?

Thanks

Don

Edited by: Don Williams on Dec 1, 2011 2:54 PM

Former Member
0 Kudos

Hi Don,

The only Crystal dependency that was auto detected was CrystalDecisions.ReportAppServer.Prompting.dll

I assumed the others would be in the standard CRRuntime installation???

Thanks,

Kevin

Former Member
0 Kudos

Hi Don,

Just updated to the latest HP printer driver (same as dev computer). No luck, application still throws the same exception.

Thanks,

Kevin

Former Member
0 Kudos

Hi Don,

I just did a reinstall of the CRRuntime from the add/remove programs (change). No change, program still errors....

Thanks,

Kevin

former_member183750
Active Contributor
0 Kudos

Here are the details of what happens on install of the SP 2 MSI for CRVS2010;

There is no ActiveX directory created under:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\Crystal Reports 2011\crystalreportviewers

But it does get installed under:

C:\Inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13

- Ludek

Edited by: Ludek Uher on Dec 2, 2011 6:56 AM

Former Member
0 Kudos

Hi Ludek,,

I just checked the folder C:\Inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13\ActiveXControls

It exists on my server however all of the files are cab files. Nothing has been uncompressed and registered. This following is a file listing of the directory:

PrintControl.cab

PrintControl_res_cs.cab

PrintControl_res_da.cab

PrintControl_res_de.cab

PrintControl_res_en.cab

PrintControl_res_es.cab

PrintControl_res_fi.cab

PrintControl_res_fr.cab

PrintControl_res_hu.cab

PrintControl_res_it.cab

PrintControl_res_ja.cab

PrintControl_res_ko.cab

PrintControl_res_nb.cab

PrintControl_res_nl.cab

PrintControl_res_pl.cab

PrintControl_res_pt.cab

PrintControl_res_ru.cab

PrintControl_res_sk.cab

PrintControl_res_sv.cab

PrintControl_res_th.cab

PrintControl_res_tr.cab

PrintControl_res_zh_CN.cab

PrintControl_res_zh_TW.cab

Regards,

Kevin

Former Member
0 Kudos

Hi Ludek,

Just thought I would add that the Windows server is being used as a Windows Application Server NOT a Web Server. It would appear that this folder is used to push the cab files to clients so they can print. Not for the server to print!

In my case the server does the printing. The server automatically prints reports based on data in an AS/400. All user interaction is through the AS/400. The application could have been installed on a standard Windows XP computer but a server was used as it is considered to be more robust.

Thanks,

Kevin

former_member183750
Active Contributor
0 Kudos

Hmmm - I'm missing something here.

If we are doing a direct API print, we do not need the printcontrol \ ActiveX. This is only needed if we use the viewer and the viewer is set to use ActiveX print mode. E.g.;

Request report from client

Report is processed on web server

Report is sent in the viewer to the client

On the client, we click the <print> button

As we are using ActiveX print mode a request (postback) is sent to the server to download the ActiveX (printcontrol.dll) for printing

Printcontrol.dll is downloaded and registered

ActiveX printing now commences

- Ludek

Former Member
0 Kudos

Hi Ludek,

I originally used the PrintToPrinter method to print but had to change to PrintControl because the other method caused the printer to fail when printing printer embedded MICR fonts. I posted a question a few months ago along with my code but there was no resolution:

It would be much easier for me if the original problem was solved and I did not have to resort to using the printcontrol method to print printer embedded MICR fonts.

The printcontrol method works except for the GetAvailableBins and GetAvailableBinNames commands.

To check if there was some compatibility with the printcontrol from my dev computer. I unregistered the original printcontrol I copied to the server from my dev computer and extracted the printcontrol.cab and PrintControl_res_en.cab from the CRRuntime into the same directory. I then registered the printcontrol. I ran my program and I still had the same error with GetAvailableBins.

Is there something else I need to do to get printcontrol working on the same computer? I can run the compiled program on my XP computer and it works OK. There just seems to be something missing on the 2003 server...

Thanks,

Kevin

daniel_paulsen
Active Contributor
0 Kudos

try extracting Printcontrol.cab on the W2k3 server and right-click on the PrintControl.ini and select "Install".

Does this help?

Former Member
0 Kudos

No that did not work...

I decided to give up on using the GetAvailableBins and GetAvailableBinNames. So instead I interrogate the printer using the VB.Net printing object. This works OK as it gives me the same tray ID as the Crystal method.

However....

When I try to print I get an error with the message "The printer specified can not be found. It may not be accessible in the current security context."

What does this mean????

I am logged into the server with admin rights and that user also created the printer. Everyone has rights to print to the printer. Is there some security context within Crystal?? I have done a search of the forum and cannot find anything similar.

When I run the application on the dev computer all works OK.

Please help, I am stuck.....

former_member183750
Active Contributor
0 Kudos

See if [this|http://support.microsoft.com/kb/184291/en-us] MS KB helps.

- Ludek

Former Member
0 Kudos

Thanks for all of your help. I just found the problem...

The printer name is case sensitive. argh......

former_member183750
Active Contributor
0 Kudos

eek, wow. A tip to store in the old memory banks - I think I'll create a KB on it even though I think most printer drivers don't give a hoot, but there is always the one.

- Ludek

0 Kudos

Thanks for your suggestion.

Maybe it is possible to mark your response as answer?

Regards,

Pieter Jong

Crystal Advice

http://www.crystaladvice.com

Answers (0)