473,657 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET App: Crystal Report Direct Printout

10 New Member
Hi I am using VB2005 As Font end and Sql server 2005 express edition as Back end. I want to get direct Printout from VB2005 Using Crystal report.
I want 3 reports to print out on a click Original Duplicate and Triplicate.
How can i do that please help .........

I had used the following piece of code for general of display crystal report...

Expand|Select|Wrap|Line Numbers
  1.     Dim rpstr As String
  2.  
  3.             'rpstr = "select * from viewDefectDiagnosis,ViewVehicle where viewDefectDiagnosis.RegistrationNo=ViewVehicle.RegistrationNo And  viewDefectDiagnosis.booklingno ='" & txtBooking.Text + "'"
  4.             rpstr = "select * from viewRequisitions order by requisitionno"
  5.             Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\ReceiptReport.rpt"
  6.             Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
  7.             Me.Crpt.DiscardSavedData = True
  8.             Me.Crpt.SQLQuery = rpstr
  9.             Me.Crpt.WindowState = Crystal.WindowStateConstants.crptMaximized
  10.             Me.Crpt.Destination = Crystal.DestinationConstants.crptToWindow
  11.             Me.Crpt.Action = 1
Dec 5 '07 #1
12 7098
CyberSoftHari
487 Recognized Expert Contributor
I think in CR only we have default button for print. So why don’t you press it three times. Can you explain your problem detail so it will be easy to the expert to get focus?
Dec 5 '07 #2
Rajib27
10 New Member
Hi You are right we got a default button for print,we can
press it three times if we want three reports to print.

I don't want the reports to pop up over the
VB2005 form everytime.I want to save and print, at the
same time,Thatz why.....
Dec 6 '07 #3
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
Have you tried ReportDocument. PrintToPrinter method?
Dec 6 '07 #4
Rajib27
10 New Member
Hi will you write the complete piece of code please.I didn't find any ReportDocument. PrintToPrinter .
I have tried like this By which I can access the
printer from VB2005 form But I am not getting the required report according to the query made .
Expand|Select|Wrap|Line Numbers
  1. Dim rpstr As String
  2.             rpstr = "select * from viewRequisitions where bookingno ='" & Label15.Text + "'  and " _
  3.                         & "Requisitionno =" & Label9.Text + " and " _
  4.                         & "Vehno ='" & Label13.Text + "' and " _
  5.                         & "RequisitionDate = '" & Format(DTPReqDt.Value, "dd/MM/yyyy") + "'"
  6.             Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
  7.             Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
  8.             Me.Crpt.DiscardSavedData = True
  9.             Me.Crpt.SQLQuery = rpstr
  10.             Me.Crpt.Destination = Crystal.DestinationConstants.crptToPrinter
  11.             Me.Crpt.PrintReport()
please Help........... ..
Dec 6 '07 #5
Rajib27
10 New Member
Hi I am sorry That line of code was okie there was an error in the query thatz why I was not getting the required Report.This Line helps........to get direct printout...
note this *************** **********
Me.Crpt.Destina tion = Crystal.Destina tionConstants.c rptToPrinter
Dec 6 '07 #6
Rajib27
10 New Member
Hi did like this its working fine......I had got printout of 3 bills at the same time
1)Original
2)Duplicate and
3)Triplicate Bills

Expand|Select|Wrap|Line Numbers
  1.  Dim a As String
  2.             Dim i As Integer
  3.             Dim rpstr As String
  4.             rpstr = "select * from viewRequisitions where bookingno ='" & Label15.Text + "'  and " _
  5.                         & "Requisitionno =" & Label9.Text + " and " _
  6.                         & "Vehno ='" & Label13.Text + "'  "
  7.             i = 0
  8.  
  9.             If i = 0 Then
  10.                 a = "Original"
  11.  
  12.                 Me.Crpt.set_Formulas(0, "ob ='" & a + "'")
  13.                 Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
  14.                 Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
  15.                 Me.Crpt.DiscardSavedData = True
  16.                 Me.Crpt.SQLQuery = rpstr
  17.  
  18.  
  19.                 Me.Crpt.Destination = Crystal.DestinationConstants.crptToPrinter
  20.                 Me.Crpt.PrintReport()
  21.                 i = 1
  22.             End If
  23.             If i = 1 Then
  24.                 a = "Duplicate"
  25.                 Me.Crpt.set_Formulas(0, "ob ='" & a + "'")
  26.                 Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
  27.                 Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
  28.                 Me.Crpt.DiscardSavedData = True
  29.                 Me.Crpt.SQLQuery = rpstr
  30.  
  31.  
  32.                 Me.Crpt.Destination = Crystal.DestinationConstants.crptToPrinter
  33.                 Me.Crpt.PrintReport()
  34.                 i = 2
  35.             End If
  36.             If i = 2 Then
  37.                 a = "Triplicate"
  38.                 Me.Crpt.set_Formulas(0, "ob ='" & a + "'")
  39.                 Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
  40.                 Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
  41.                 Me.Crpt.DiscardSavedData = True
  42.                 Me.Crpt.SQLQuery = rpstr
  43.  
  44.  
  45.                 Me.Crpt.Destination = Crystal.DestinationConstants.crptToPrinter
  46.                 Me.Crpt.PrintReport()
  47.             End If
Dec 6 '07 #7
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
Hi Rajib27,
That is wonderful
Thankyou for sharing the solution with us.

- Shashi
Dec 6 '07 #8
rohitbce
30 New Member
hi
i am also done like this and its working fine also in code but in set uo its giving a problem RPC SERVER Enable can you please help me how to solve this problem
thanks
Dec 7 '07 #9
Rajib27
10 New Member
O Sure I will ...just explain me more about your problems in details..
Dec 7 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3625
by: Danny J. Lesandrini | last post by:
First, this is _not_ a question about how to get Crystal Reports to run on a client machine. I've got all the merge modules added to the project and it's working fine. The question is about distributing my .RPT files. 1) Initial Setup Project inclusion of .rpt files: My folder of new .RPT files keeps growing. Is there a way to point my deployment/setup project to the folder containing these .RPT files so they are added...
0
1532
by: Dipendra | last post by:
Have Windows App which makes call to Crystal Reports which is being published as web services. It works but really slow. stored procedures are used to get data from database. The windows app has crystal viewer which consumes the crystal report web service. The problem is, there is an audit trail report which I have to compare item by item to find out what got changed, and dump that into a dataset, load that dataset at runtime, create...
0
1067
by: Yash Talwar | last post by:
hi everyone, I am using crystal report through asp.net on windows 2000 server. Printer is installed on my server, but i cant see the print icon on the report( when i run it on any browser). I can use browser print option, but that also prints various icons or crystal report as well( like next page and previous page icons and search and goto icon) i have worked on crytal reports in VB6.0 as well...there it used to show a printer icon...
1
3071
by: bthomas71chevy | last post by:
I have just setup a WebServer and all the applications work fine, but when every any of the applications try to generate a Crystal Report the page errors out. "File or assembly name CrystalKeyCodeLib, or one of its dependencies, was not found." I read that the 4 MSM files need to be moved to the a MERGE MODULES folder in the Common Files folder, but didn't seem to do a thing.
0
814
by: raulavi | last post by:
Hi: how should I include crystal report setup into deployment project correctly to run with vb.net app Thanks
1
1940
by: Agnes | last post by:
my company got crystal report license to write the report , but my client didn't got it. in my vb.net application, i will call that report. (it runs very well, in my company) Everytime,I modify the report, i will modify in company first, and then copy to my client. Now, as my client run the application and print the report . it sometimes got such errors. "A Crystal Report job failed because a free license could not be obtained in the...
0
1541
by: Tank | last post by:
Hi I am developing a point-of-sales software on asp.net. When sending crystal report to client browser for printing cash bill, browser always popup Acrobat Reader report viewer at client browser before bill can be printed. Anyway for asp.net to send report directly to printer at client side? Too many steps for cashier to get printed bills makes the system unfavorable. Any advice will be greatly appreciated.
0
1287
by: ranesmitas | last post by:
hi , i using vb and backend access and external seagate crystal report i create report having folling code Public strReportPath As String Public strRecordSelection As String Dim crystal As New CRAXDRT.Application Dim Report As New CRAXDRT.Report Private Sub Form_Load() On Error Resume Next
3
3479
by: RajeshNamal | last post by:
Developing asp.net/C# web site, When I testing in my PC Crystal report Direct printing .but when i was Host in my web server it doesn't work. when i preview in crystal report viewer and Print button click print dialog box not loading.... if any body know thise problem pls help me.
0
8403
marktang
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...
0
8737
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8610
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 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...
0
7345
agi2029
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...
1
6174
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4168
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...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
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.