473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Multiple Table in Crystal Report

hi,

I need a help regarding crystal report in vb6. I need to retrieve data from 3 tables in 1 report.I have do data and image retrieving from single table but now i need to display data from 3 table.How can i do so?Please help me...urgent to finish up my project.

Thanks in advance.
Jul 7 '08 #1
2 3217
debasisdas
8,127 Expert 4TB
you can create a view based on data of multiple tables.
Jul 7 '08 #2
View based report ? Im doing a view based report also. Im confused here. I give my code for single table report .

Option Explicit
Dim cn As ADODB.Connection
Dim crx As New CRAXDRT.Application
Dim rpt As CRAXDRT.Report
Dim db As CRAXDRT.Database
Dim rs As New ADODB.Recordset
Dim WithEvents sect As CRAXDRT.Section
Dim rptObject As CRAXDRT.ReportObjects
Dim i As Integer

Private Sub Form_Load()

Set cn = New ADODB.Connection
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.ConnectionString = "Data Source=" & App.Path & "\Everspark2.mdb"
cn.Properties("Jet OLEDB:Database Password") = "abc123"
cn.Open

Screen.MousePointer = vbHourglass
Set rpt = crx.OpenReport(App.Path & "\Report\Alternator5.rpt")
Set db = rpt.Database
Set sect = rpt.Sections("Section5")
'rs.Open "SELECT * FROM Alternator WHERE Alternator.EversparkNo = '" & frmProductCatalog.txtEversparkNo.Text & "'", cn, 1, 1

rpt.DiscardSavedData
rpt.Database.SetDataSource rs, 3, 1
Me.Refresh
CRViewer1.ReportSource = rpt
CRViewer1.ViewReport

Do While CRViewer1.IsBusy
DoEvents
Loop

CRViewer1.Zoom 1

Screen.MousePointer = vbDefault

Set crx = Nothing
Set rpt = Nothing
Set rs = Nothing
Set sect = Nothing
Set rptObject = Nothing

Exit Sub

End Sub


Private Sub sect_Format(ByVal pFormattingInfo As Object)

Dim bmp As StdPicture

On Error Resume Next

With sect.ReportObjects

Set .Item("picImageFront").FormattedPicture = LoadPicture(App.Path & "\Alternator\101001A.jpg") 'default
Set .Item("picImageLeft").FormattedPicture = LoadPicture(App.Path & "\Alternator\101001B.jpg") 'default
Set .Item("picImageRight").FormattedPicture = LoadPicture(App.Path & "\Alternator\101001C.jpg") 'default
Set .Item("picPlugDetails").FormattedPicture = LoadPicture(App.Path & "\Alternator\Plugs\001P.jpg") 'default

If .Item("adoImgFront").Value <> "" Then
Set bmp = LoadPicture(App.Path & "\Images\Alternator\" & .Item("adoImgFront").Value)
Set .Item("picImageFront").FormattedPicture = bmp
End If

If .Item("adoImgLeft").Value <> "" Then
Set bmp = LoadPicture(App.Path & "\Images\Alternator\" & .Item("adoImgLeft").Value)
Set .Item("picImageLeft").FormattedPicture = bmp
End If

If .Item("adoImgRight").Value <> "" Then
Set bmp = LoadPicture(App.Path & "\Images\Alternator\" & .Item("adoImgRight").Value)
Set .Item("picImageRight").FormattedPicture = bmp
End If

If .Item("adoPlugDetails").Value <> "" Then
Set bmp = LoadPicture(App.Path & "\Images\Alternator\Plugs\" & .Item("adoPlugDetails").Value)
Set .Item("picPlugDetails").FormattedPicture = bmp
End If

End With

Set bmp = Nothing

End Sub

Private Sub Form_Resize()

CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth

End Sub

Private Sub Form_Unload(Cancel As Integer)

cn.Close
frmProductCatalog.Show

End Sub


i used this code 2 retrieve data and image from 1 table. But now i want to retrieve more information from another different table within the same report ....i cant get the solution..yet..Please help me...Thanks
Jul 7 '08 #3

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

Similar topics

2
by: cj | last post by:
Has anyone come across the following error in running a Crystal Report in ASP.NET using the Crystal Reports Web Viewer control... CrystalDecisions.CrystalReports.Engine.InvalidArgumentException:...
4
by: mitmed | last post by:
Hi, I hope someone here can help me. We have a product table which has a many-to-many relation to a category table (joined through a third "ProductCategory" table): ---< >--- --------- ...
0
by: Sameer | last post by:
Hello I have a simple crystal report. Report is displayed using CrystalReportViewer control in a web form. It works fine. There is one problem with the database connection logic. Whenever I...
3
by: lee_mcknight | last post by:
I am using Crystal Enterprise V9. I have a report that needs to have multiple datasets as the datasource(s) on a single subreport (some common lookup data I need to join to is stored in a seperate...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
3
by: Amar | last post by:
I have a abc.PRG file in visual foxpro 8.0. I can run this file using visual foxpro environment and it creates a table X.dbf in the same folder where this program file is and populates some data...
1
by: monskie | last post by:
Hello to all, I have a problem which could be trivial to you guys. This concerns opening several crystal reports on the a crystal viewer on an ASPX page by calling window.open. My...
0
by: lrobo01 | last post by:
I'm having a problem with Crystal report.net with ASP.NET. The problem occurs when exporting the report. The report uses a discrete parameter with multiple values. When the report is loaded into...
1
by: pintoo | last post by:
Hi, I have 2 sites (Site A, B) running on same windows 2003 server pointing to different home directories. User logs into site A and is shown a.aspx page and user credentials are saved in...
0
by: raj3109 | last post by:
Hi experts, I’d like to have some helps from you guys. I need to create an app with C# and Crystal Report.Net using VS 2008 for a Landscape & Nursery company. The company will send out coupon...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...

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.