cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Printer Name from Crystal Report

Former Member
0 Kudos

How can i remove the printer name from the Crystal Report so that the PrinterName property of the CRAXDRT.Report object in the RDC SDK is blank WITHOUT having the "No Printer" Option checkbox checked?

Here's the scenerio. When I first create a Report and don't go into Page Setup, PrinterName property is blank. If I go into Page Setup and explicitly select a printer, PrinterName property equals the name of the printer selected. If I check the "No Printer" checkbox in Page Setup, PrinterName property is blank. But if i go back in and uncheck the "No Printer" checkbox in Page Setup, the PrinterName property equals the name of my Windows Default Printer.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I'm not 100% sure how will help me with existing Crystal Reports? I don't have a problem when creating a new Crystal Report because I know not to go into Page Setup. But we have over 50 existing reports where my company's network printer is saved in the report. I'm trying to resolve the issue with the existing reports.

Does the CR XI R2 SP6 expose the "No Printer" option in .NET?

0 Kudos

Hello,

No, there is no option or way to verify or get/set the No Printer option in any version of CR runtime other than in the designer.

By default CR XI R2 is WYSIWYG and it does this by using the Video driver and default printer the same as Adobe does it. So even if you set the No Printer option it still uses the PC's default printer to render the report.

One work around that is generic is install the Windows Generic Print Driver which everyone has on older PC's or use the Microsoft XPS Document Writer on newer PC, set that as default printer and then update and save the reports. You can set the printer in code, saveAs to update the RPT and now it has a generic printer name.

So the ultimate question is WHY do you need to remove the printer name?

Thank you

Don

Answers (5)

Answers (5)

Former Member
0 Kudos

I understand the problem described because I am experiencing the same issue. I have upgraded from XI to XI R2, but this did not fix the issue. The problem is this: In creating a report in Crystal Reports XI R2 with the option "No Printer" unchecked in Page Setup, the default printer of the development machine is saved with the report. When the report is run on a client machine and the user goes to print the report, Crystal wants to print to the default printer of the development machine instead of the client default printer.

I am using XI R2 SP6 with hot fixes 6.3.

Is there a solution or one in the making?

CRViewer.dll version is 11.5.12.1838

Edited by: RHawkins on Jul 1, 2011 10:32 PM

former_member183750
Active Contributor
0 Kudos

CR XI R2 patch support terminated about a year ago and any support terminated yesterday - June 30.

However, I'd like to explore this statement:

"...Crystal wants to print to the default printer of the development machine instead of the client default printer"

CR may want to print to that printer, but if it does not find the printer, it will \ should substitute the default printer on the client computer. Is that not happening for you? What issue(s) are you seeing?

- Ludek

Former Member
0 Kudos

Thank you for your quick response.

I think I have discovered a solution to this issue, but first let me answer your question so you may better understand the issue.

I have an HP 5 printer that I use for my development machine as my default printer. If a client has that printer on their network then when they go to print the report from within the Crystal Reports Viewer, the HP 5 will be selected as the printer to print from instead of the client default printer (let's say an HP 4100N). This only occurs if the No Printer option is unchecked in Page Setup.

As you mentioned, if an HP 5 was not on the network then the client default printer would correctly be selected when they go to print the report within the viewer.

Now for my workaround solution that is working for me.

I am using this code to clear the printer info that was saved with the report.

Set Report = New CRAXDRT.Report

Set crxApp = New CRAXDRT.Application

Set Report = crxApp.OpenReport(gvRPTName, 1)

Report.SelectPrinter "", "", ""

My tests have confirmed that this resolves the above mention issue.

The problem with selecting No Printer instead of my workaround is that what is displayed in the viewer is not what actually prints.

In any case this is solved for me. Just wanted to pass the info along to you and to anyone else experiencing this problem.

former_member183750
Active Contributor
0 Kudos

Very interesting. Many thanks for the explanation and solution.

- Ludek

Former Member
0 Kudos

I'm still not sure what is unclear about my first question. And I'm not sure how any of the info you are requesting is going to make any difference in answering my question. And I'm not sure how your analogy fits here but ..

Version of CR = 11.0.0.895

CR Service Packs applied = None

Web or Win app? = Win App

OS? = Windows XP Service Pack 3

Development language? = Both Visual Basic 6 and C#.Net 2008

Method of CR files deployment = email the .RPT file to a client

Where were the runtime files downloaded from? = Runtimes are installed from Merge Modules donwload from SAP site

What is the version of the craxdrt.dll on the deployed box? = 11.0.0.893

So here are the exact steps so you can understand what is going on:

I have the Crystal Reports Application open side-by-side with my Visual Basic development environment in debug mode so i can step through the code using the RDC SDK.

1. I open the Crystal Reports Application and create a brand new report - "Test.RPT" and DO NOT go into Page Setup at all and save the report.

2. In my Visual Basic development environment, i run the code that will generate the report, Here's the exact code

Dim m_crApp As CRAXDRT.Application

Dim m_crReport As CRAXDRT.Report

Set m_crApp = New CRAXDRT.Application

Set m_crReport = New CRAXDRT.Report

Set m_crReport = m_crApp.OpenReport("Test.RPT")

3. When i look at the PrinterName property in the CRAXDRT.Report object, it is blank.

ie. crReport.PrinterName is equal to ""

4. I reopen the Crystal Reports Application with report "Test.RPT" and go into Page Setup and check the "No Printer" option.

5. I go back into my Visual Basic development environment and rerun the code that will generate the report.

6. When i look at the PrinterName property in the CRAXDRT.Report object, it is still blank.

ie. crReport.PrinterName is equal to ""

7. I reopen the Crystal Reports Application with report "Test.RPT" and go into Page Setup and uncheck the "No Printer" option. I have NOT specified any printer, nor have i clicked the "Printer..." button to setup a printer....i have just unchecked the "No Printer" option

8. I go back into my Visual Basic development environment and rerun the code that will generate the report.

9. When i look at the PrinterName property in the CRAXDRT.Report object, it is now set to my WINDOWS DEFAULT PRINTER, yet i had not specified any printer.

ie. crReport.PrinterName is equal to "
MyNetwork\MyPrinter"

PROBLEMS:

1. The client needs the report to go to the default windows printer of their machine

2. If the "No Printer" Option is checked, the Report does not print at all

3. If the report is set to MY default windows printer and i give it to the client, at times it takes upwards of to a minute for the Print Dialog to disply. As i've read on other forum posts, it appears Crystal is looking for MY printer on the clients machine and takes a minute before i realizes it can't find it and then sets it to the CLIENTS default windows printer.

4. The client believes it is unreasonable to wait a minute for the print dialog to appear ...and i agree.

5. I cannot change the code to use the Select Printer in the RDC SDK - it's a long explanation why but just suffice it to say that i cannot do this.

All i want to do is either:

1. Remove the Printer Name in the actual report from the Crystal Reports designer - basically undoing what Crystal did when i went into Page Setup.

2. Via the RDC SDK, be able to detect the "No Printer" option is selected. Checkign CRAXDRT.PrinterName equal to "" is not an option.

former_member183750
Active Contributor
0 Kudos

And I'm not sure how any of the info you are requesting is going to make any difference in answering my question.

- See below

Version of CR = 11.0.0.895

- Upgrade to CR 11.5 as follows:

1) Note your keycode for CR 11.0 (XI R1)

2) Uninstall CR XI R1

3) Download CR XI R2 from here:

https://smpdl.sap-ag.de/~sapidp/012002523100006008462008E/crxir2.zip

4) Apply SP 4:

https://smpdl.sap-ag.de/~sapidp/012002523100006255422008E/crxir2_sp4_inc.exe

5) Apply SP 6:

https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe

6) Update your references to version 11.5.x - both the craxdrt.dll and the crviewer

Development language? = Both Visual Basic 6 and C#.Net 2008

Do not use craxdrt (RDC) in .NET.

1) Only CR 2008 is supported in .NET 2008, unfortunately the RDC is retired in CR 2008

2) RDC - any version is not supported in any version of .NET. See the blog [Use of the Report Designer Component (RDC) in VS .NET|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/15939] [original link is broken] [original link is broken] [original link is broken]; for more details.

Where were the runtime files downloaded from? = Runtimes are installed from Merge Modules download from SAP site

- Once you are on CR XI R2, use the RDC MSM from here:

https://smpdl.sap-ag.de/~sapidp/012002523100000634032010E/crxir2sp6_rdc_mm.zip

The client needs the report to go to the default windows printer of their machine

Using CR XI R2, when creating a new report, it will automatically select a default printer. Once this report is deployed, it will automatically use a default printer - what ever it is.

- Ludek

Former Member
0 Kudos

I need to remove the PrinterName from the report when the "No Printer" checkbox unchecked.

When "No Printer" checkbox is checked, and i give the report to the client, it doesn't print at all.

When I uncheck the "No Printer" checkbox, it puts my windows default printer in the report. Then when i give the report to the client, it takes upward of up to a minute for the report to start printing to their windows default printer because apparently the report is looking for my printer and just sits there searching for it because if figures out that printer doesn't exist on the clients machine and uses their default printer.

former_member183750
Active Contributor
0 Kudos

Ok. So after 5 days, I finally know what the issue is... I suspect that it would have been better to provide that piece of info 1st(?) as now we can look at it and move on to a resolution.

To make an analogy, all you were telling me is that you wanted to access the wire to the blinker light of your car. I had no idea why. You, knew that the light does not work and assumed it was a broken wire. But it could have been the fuse, the filament or a myriad of other things...

I'm still missing tons of info, so to begin with please provide the following;

Version of CR

CR Service Packs applied

Web or Win app?

OS?

Development language?

Method of CR files deployment

Where were the runtime files downloaded from?

What is the version of the craxdrt.dll on the deployed box?

Umm, looking at the blog [What do I need to do to get the fastest issue resolution?|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/12045] [original link is broken] [original link is broken] [original link is broken]; may be a good idea for next time... The [Rules of Engagement|http://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] - Step 2 Asking Your Question; Provide Enough Information - is also a good read.

- Ludek

Former Member
0 Kudos

I have multiple queries because i am trying to attack this problem from anydirection that will solve my issue. If being able to detect the "No Printer" option is selected in the RDC SDK...my issue will be solved. If, through the Crystal Designer, I can remove the Printer Name after one has already been set, then that solves my issue as well.

former_member183750
Active Contributor
0 Kudos

If, through the Crystal Designer, I can remove the Printer Name after one has already been set, then that solves my issue as well.

I'm missing something here. In your firs tpost you say:

If I check the "No Printer" checkbox in Page Setup, PrinterName property is blank.

That is all you should need to do to remove the selected printer.

Now, if you go back and uncheck the "No Printer" checkbox in Page Setup, the PrinterName property will select the default printer, thus again removing a preset printer.

Perhaps a description of ;

If, through the Crystal Designer, I can remove the Printer Name after one has already been set, then that+ solves my issue+ as well.

may be good. What is the actual issue?

- Ludek

former_member183750
Active Contributor
0 Kudos

Taking this thread and [Crystal Reports RDC SDK "No Printer" Option|; together, I assume there is a relationship - perhaps even the same query asked in different ways(?).

What I am wondering about is;

Can you summarize the two queries and state what will be the end product of this? E.g.; why the need to remove the printer name at runtime?

- Ludek