Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Dinamic Images in Crystal reports Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Tiago_BB
Newbie
Newbie


Joined: 26 Nov 2008
Location: Brazil
Online Status: Offline
Posts: 17
Quote Tiago_BB Replybullet Topic: Dinamic Images in Crystal reports
    Posted: 26 Nov 2008 at 9:09am
I'm having a problem!

I am creating a report of recipes, which for each recipe has a related image, the image is not in the database, but to a local folder in C:

I insert a Picture in Crystal Reports in vb.net 2003, but want to specify code via the path on which is the Picture.

In the code in vb I just get the image name. ImageURL = "path" ... Already in crystal tried the following:

DirectCast (Rel.Section6.ReportObjects.Item ( "Picture11"), AppDomain.CurrentDomain.BaseDirectory & = "Images / SemFoto.jpg"

But the conversion of the following error in my line:

Specified cast is not valid.

We also tried to solve my problem inserting an image in my field of type binary64bits dataset, then I created a new instance of my dataset, but has a property called Relatório.Setdatasource (Dataset) that the image is but ... that property looks just like a switch, if I pass that my dataset, the image appears, but does not appear the data of revenue, and if I pass my DataTable, which is powered with a bank in select SQL, the data appears, however , The image does not.

Have you tried everything, or almost everything.

I need to finalize this project as soon appreciate that.

Thank you all
IP IP Logged
Auk_
Newbie
Newbie
Avatar

Joined: 27 Nov 2008
Location: Bangladesh
Online Status: Offline
Posts: 5
Quote Auk_ Replybullet Posted: 27 Nov 2008 at 3:10am
use vs 2005 and you can do it very easily
IP IP Logged
Tiago_BB
Newbie
Newbie


Joined: 26 Nov 2008
Location: Brazil
Online Status: Offline
Posts: 17
Quote Tiago_BB Replybullet Posted: 27 Nov 2008 at 3:38am
I'm using vs2003.

Any suggestions?

thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 02 Dec 2008 at 11:49am

I don't know if this will work in the version of Crystal that came with VS 2003, but it's worth a try.  Assuming that the image location is stored in your database, do the following:

- Right-click on the image object and select Format Graphic. 
- Go to the Picture tab.
- Click on the "Graphic Location" button.
- In the Formula editor that appears, put the field that contains the path and file name of the image.  Save and Close.
- Click on OK in the Format editor.
 
-Dell
IP IP Logged
Tiago_BB
Newbie
Newbie


Joined: 26 Nov 2008
Location: Brazil
Online Status: Offline
Posts: 17
Quote Tiago_BB Replybullet Posted: 05 Dec 2008 at 3:40am
But the image is not in the database, but to a local folder in C:
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 05 Dec 2008 at 6:56am

Are the path and filename of the image in the database?  That's what my proposed solution uses, not the image itself.

 
-Dell
IP IP Logged
Tiago_BB
Newbie
Newbie


Joined: 26 Nov 2008
Location: Brazil
Online Status: Offline
Posts: 17
Quote Tiago_BB Replybullet Posted: 05 Dec 2008 at 8:58am
No.
Are images into a file in C:\...\imegam.jpg

Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 05 Dec 2008 at 9:01am

How do you know what the file name is for any given recipe?

You could also pass the filepath and name into the report as a parameter and use the technique above to set the image - put the parameter into the formula editor instead of a field.

-Dell

IP IP Logged
Tiago_BB
Newbie
Newbie


Joined: 26 Nov 2008
Location: Brazil
Online Status: Offline
Posts: 17
Quote Tiago_BB Replybullet Posted: 05 Dec 2008 at 9:08am
My code is:

Dim dt As New DataTable
Dim i As Integer
dt = Session.Item("dtRelatorio_028")

Me.crvRelReceitas.ReportSource = Rel
Me.crvRelReceitas.DisplayGroupTree = False
Me.crvRelReceitas.DisplayToolbar = True
Me.crvRelReceitas.BorderColor = Color.Black
Me.crvRelReceitas.BorderStyle = BorderStyle.Solid

Me.crvRelReceitas.DataBind()
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 05 Dec 2008 at 9:17am

Do you know how to create parameters in Crystal?  You then will have to set the parameter value for the report prior to setting the .ReportSource property of the viewer.

I don't do VB, so I can't give you a specific example for how to set the parameter here.  But you can look at sample code in the Developer Libary.  Go to http://devlibrary.businessobjects.com/BusinessObjectsXIR2/en/devsuite.htm and click on "Crystal Reports .NET SDK".  Then click on ".NET Developer Guide and API Reference" and "Tutorials and Sample Code".

-Dell
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.014 seconds.