Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CE10 printing issue...please help!

Status
Not open for further replies.

eo

MIS
Apr 3, 2003
809
Hi all
I develop reports locally where the default printer is called 'HON10 HP5M', and is set to print to A4. This is reflected in the report printer settings. This printer was also added to the print settings on the CE10 server (a seperate server) as the default server, it is in fact the only printer on that server. I hoped this would solve my problem...
PROBLEM:
I publish the reports to the seperate CE10 server with the 'HON10 HP5M' printer with the A4 settings. The users run the reports via the DHTML viewer over the web. When they try and print the get a 'white box' (this must be the 'CRYSTAL REPORT VIEWER - WEBPAGE DIALOG BOX - PRINT CONTROL' box. And thats all. If I run that same report locally (also using the DHTML viewer over the web, I get the same box, and immediately afterwards the print dialog box, from which I simply click print.)
The user obviously does not have the 'HON10 HP5M' printer installed on his PC as he does not have access to it, he has his local PC installed to which I would have hoped the report would print.
Any ideas what to do?
Thanks,

Etienne Oosthuysen
Hertfordshire, England
 
Apologies, but just to add to the above, even if I print locally, the print comes through as Letter type???

Etienne Oosthuysen
Hertfordshire, England
 
EO

Are the users using the ActiveX Print Control when they attempt to print the report?

From the sounds of it, it might be that they do not have the necessary permissions on their PC to install the Control so they can print the report. I beleive they would need to have atleast Power User rights to install the print control. Without enough permissions on the PC, the user never gets prompted to install the print control, and thus they never get to the Print Dialog box.

Hope this helps!

Brent
 
Brent
We do not use the ActiveX viewer (I assume one has to use the ActiveX viewer in order for the ActiveX Print Control to apply), but rather the DHTML viewer.
Looked at a doc from BO called ce85_no_printer.pdf, but still no joy.
EO

Etienne Oosthuysen
Hertfordshire, England
 
Hi,
Actually you can add the ActiveX print control to the DHTML viewer - It does not require that any client-side components be installed.
Code:
'Create a viewer object and view the report
Set Viewer = CreateObject("CrystalReports.CrystalReportInteractiveViewer")
With Viewer
  .reportSource = reportDocument
  .HasBooleanSearchButton = False
  .HasCrystalLogo = False
  If NbrParams > 0 then
  .ParameterFields = Fields
  End If
  .HasRefreshButton = True
  .IsDisplayGroupTree = False
  .HasPrintButton = true
  .PrintMode = 1 ' activeX Printing
  .IsOwnPage = true
End With

set session("viewer") = viewer

Response.Redirect("viewprint.asp")

The last part of the code is needed to correct a problem with the print control when using the PSReportFactory.
The page it calls has just :
Code:
<%@ Language=VBScript %>

<%
option explicit

dim viewer
set viewer = session("viewer")
'Error handle
on error resume next
Viewer.ProcessHTTPRequest Request, Response, Session

if err.number <> 0 then
  response.write "Failed to view report" & "</BR>"
  response.write "error number: " & err.number & "</BR>"
  response.write "error description: " & err.description
end if
%>

Hth,

[profile]
 
The DHTML viewer can not know anything about the client printer setup (because it is zero client) - as a strange work around CE has an setting under ePortfolio Crystal Report Preferences called "DHTML viewer printing uses the ..."

I think your problem is that the user has this set to "ActiveX printing control (One click printing)" but they do not have the rights to their PC to install the control. They will either need to be granted the rights by your network admin - or change to the "Acrobat Reader printing control" option.

Kingfisher
 
Hi Turkbear,

It does not require that any client-side components be installed.

How can this be true? ActiveX controls need rights to run client side...no???

Kingfisher
 
Hi,
OOPS, I just tested it on a brand new client and it does require a plug-in to be installed..( apparently most of my users already had it, so it looked like it was not needed) -

I am not sure, though, that this limited plug-in ( unlike the ActiveX viewer ) requires the same high level rights (the new user was an administrator of their PC)
More testing I guess..

My Bad...[purpleface]

[profile]

 
EO:

With a user that is unable to print:

Have them confirm which Print Control is being used for printing. Have the user go to the preferrences page and then click on the Crystal Report Preferrences link. There is a section called "DHTML viewer printing uses the ...". If the option "ActiveX Print Control(One Click Printing)" is selected, they will need to have elevated rights on their PC to install the ActiveX print control. When I tested, I found that the user needed atleast Power User permissions on the PC to install the control.

As an alternative the users could use Acrobate Reader print control, although it requires a couple more clicks for the user each time they want to print a report.

Brent
 
The problem is more complex than that: I have set users NOT to be able to see the preferences option. But I have checked mine, and unchecked the "ActiveX Print Control (One click Printing)". Not solved.
When exporting to PDF, the problem even gets more confusing.
Any fields surpressed are printed on a seperate page ??? So you basically have one normal page (a supressed info page, a normal page, a surpressed info page, etc etc etc.
As for the first issue, it only seems to happen when a field is (for example 20 characters long, and you dragged the field narrower in the design...so CE stil wants to print according to the actual 20 characters.
But as said the export to PDF is also a major problem.

Etienne Oosthuysen
Hertfordshire, England
 
Let’s try focusing on your issues one at a time. For the users that are unable to print, can you tell us which print control (ActiveX or Acrobat) they are using when they attempt to print a report?
 
We are also having a problem trying to print while using the DHTML viewer. We have ActiveX print control turned on. Acrobat reader print control works fine.

Even though we are administrators of our PCs we are are not getting the Print Control installed and so the printing fails.

My question is how to implement the code listed in this thread. Is this added to an existing file? Please provide details.

When we change the viewer to ActiveX printing works just fine. What are the advantages and disadvantages of using the ActiveX viewer compared to the DHTML?

Thanks!
 
Hi,
Do you get any errors when you click on the Printer Icon in the DHTML viewer?

Some of the advantages of ActiveX are mainly in its flexibility in handling text alignment and rotation, as well as having an interface look-and-feel that many folks seem to prefer..
2 BIG downsides are the need to be logged in as a 'Power User' or Administrator the first time a PC tries to run an ActiveX viewer, and it is, obviously, restricted to Internet Explorer browsers.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
We get a box that says Crystal Print Control before the box to select a printer.

Then when you select the printer and click on print:

An communcation error occrred printing will be stopped.
 
Hi,
Be sure to use the method I posted - call a separate page with the Viewer:

set session("viewer") = viewer
Response.Redirect("viewprint.asp")

On that page:

<%@ Language=VBScript %>
<%
option explicit

dim viewer
set viewer = session("viewer")
'Error handle
on error resume next
Viewer.ProcessHTTPRequest Request, Response, Session

if err.number <> 0 then
response.write "Failed to view report" & "</BR>"
response.write "error number: " & err.number & "</BR>"
response.write "error description: " & err.description
end if
%>

This was a CE support work-around to avoid that very error..






[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Sorry but I'm not getting this:

Also are files are .csp not .asp - what is the difference?

Where do you put this code:
set session("viewer") = viewer
Response.Redirect("viewprint.asp")

On that page: And this file is viewprint.asp?

<%@ Language=VBScript %>
<%
option explicit

dim viewer
set viewer = session("viewer")
'Error handle
on error resume next
Viewer.ProcessHTTPRequest Request, Response, Session

if err.number <> 0 then
response.write "Failed to view report" & "</BR>"
response.write "error number: " & err.number & "</BR>"
response.write "error description: " & err.description
end if
%>
 
Hi,'
Sorry about the confusion..
Here is the csp version main page we use for creating the report object and viewer and then calling it:( we pass several parameters to this page and process them as needed)

Code:
<%@ Language=VBScript%>
<HTML>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=charset=UTF-8">
<BODY>
<%
'===================================================================
' AUTHOR - SG, KA
' CREATED - March 31, 2004
' Modified by Turkbear November 18, 2004 to make it a csp page
' PURPOSE - This sample ASP application demonstrates how to view 
'           on demand a report with a multiple value parameter 
'           using the Crystal Enterprise 10 COM SDK.
' DESCRIPTION
'	- Define CE Logon Variables
'   - Create the Enterprise Session Manager and iStore objects
'   - Query the CMS for a report to view
'	- Create and pass parameter for the report
'	- Create the viewer object and view the report
'==================================================================

'Declare the CMS Logon Variables
Dim CMS
Dim Username
Dim Password
Dim Authtype

'Set CMS logon credentials - change these to match your particular CE environment
CMS = "@CE10PROD"
Username = "ReadOnly"
Password = "sample123"
Authtype = "secEnterprise"


'Declare variables for Enterprise Session
Dim oEnterpriseSessionMgr
Dim ceSession
Dim iStore
'Get the values
Rid = Request.QueryString("ReportID")
NbrParams = Request.QueryString("NumParens")
If NbrParams > 0 then
ValStr   = Request.QueryString ("Pvals")
NameStr = Request.QueryString ("Pnames")
arrVals = Split(ValStr,";")
arrNames = Split(NameStr,",")
End If


'Load the Enterprise Session Manager

Set oEnterpriseSessionMgr = Server.CreateObject("CrystalEnterprise.SessionMgr")

'Logon to the CMS and create iStore object
Set ceSession = oEnterpriseSessionMgr.Logon(Username, Password, CMS, Authtype)
Set iStore = ceSession.Service("","InfoStore")

'Declare InfoObject Variable
Dim Reports
Dim Report

'Query the CMS for the report you wish to view
Set Reports = iStore.Query("Select * from CI_InfoObjects Where SI_ProgID = 'CrystalEnterprise.Report' and SI_ID='" & Rid & "'")
Report = Reports.Item(1).Properties("SI_ID")

'Declare the report parameter variables
Dim reportParameters
Dim fields
Dim tmpParameter
Dim value
Dim NewSpec()
Dim PType()
Dim inx 
Dim pcnt
pcnt = 0
inx = 0

'Get the report parameter(s) using the plugin interface
Set reportParameters = Reports.Item(1).PluginInterface("Report").ReportParameters
If NbrParams > 0 then
                       ' Build an array structure to determine the parameter type
For each parameter in reportParameters
	  pcnt = pcnt + 1
	  Next
	For each parameter in reportParameters
	 ReDim PType(pcnt)
	 PType(inx) = parameter.ValueType
	 inx = inx + 1
	 Next

	'Create a new Fields Collection Object
	Set fields = CreateObject("CrystalReports.Fields")
	
	for n = 0 to (NbrParams - 1)
	' Create a temporary parameter field 
		Set tmpParameter = CreateObject("CrystalReports.ParameterField")
		' Create list of values for this parameter
		arrPvals = Split(arrVals(n),",")
		Max = UBound(arrpvals)
		ReDim NewSpec(Max)
		' Create a parameter value oblect for each value in list 
		for v = 0 to UBound(arrpvals)
		set NewSpec(v)   =  createobject("CrystalReports.ParameterFieldDiscreteValue")  
		Next
		i = 0 ' initialize counter for value list array access
		 for each val in arrPvals  ' assign the value to the parameter
		    if PType(n) = 3 then
		       NewSpec(i).value = cDate(val)
		    else
		         NewSpec(i).value = Trim(val)
		   end if
		        tmpParameter.CurrentValues.Add NewSpec(i)
		              i = i + 1     ' increment counter
		              		 Next
			 
		tmpParameter.name = arrNames(n)
	Fields.Add tmpParameter
 Next ' parameter
  
End If

'Declare the Report App Factory and Report Document Objects
Dim rptAppFactor
Dim reportDocument

'Create the Report App Factory and Report Document Objects
Set rptAppFactory = iStore.EnterpriseSession.Service("","PSReportFactory")
Set reportDocument = rptAppFactory.OpenReportSource(Report)


'Declare the viewer object variable
Dim Viewer

'Create a viewer object and view the report
Set Viewer = CreateObject("CrystalReports.CrystalReportInteractiveViewer")
With Viewer
  .reportSource = reportDocument
  .HasBooleanSearchButton = False
  .HasCrystalLogo = False
  If NbrParams > 0 then
  .ParameterFields = Fields
  End If
  .HasRefreshButton = True
  .IsDisplayGroupTree = False
  .HasPrintButton = true
  .PrintMode = 0 ' disable activeX Printing - set to 1 to enable (may require plug-in is set to 1)
  .IsOwnPage = true
End With
'


Session("viewer") = Viewer

Response.Redirect("viewprint.csp")

 

%>
</BODY>
</HTML>

The viewpriont.csp page is:

Code:
<%@ Language=VBScript %>

<%
option explicit

dim viewer
set viewer = session("viewer")
'Error handle
on error resume next
Viewer.ProcessHTTPRequest Request, Response, Session

if err.number <> 0 then
  response.write "Failed to view report" & "</BR>"
  response.write "error number: " & err.number & "</BR>"
  response.write "error description: " & err.description
end if
%>


Hope it is too long.
We use these 2 pages to call all of our reports - they are in one directory and all developers can use the same redirect when ready to show their report ( User interface is custom as well, but the View Report button they use always calls a variant of
Code:
[URL unfurl="true"]http://myceserver/CeViewer/report_viewer.csp?ReportID=xxx&NumParens=2&pnames=Username,empnbr&pvals=Greco;0000099[/URL]
The QueryString variables are set by the user calling page..


Hope it helps...



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top