473,466 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Create 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
command

CR.PrintToPrinter(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
reports.

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(ConfigurationSettings.AppSettings("ConnStrin g"), String)
Prntr = CType(ConfigurationSettings.AppSettings("PrntrName "),
String)
Dim cnn01 As New SqlClient.SqlConnection(ConnString)

'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, OpenReportMethod.OpenReportByTempCopy)
' 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.PaperOrientation =
CrystalDecisions.[Shared].PaperOrientation.Landscape
End Select
' get the printer name from which to print the report
'CR.PrintOptions.PrinterName = Prntr
' print the report
CR.PrintToPrinter(1, False, 0, 0)
Case "Prv"
' Preview the report in the Crystal Report Viewer
CRViewer1.ReportSource = CR
End Select

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

Jan 17 '07 #1
0 2937

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

Similar topics

2
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...
3
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) {
5
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...
1
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...
0
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...
2
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 =...
17
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...
0
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...
0
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.