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... -
Dim rpstr As String
-
-
'rpstr = "select * from viewDefectDiagnosis,ViewVehicle where viewDefectDiagnosis.RegistrationNo=ViewVehicle.RegistrationNo And viewDefectDiagnosis.booklingno ='" & txtBooking.Text + "'"
-
rpstr = "select * from viewRequisitions order by requisitionno"
-
Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\ReceiptReport.rpt"
-
Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
-
Me.Crpt.DiscardSavedData = True
-
Me.Crpt.SQLQuery = rpstr
-
Me.Crpt.WindowState = Crystal.WindowStateConstants.crptMaximized
-
Me.Crpt.Destination = Crystal.DestinationConstants.crptToWindow
-
Me.Crpt.Action = 1
12 7098
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?
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.....
Have you tried ReportDocument. PrintToPrinter method?
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 . -
Dim rpstr As String
-
rpstr = "select * from viewRequisitions where bookingno ='" & Label15.Text + "' and " _
-
& "Requisitionno =" & Label9.Text + " and " _
-
& "Vehno ='" & Label13.Text + "' and " _
-
& "RequisitionDate = '" & Format(DTPReqDt.Value, "dd/MM/yyyy") + "'"
-
Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
-
Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
-
Me.Crpt.DiscardSavedData = True
-
Me.Crpt.SQLQuery = rpstr
-
Me.Crpt.Destination = Crystal.DestinationConstants.crptToPrinter
-
Me.Crpt.PrintReport()
please Help........... ..
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
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 -
Dim a As String
-
Dim i As Integer
-
Dim rpstr As String
-
rpstr = "select * from viewRequisitions where bookingno ='" & Label15.Text + "' and " _
-
& "Requisitionno =" & Label9.Text + " and " _
-
& "Vehno ='" & Label13.Text + "' "
-
i = 0
-
-
If i = 0 Then
-
a = "Original"
-
-
Me.Crpt.set_Formulas(0, "ob ='" & a + "'")
-
Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
-
Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
-
Me.Crpt.DiscardSavedData = True
-
Me.Crpt.SQLQuery = rpstr
-
-
-
Me.Crpt.Destination = Crystal.DestinationConstants.crptToPrinter
-
Me.Crpt.PrintReport()
-
i = 1
-
End If
-
If i = 1 Then
-
a = "Duplicate"
-
Me.Crpt.set_Formulas(0, "ob ='" & a + "'")
-
Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
-
Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
-
Me.Crpt.DiscardSavedData = True
-
Me.Crpt.SQLQuery = rpstr
-
-
-
Me.Crpt.Destination = Crystal.DestinationConstants.crptToPrinter
-
Me.Crpt.PrintReport()
-
i = 2
-
End If
-
If i = 2 Then
-
a = "Triplicate"
-
Me.Crpt.set_Formulas(0, "ob ='" & a + "'")
-
Me.Crpt.ReportFileName = "D:\TrialFleet\TrialFleet\Bin\Debug\Report\RequsitionReport.rpt"
-
Me.Crpt.Connect = "DSN=FleetDSN;UID="";Pwd="";"
-
Me.Crpt.DiscardSavedData = True
-
Me.Crpt.SQLQuery = rpstr
-
-
-
Me.Crpt.Destination = Crystal.DestinationConstants.crptToPrinter
-
Me.Crpt.PrintReport()
-
End If
Hi Rajib27,
That is wonderful
Thankyou for sharing the solution with us.
- Shashi
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
O Sure I will ...just explain me more about your problems in details..
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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...
|
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.
|
by: raulavi |
last post by:
Hi:
how should I include crystal report setup into deployment project correctly
to run with vb.net app
Thanks
| |
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...
|
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.
|
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
|
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.
|
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: 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...
| |
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: 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...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |