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!

Inserting picture from a specifc folder

Status
Not open for further replies.

Jyotika123

Programmer
Mar 1, 2010
21
0
0
US
Hi,

Is it possible to program the folder location in crystal reports where the pictures are stored and it automatically picks them. I am talking about approx. 10 pictures at one location.
 
If it is an independent file, insert the picture, then right click and choose Format Picture, click on the the Picture tab, click on the x+2 next to Graphic Location and type in the location of your picture. to follow my previous example but with a file instead of a database field, I would type something like:

"P:\Files for Reports\Pictures\"&{CLIENT.ID1}&".jpg"

now for each client it will display the image from that directory which corresponds to the client's ID1.

Replace the Client.ID1 with whatever field you will use to link the pictures to the records.
 
I don't have any field that link the pictures to the records. I have some charts as jpg's in a specific folder and I want to include those in the report. There is no database field that ties to those charts. Can I import these charts as pictures in crystal? Charts change every week based on the data and are stored as jpg's in a specific folder. I want to include those in the report. I hope this is not confusing.
 
yes, you can import them into crystal and then use the technique i described above but just use the path and file name.
 
I am really not sure what is Client.ID1. When I insert a picture, right click and type the location, it just gives me that 1 picture. For eg., the location and file name are :
"S:\IS\Tech Systems\APC\Crystal pictures\10_2010_02_17_Tysabri_QC Release_Page_01.jpg"
what should I change here so that crystal picks all 10 jpg's on its own without me inserting all one by one. so 2nd jpg's name is 10_2010_02_17_Tysabri_QC Release_Page_02.jpg and so on..
 
i used client.id1 as a sample table.field.

So, let me make sure i understand you now, you want to have 1 inserted picture and have it display 10 pictures, but not have the pictures linked to any database field.

I believe that unless you have the object repeating it will only print 1 image...you cannot insert 1 picture field into the page header/footer/etc and have it display multiple items at once, the object location formula must have some way to iterate, otherwise it will not know what # it should be on. (Sorry for the terrible sentence structure)

If each inserted image document is going to be it's own page you could use this:
IF pagenumber <10 then
(
"S:\IS\Tech Systems\APC\Crystal pictures\10_2010_02_17_Tysabri_QC Release_Page_0" & pagenumber & ".jpg"
)
else
(
"S:\IS\Tech Systems\APC\Crystal pictures\10_2010_02_17_Tysabri_QC Release_Page_" & pagenumber & ".jpg"
)

There is likely a better way, but i am working without caffiene yet today and without crystal currently running.

I think it may be simpler to insert each picture into it's own subsection.
 
Thanks for the reply fisheromacse. I think it will be better if I just insert each picture and then specify the location in the x+2 box next to graphic location.
Another question - The file names will change every week. How do I make sure that everytime the new name is picked up. An eg. is the picture I inserted is named 10_2010_02_17_Tysabri_QC Release_Page_01.jpg but next week it will 10_2010_02_24_Tysabri_QC Release_Page_01.jpg. So every week new pictures are generated with new names and I want my report to go look for the new names.
 
Will the date in the image name consistently be from the same day (ie: Wednesday) of the previous week?

If so, you could create a formula that would replace the date #'s in your file string. This is untested today so be aware & beware.

numbervar dy := year((currentdate)-7);
numbervar dm := month((currentdate-7);
numbervar dd;

IF dayofweek(currentdate)=1
THEN dd := day(currentdate-4)
else
(IF dayofweek(currentdate)=2
THEN dd := day(currentdate-5)
else
(IF dayofweek(..............for the rest of the days of the week, #'s 3 thru 7...........
));
"S:\IS\Tech Systems\APC\Crystal pictures\10_"& dy & "_" & dm & "_" & dd & "_Tysabri_QC Release_Page_01.jpg"


 
although i have never used chelseatech's cViewIMAGE, I can heartily endorse the newsletter & site in general as being very helpful.
 
I have downloaded the cViewImage Utility. Thanks for the help..
 
Hi Chelseatech, I tried using the cViewImage utility but it gets one image at a time. I wanted it to get all the images from the folder. The Image Path variable has the path for all the images but the image variable contains only 1 image. What do you suggest?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top