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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing directly to a printer

Status
Not open for further replies.
Aug 28, 2003
18
CA
I am running Crystal Enterprise 10 on a web server that is housing a number of Crystal reports.

I have a web application that accesses these reports via the Cystal Reports Viewer. Everything is working fine except printing is anoying.

When you click the printer icon in the browser, a window pops up asking what pages to print (This is fine). But once selected, it created a PDF file and has you open the file up. You then have to print from the PDF file.

Is there any way to send it directly to the printer instead of creating a PDF? Not sure if there is any ASP code to set these parameters of how you want the report printer or if this is a setting in the individual reports.

Any help is much appreciated.
 
Hi,
It can depened on how you construct your viewer..

We use:

Code:
'Create a viewer object and view the report
Set Viewer = CreateObject("CrystalReports.CrystalReportInteractiveViewer")
With Viewer
  .reportSource = reportDocument
  .ParameterFields = Fields
  .HasPrintButton = true
  .PrintMode = 1 ' activeX Printing
  .IsOwnPage = true
End With
' Workaround needed currently to get this to work
set session("viewer") = viewer

Response.Redirect("viewprint.asp")


The .PrintMode = 1 ' activeX Printing
along with the .HasPrintButton and .IsOwn Page
allows for 'standard' type Windows printing...

The workaround prevents a 'communication error' being generated when the report tries to print..
The viewprint.asp 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
%>


There may be other ways, but this one works for us...

[profile]
 
Hi, No Problem..Business Objects Tech Support led me through that workaround..Just another example of the fine support I have gotten from them...


[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top