 |
baachi Level: Protégé
 Registered: 16-06-2005 Posts: 4
|
Re: Placing images and text on a crystal report
quote: Aeric wrote:
Have you tried other name? I mean, instead using Section3, try to use name like Sect3. I suspect it's name may have conflict or sharing memory with Section3 of the report.
I tried other name like ....
====
Dim WithEvents Sec3 As CRAXDRT.Section
====
I got the same error even if i remove the following statement after asiging the report...
Set Sec3 = crxReport.Sections(3)
I think the error from declaration part.....
pl...
Sudha
[Edited by baachi on 22-07-2005 at 07:59 AM GMT]
____________________________
Rao N S
|
|
22-07-2005 at 07:58 AM |
|
|
Aeric Level: Professor

 Registered: 16-06-2003 Posts: 72
|
Re: Placing images and text on a crystal report
I am not sure what is the problem. Since you say it is something wrong with the declaration, then you may be right.
I have a suggestion, don't know you have tried before or not.
Try to change the Dimension (Dim) to Private. I think Private may have more memories.
==============================
Private WithEvents Sec3 As CRAXDRT.Section
==============================
[Edited by Aeric on 23-07-2005 at 09:35 AM GMT]
|
|
|
23-07-2005 at 01:34 AM |
|
|
ben.ooi Level: Trainee
 Registered: 01-09-2005 Posts: 3
|
Re: Placing images and text on a crystal report
quote: Goran wrote:
It should be something like this:
| rpt.sections("Section1").reportobjects("picture1")=loadpicture("c:\test.bmp") |
if you want to see what method does picture object has. do this:
dim pic as craxdrt.oleobject
pic.formattedpicture. - to display properties and methods |
hi,
How i know the image to put in the rpt.sections("Section1"), not rpt.sections("Section2") or others. What i means is, how can i determine the section if i want to put my pic in details section ??
Thnks in advances!!
|
|
01-09-2005 at 04:31 AM |
|
|
patriciahsatler Level: Trainee
 Registered: 05-10-2005 Posts: 1
|
Re: Placing images and text on a crystal report
help me please ...
look error messagem in anexed!
Dim WithEvents Section3 As CRAXDRT.Section
Compile error:
invalid attribute in Sub or Function.
|
|
05-10-2005 at 02:38 PM |
|
|
zen Level: Trainee
 Registered: 18-04-2006 Posts: 3
|
Re: Placing images and text on a crystal report
I am having a problem with the code shown below. Actually there wil be no error occur when u try to run it but the problem is, there is no picture displayed in the report viewer.
Can anyone..Help me...
Dim appl As CRAXDRT.Application
Dim rpt As CRAXDRT.Report
Dim WithEvents sect As CRAXDRT.Section
Private sub Form_Load()
Set appl = New CRAXDRT.Application
Set rpt = appl.OpenReport(App.Path & "\Report1.rpt")
rpt.Application.LogOnServer "PDSODBC.DLL", sDatabase, sTable, sUserName, sUserPwd
Set sect = rpt.Sections("Section5")
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = rpt
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End sub
Private Sub sect_format(ByVal pFormattingInfo As Object)
Dim bmp As StdPicture
With sect.ReportObjects
Set bmp = LoadPicture(vfilepath & "5549.jpg")
Set .Item("Picture3").FormattedPicture = bmp
End With
End Sub
|
|
18-04-2006 at 02:47 AM |
|
|
zen Level: Trainee
 Registered: 18-04-2006 Posts: 3
|
Re: Placing images and text on a crystal report
I am having a problem with the code shown below. Actually there wil be no error occur when u try to run it but the problem is, there is no picture displayed in the report viewer.
Can anyone..Help me...
Dim appl As CRAXDRT.Application
Dim rpt As CRAXDRT.Report
Dim WithEvents sect As CRAXDRT.Section
Private sub Form_Load()
Set appl = New CRAXDRT.Application
Set rpt = appl.OpenReport(App.Path & "\Report1.rpt")
rpt.Application.LogOnServer "PDSODBC.DLL", sDatabase, sTable, sUserName, sUserPwd
Set sect = rpt.Sections("Section5")
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = rpt
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End sub
Private Sub sect_format(ByVal pFormattingInfo As Object)
Dim bmp As StdPicture
With sect.ReportObjects
Set bmp = LoadPicture(vfilepath & "5549.jpg")
Set .Item("Picture3").FormattedPicture = bmp
End With
End Sub
|
|
18-04-2006 at 02:47 AM |
|
|
zen Level: Trainee
 Registered: 18-04-2006 Posts: 3
|
Re: Placing images and text on a crystal report
I am having a problem with the code shown below. Actually there wil be no error occur when u try to run it but the problem is, there is no picture displayed in the report viewer.
Can anyone..Help me...
Dim appl As CRAXDRT.Application
Dim rpt As CRAXDRT.Report
Dim WithEvents sect As CRAXDRT.Section
Private sub Form_Load()
Set appl = New CRAXDRT.Application
Set rpt = appl.OpenReport(App.Path & "\Report1.rpt")
rpt.Application.LogOnServer "PDSODBC.DLL", sDatabase, sTable, sUserName, sUserPwd
Set sect = rpt.Sections("Section5")
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = rpt
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End sub
Private Sub sect_format(ByVal pFormattingInfo As Object)
Dim bmp As StdPicture
With sect.ReportObjects
Set bmp = LoadPicture(vfilepath & "5549.jpg")
Set .Item("Picture3").FormattedPicture = bmp
End With
End Sub
|
|
18-04-2006 at 02:47 AM |
|
|
bluetuz Level: Trainee
 Registered: 25-05-2006 Posts: 2
|
Re: Placing images and text on a crystal report
Hi, I have been checking your example code to show images in a report that collects the image from a database field that contains the path to the image. I have this code:
Dim cn As ADODB.Connection
Dim rs1 As ADODB.Recordset
cn = CreateObject("ADODB.Connection")
cn.Open(ConexionReporte)
rs1 = CreateObject("ADODB.Recordset")
rs1.Open(SQLReporte, cn)
rpt = appl.OpenReport("C:\Documents and Settings\David\Mis documentos\Visual Studio 2005\C-Orona\C-Orona\pm.rpt")
rpt.Database.SetDataSource(rs1)
sect = rpt.Sections("Section3")
rptVisor.ReportSource = rpt
The problem is that when I run the application I get a message that says "Invalid Report Source" from the last code line. rptVisor is a Report Viewer control existing in the form.
Could you help me?
Thanks a lot
|
|
25-05-2006 at 09:18 PM |
|
|
deepakkhot Level: Trainee
 Registered: 23-06-2006 Posts: 2
|
Re: Placing images and text on a crystal report
i want to dispaly images in my crysatl reports .
only image path is stored in database and i am using external report .
|
|
23-06-2006 at 02:55 AM |
|
|
deepakkhot Level: Trainee
 Registered: 23-06-2006 Posts: 2
|
Re: Placing images and text on a crystal report
[thanks a lot solved my problem)
|
|
23-06-2006 at 03:08 AM |
|
|
rays Level: Trainee
 Registered: 22-11-2007 Posts: 3
|
Re: Placing images and text on a crystal report
quote: Aeric wrote:
A member asked me if he wants to use my sample with MS SQL server. So i think he just need to change the connection string to SQL Server.
Open my sample project and change the database connection like below:
'Put this in module and set as Public
Public con As ADODB.Connection
'Create a function for the database connection
Public Function BeginDatabase() As Boolean
On Error GoTo checkErr
Set con = New ADODB.Connection
con.Open "Provider=SQLOLEDB.1;Password=" & strPassword & ";Persist Security Info=True;User ID=" & strUserName & ";Initial Catalog= " & strDatabaseName & ";Data Source=" & strServerName
con.Open
BeginDatabase = True
Exit Function
checkErr:
BeginDatabase = False
End Function
'Call the function in Form_Load()
Private Sub Form_Load()
If BeginDatabase = False Then
Msgbox "Error connecting to SQL Server!", vbExclamation
Unload Me 'or use Exit Sub
End If
En Sub
|
[Edited by Aeric on 14-12-2006 at 05:47 PM GMT]
Is there anyway to put dynamic image in external crystal report with file path saved in database using VB.Net. Coz i am getting error in folling code
Dim appl As craxdrt.application
Dim rpt As craxdrt.report
Dim WithEvents sect As craxdrt.section
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rpt As New crpt1
rpt.Section3.ReportObjects("picture1") = loadpicture("c:\test.bmp")
End Sub
getting error
F:\testproj\test\test\Form1.vb(62): Type 'craxdrt.application' is not defined.
|
|
23-11-2007 at 03:28 AM |
|
|
|
|
 |
 |