473,738 Members | 6,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sending Crystal Report to Network Print Mailbox While Bypassing Crystal Report Viewer.

Hello, I am developing a VB.NET 2003 application that will use lots of
Crystal Reports. Sometimes the users will preview a report in a
Crystal report viewer, and sometimes they will send the report directly
to the printer bypassing the Crystal report viewer altogether.

When sending the job directly to the printer I use the PrintToPrinter

CR.PrintToPrint er(1, False, 0, 0)

This works fine when printing right away those reports.

My biggest problem right now is that sometimes the users won't need
to print the report right away and will they send it to the network
printer mailboxes and stored it there until they're ready to print the

What I need is to show the Print Dialog so they can choose the network
printer (Canon ImageRunner 8500) and then the mailbox number in which
to store the report.

I am aware that the main reason of using the PrintToPrinter option is
to stop any print popup screen from showing and print and be done.
However, I do need to show the print dialog so they can have the
ability to either print right away or store the report.

If the report is previewed first and need to be stored in a printer
mailbox right after, it can be done by clicking the print icon from the
Crystal Report Viewer toolbar. The print dialog does show and work.

Can anyone help me with this?

This is a slimmed version of the code of my Print/Preview button. I
have to add report parameters, headers, signatures, etc., but that's
working perfectly, so I did not pasted it here.

'Declare variables
Dim ConnString, Prntr As String
ConnString =
CType(Configura tionSettings.Ap pSettings("Conn String"), String)
Prntr = CType(Configura tionSettings.Ap pSettings("Prnt rName"),
Dim cnn01 As New SqlClient.SqlCo nnection(ConnSt ring)

'set the report path
Dim RptPath As String
RptPath = FldLocation & RptToPrint

' create a new temporary copy of the selected report
Dim CR As New ReportDocument
Dim crSection As Section
Dim crReportObject As ReportObject
CR.Load(RptPath , OpenReportMetho d.OpenReportByT empCopy)
' Either print or preview the report
Select Case PrintDoc
Case "Prnt"

' Check whether to print in landscape or not
Select Case Lndscp
Case True
' Set report to print in landscape
CR.PrintOptions .PaperOrientati on =
CrystalDecision s.[Shared].PaperOrientati on.Landscape
End Select
' get the printer name from which to print the report
'CR.PrintOption s.PrinterName = Prntr
' print the report
CR.PrintToPrint er(1, False, 0, 0)
Case "Prv"
' Preview the report in the Crystal Report Viewer
CRViewer1.Repor tSource = CR
End Select

Thanks for taking your time and see if you can provide any help.

Jan 17 '07 #1
0 2976

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Jeannette | last post by:
Hi! there, I am currently working on web-based reports using crystal reports.NET 2003 and I am new to this reporting tool. I notice that the WEB forms report viewer toolbar does not include the 'PRINT' button, in which users can specify the print layout - portrait or landscape. Does anybody know how to add a 'PRINT' button to the web forms report viewer toolbar? Any help would be GREATLY appreciated!
by: Robert Schuldenfrei | last post by:
Dear NG, I have Crystal Reports working to a file and directly to the printer with the following: private void mnuInvRep1301_Click(object sender, System.EventArgs e) {
by: Robert Schuldenfrei | last post by:
Hi Again, Forgive me for posting this again, but old items seem to get little review. I thought I could adjust the viewer properties without any further aid from the NG, but I was wrong. When I print my reports to a file or directly to the printer, the orientation is landscape. This was set in the report itself using Designer | Printer Setup and setting the printer to landscape. When I send the report to the viewer, using the...
by: codepuller | last post by:
Consider this approach: Embed the report in your project (add it to the project) Then put this code in the page that holds the viewer control 'Set the connection information crConnectionInfo.ServerName = "servername" crConnectionInfo.DatabaseName = "dbname"
by: Anniech | last post by:
I use VB.NET to integrate with crystal report 9.0 to print a report with custom paper size (using Dot Matrix printer). I have already added a custom paper size in the printer server and set the paper size in crystal report. However, 1. in web form, the crystal report viewer perview cannot identify the paper setting and use A4 instead. The print out is always with A4. 2. in win form, the crystal report viewer preview looks fine but...
by: MadCrazyNewbie | last post by:
Hey Group, Sorry to be a pain yet again. I problem that i don`t know how to get around:( I use the following connection class on my project: Private Shared mConnectionsstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" Private Shared mLocation As String
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far says it's a .net problem. Here's the problem, we're using crystal reports 9 and vb.net and we're using the crystalrepotViewer to show our reports. But every time we open a report the connection to or sql server remains, so if I open 5 forms with the report viewer I've got 5 sleeping connections in...
by: David C. Barber | last post by:
How can I determine if a report in the Crystal Report Viewer on an ASP page has been printed by the user? It's important to know the difference between someone just viewing a report, and actually printing it. In olde days (e.g. VB6) I could hide the print button on the on the report viewer itself, put my own print button on the screen, and log the print action at the same time I called the Print method for the viewer myself. This new...
by: David C. Barber | last post by:
How can I determine if a report in the Crystal Report Viewer on an ASP page has been printed by the user? It's important to know the difference between someone just viewing a report, and actually printing it. In olde days (e.g. VB6) I could hide the print button on the on the report viewer itself, put my own print button on the screen, and log the print action at the same time I called the Print method for the viewer myself. This new...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.