473,395 Members | 1,870 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,395 software developers and data experts.

How to pass image path to crystal report 8 through VB6

5
I have stored image address in the database (Ms-Access).
I wanted to pass run time this image path to crystal report to display the image in report.
I am using VB6, Ms-Access and Crystal report 8.
How to do it?
Nov 3 '06 #1
2 14364
sashi
1,754 Expert 1GB
I have stored image address in the database (Ms-Access).
I wanted to pass run time this image path to crystal report to display the image in report.
I am using VB6, Ms-Access and Crystal report 8.
How to do it?
Hi there,

Will only be able to help u unless u show us your code segment. Think abt it, hope to hear from u soon.
Nov 3 '06 #2
Skiran
5
Hi there,

Will only be able to help u unless u show us your code segment. Think abt it, hope to hear from u soon.

Hi Sashi,

I am working on large-scale project entitled as MIS (Marketing information System). As I told you that I am using Vb 6 as front end, Ms Access as back end and Crystal report 8 as reporting tool.

1) In the project it is required to save dealer’s photo, and it should be shown in individual dealer’s detail report, which will include his/her image. I had taken Common dialog box control to select image and display it in image control.

2) The size of database is very large then, which will be useful from the following?

i. to store image to database?
(But it makes database larger in size which leads to slower access)

ii. Saving path of image in database

To keep database safe I want to try the second option first. Instead coding directly into project, I want test the logic into small program first. As we know that by use of common dialog control we can select image and show it in image control. Also same path can be stored in database. Also we can retrieve the path from database and show it image control.

Until here all things are ok. Now problem is that how to show the image in crystal report. Usually we pass the fields directly to crystal report by sending sql-query to it.

Here is some code part from the project. I am using crystal report viewer control to show the reports.

Following is report module:

Option Explicit

Public Function SET_REPORT_OBJECT(strReportName) As Report

On Error GoTo ErrTrap:

Dim Report_App_obj As Object
Dim Report_Obj As Report

Set Report_App_obj = Nothing
Set Report_App_obj = CreateObject("CrystalRuntime.Application.8")
Report_App_obj.LogOnServer "P2SODBC.DLL", "esm", "", "admin", "cb10esm"
Set Report_Obj = Report_App_obj.OpenReport(App.Path & strReportName, crOpenReportByTempCopy)
Set SET_REPORT_OBJECT = Report_Obj

Exit Function
ErrTrap:
Set SET_REPORT_OBJECT = Nothing
Exit Function
End Function

Following is code to pass the Query string to the report:

cmdAddressLabelPrinting.Enabled = False

On Error GoTo ErrTran
Dim rptName As String

Dim strSQL As String
Dim strQry As String

If chkCourior.Value = 1 Then
rptName = "\rptCouriorLabels2.rpt"
chkCourior.Value = 0
Else
rptName = "\rptLabels.rpt"
End If

Dim StrFilterString As String

'''Code For Manual Selection of Parties
StrFilterString = rsParty.Filter
frmListParties.PrintType = "New"
frmListParties.Show vbModal
If frmListParties.PrintType <> "Done" Then
MsgBox "Cannot continue Printing." & vbCrLf & "No Parties To Print!", vbExclamation + vbOKOnly
Screen.MousePointer = vbNormal
If StrFilterString <> "0" Then
rsParty.Filter = StrFilterString
Else
rsParty.Filter = adFilterNone
End If
rsParty.Requery
cmdAddressLabelPrinting.Enabled = True
Exit Sub
End If
Screen.MousePointer = vbHourglass
'''Code For Manual Selection of Parties

If rsParty.RecordCount = 0 Then Exit Sub

strQry = " Where partyCode in ("

rsParty.MoveFirst
While Not rsParty.EOF
If strQry <> " Where partyCode in (" Then strQry = strQry & ","
strQry = strQry & rsParty.Fields("partyCode")
rsParty.MoveNext
Wend
strQry = strQry & ")"

strQry = strQry & "order by priority ASC "

Set mReport = SET_REPORT_OBJECT(rptName)
strSQL = "SELECT partyName,priority,partyAddress, areaName, CityName, pinCode, stateName, partyPhone1, directorName " & _
"From qryAddressLabels " ' & "ORDER BY priority ASC "

If strQry <> "" Then
strSQL = strSQL & " " & strQry

End If

If mReport Is Nothing Then Exit Sub
mReport.DiscardSavedData

'mReport.ParameterFields(1).ClearCurrentValueAndRa nge
'mReport.ParameterFields(1).AddCurrentValue Str((RegistrationFeeAmt + SalesKitAmount))
mReport.SQLQueryString = ""
mReport.SQLQueryString = strSQL
frmReport.CRViewer1.ReportSource = mReport
frmReport.CRViewer1.ViewReport
Screen.MousePointer = vbNormal
frmReport.Show vbModal
Set mReport = Nothing

If StrFilterString <> "0" Then
rsParty.Filter = StrFilterString
Else
rsParty.Filter = adFilterNone
End If
rsParty.Requery
cmdAddressLabelPrinting.Enabled = True


If you require more details, please let me know. I will make it available.

Regards,

Kiran.
Nov 4 '06 #3

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

Similar topics

1
by: Pablo | last post by:
Friends! I have to load an image in a Crystal, but its path must be passed as a parameter or sth like that so as to allow to show a picture dinamically. Example: i have a table 'Personnel', each...
3
by: Mark | last post by:
Hello all - I'm at wits end with trying to figure out why I'm having this problem since I followed the research, that I've dug up, to a "T". I'm trying to display a JPEG image from a path...
3
by: route_coder | last post by:
I am using access database to create a crystal report in VB.NET Everything works fine when I run on my machine. But when I am deploying it other windows machines. It is asking for database server...
4
by: Marcelo | last post by:
Any suggestion? Thanks Marcelo
1
by: Hexman | last post by:
Hello All, I have a new challenge. I've created a Crystal Report (version 10) and saved the file. Now from my program I want to print it to an Adobe PDF file. My question is: How do I pass...
0
by: Saaima | last post by:
Hi All when I store a picture of size 800*600 pixels in database (SqlServer) field Photo (Image) and load it into crystal report through query by dragging and dropping the field on report it...
0
by: ramkumar533 | last post by:
Hi All.. Now i am doing a Project related with students report. There i need to display the each student profile with his image.. The image location is stored in the database...
1
by: ramkumar533 | last post by:
Hi All.. Now i am doing a Project related with students report. There i need to display the each student profile with his image.. The image location is stored in the database table. While i tried...
0
by: ranesmitas | last post by:
hello, i doing programme Icard Entry .In which i take one field that photo which storer image path . when i run form and enter record in photo coloumn it stores that image path .so i want that how...
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: 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
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,...

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.