Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Graphic Location

Status
Not open for further replies.

JasonKaufman

Programmer
Apr 13, 2006
46
0
0
US
I am using Crystal XI
I want to be able to create a report that will take the location of a product's jpg file from our system

The application software stores the location such as "Q:\Product Master\Cads\0232_15_6_72_Houndstooth_Pink\0232_15_6_72_Houndstooth-Pink.jpg"

and then would have Crystal go to that location and display the picture rather than repeating the text of where the graphic is located (as above)

So regardless of various parameters want the picture associated with each product to appear (rather than the location that is stored in the software).

I have attempted to use Dynamic Graphic Location and was able to display a simple web location jpg pic to the report by doing the following:
1st linking to any graphic and then right click on graphic, select 'Format Graphic', select 'Picture' tab, then clicked on the formula for Graphic Location and for the formula put in
Code:
"[URL unfurl="true"]http://img124.imageshack.us/img124/5351/51004941wj0.jpg"[/URL]
with the quotes intact. This displayed the web pic on the report.

All that is good and fine but I have yet to read how to go to a location on the server as I am wanting above. Of course this may not even be possible, but would be nice if it was.
 
http: assumes the file is on a web server.

You can also access the Q drive directly with a formula of
"Q:\Product Master\Cads\" + {table.productid} + "\" +
{productid} + ".jpg"

The reason Crystal use HTTP is that will work better on Web based report delivery systems. A network drive will work inside Crystal or 3rd party report viewers - and probably NOT on web servers, as services can't see mapped drives like Q:

A UNC path should work on both methods...
"\\Server\QSharedFolder\Product Master\Cads\" +
{table.productid} + "\" +
{productid} + ".jpg"

 
+1 to bruce.

i do just that in several reports that are run in-agency.
i make sure to drop all the images into a directory/sub-directory that anyone in-agency can read.
 
While I have seen this formula previously
"Q:\Product Master\Cads\" + {table.productid} + "\" +
{productid} + ".jpg"

I am just not sure how I can incorporate that into what I am wanting to do.
Consider that the images are in the Cads folder, but theoretically could be elsewhere when being pulled into our application software by the location such as
Q:\Product Master\Cads\0232_15_6_72_Houndstooth_Pink\0232_15_6_72_Houndstooth-Pink.jpg
or
Q:\Product Master\Cads\Cads\0000_37_3_52_Pin Dot and Stripe Crew-Navy\0003_61_1_73_Butterfly Dancer\0003_61_1_73_Butterfly Dancer.jpg
or
some other location.
Yes, its not good to have these images spread all over, but I don't have any power over that.

Which is why i was hoping that I would be able to have the entire link location being referenced in the formula.

I look at the given formula and I wonder how to accomplish this as each picture is housed in its own folder within a larger folder.
 
unless you have some identifying information in your database to point you to the correct location, i do not see how crystal could know which graphic to choose.
do you have the graphic locations in a database field? or some logical way to figure out where each graphic is located for each product?
 
The only thing I would have to identify where the graphics are located is the link location found on the product maintenance screen in the application software as shown below as:
Q:\Product Master\Cads\0232_15_6_72_Houndstooth_Pink\0232_15_6_72_Houndstooth-Pink.jpg
productxt.jpg
 
it appears the link is stored in a field in the database, so once you find that field you should be able to use it in the 'x+2' graphic location.
the issue will still likely be others having access to the saved image location.
 
If all the images are in the same folder, but you want the flexibility of having that folder whereever you want, I'd make the path to the folder a parameter in the report.

{?ImagePath} + {table.productid} + "\" + {productid} + ".jpg

Load some well used default values and it should work nicely
 
Fisher: you should be able to use it in the 'x+2' graphic location.
Could you please explain what you mean by using it in the 'x+2' graphic location? I am not familiar with that.

Bruce: If all the images are in the same folder...
While the images are in the same main folder "Cads", the pics are then subsequently buried down 1 or 2 folders within the main folder and each graphic is in its own folder.
 
it is where you enter the location for the dynamic graphic.
you need to find the field in the table in which the image location is stored.
then right click on graphic, select 'Format Graphic', select 'Picture' tab, then clicked on the formula ('x+2') for Graphic Location and put the field from the database there. ie: {table.imgloc}
 
fisher: it is where you enter the location for the dynamic graphic. you need to find the field in the table in which the image location is stored.
ah yes, while it does say 'x+2' there, I never really looked at it and just thought of it as a formula bar.

So while I have attempted utilizing the 'x+2' formula bar, I have yet to be able to provide a satisfactory way of being able to call out the graphic for more than one product. As I replied to Bruce above, the graphics are each stored in their own folder along with other non graphic details.

So it does not seem possible to me, unfortunately, to allow Crystal to have the entire mapped location such as
Q:\Product Master\Cads\0232_15_6_72_Houndstooth_Pink\0232_15_6_72_Houndstooth-Pink.jpg
to find and display the graphic.
Since for all users, the Q drive would mean the same drive each time.
 
can you confirm that you know the field/table in the database that stores the location of the image as text?

if none of the other directories change, you could substitute a UNC path for the "Q:" or upload all your images to a web server with the same structure and substitute in the http path. but again whatever location you use would need to be a consistent location, accessible for all users.
 
can you confirm that you know the field/table in the database that stores the location of the image as text?

Yes, the table.field is: {product.image-file-1}
 
Hey,
I think I got it!

For the Graphic Location I put: {product.image-file-1}
THEN,
On the Hyperlink tab, I selected 'file' then in the 'x+2' formula bar below i also put: {product.image-file-1}

I was able to test for 2 different products that were different from the selected graphic and they came up just fine.

Now I have the problem of data being too long for Crystal, likely the mutiple folders one within the other.
toolong.jpg


If you know how to resolve this wrinkle, that would be great.

In any case, thanks to both of you for your unceasing help in this matter!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top