Crystal Reports Conditional graphics

Crystal XI 2

I inserted a picture and used the "Format graphic"- "picture" - "graphic location" and added the following code.

if Remainder (PageNumber, 2) = 1 then
    "\\servername\sharename\Artwork\CFLH.jpg"
else
    "\\servername\sharename\Artwork\LET1.jpg"

For the permission on the share I have given "everyone" full control.

This works at design time. Odd pages have one header, even pages another.

When this reprot is run from a third party application (THINK subscription management) only the default image is displayed. It presumably can't find the images.

I am trying to get help from THINK but they are trying to blame crystal.

I just need it to work.

Any ideas?

TIA
LVL 13
Philip PinnellAsked:
Who is Participating?
 
wykabryanConnect With a Mentor Commented:
taking this in a different direction.. insert each imagine in it own section. then using section expert conditionally suppress each section based on the pagenumber something like this...
RH
PHA - image1 right(totext(pagenumber,'0'),1) in ['1','3','5','7','9']
PHB - image2 right(totext(pagenumber,'0'),1) in ['2,'4,'6','8,'0']
GH
D
GF
PF
RF
0
 
magedroshdyCommented:
does the default image is one of (CFLH.jpg , LET1.jpg) ? if yes, it should work fine, if not it will always show the default image, to make sure it is not the permission do the following
for the inserted picture right click then "Format graphic"- "picture" - "graphic location" and added the following code.
"\\servername\sharename\Artwork\<the picture which is not showing>"

the above without any conditions should show the picture, if it doesn't show. then check the permission
0
 
Philip PinnellAuthor Commented:
The picture that I inserted using "insert"-"picture" is neither CFLH.jpg nor LET1.jpg and is the one displayed when run from the third party app ( THINK)  on all pages.

At design time preview I get CFLH.jpg on odd pages and LET1.jpg on even pages as desired.

It has been suggested that the runtime used by the third party app may be to blame.

I have knocked up a quick dotNet app to run the report. From this I get the correct results. This may indicate the runtime to blame but this app is running under the same security context as design.

I am not sure what security context is used when run via Think.
0
Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

 
magedroshdyCommented:
i'm not aware of THINK, but it should work if the picture you inserted using "insert"-"picture" is one of CFLH.jpg nor LET1.jpg.

could you tried
"\\servername\sharename\Artwork\CFLH.jpg"
or
"\\servername\sharename\Artwork\LET1.jpg"

only in the graphic location formula editor ?
0
 
Philip PinnellAuthor Commented:
with just "\\servername\sharename\Artwork\LET1.jpg" in the formula editor it just shows the inserted picture. This picture is not being read at runtime and so will be shown if the location in the formula cannot be found.


0
 
magedroshdyCommented:
i didn't mean design time when i said "formula editor" , but when finish the design with only one picture (not conditions), try to publish it and check what will happen in the runtime. if it showes you the picture. then you know the problem is not in THINK nor permissions. it is because of the Crystal. and the solution will be
use one of the both pictures in "insert"-"picture" and don't use the third one (default one you're using now)
0
 
Philip PinnellAuthor Commented:
>i didn't mean design time when i said "formula editor"

I don't understand this.


Whatever image that is there by "insert"-"picture" is displayed. This is because it is inserted into the definition (not its location). Any image that has to be resolved and located at runtime is not being displayed.
0
 
magedroshdyConnect With a Mentor Commented:
i got your point, did you make sure of the path is correct? does the pictures outside (THINK) root directory ? maybe THINK is not autherized to access files outside its root directory
0
 
Philip PinnellAuthor Commented:
>did you make sure of the path is correct?

It is as this works at design time and my dotnet test app

>does the pictures outside (THINK) root directory ? maybe THINK is not autherized to access files outside its root directory

Yes and this is something that I am trying to get out of the Think people but I doubt this is it because Think is really just calling the crystal runtime to produce the report. The permissions are full control for "everyone".

I am leaning towards the crystal runtime being used by think being faulty in some way. I am awaiting help on getting it use the same runtime that my dotNet app is using and maybe that might clear things up.

might as well hold this until then.

Thanks for your help so far.
0
 
mlmccCommented:
Good idea on using conditional suppression.

What version of Crystal are you using?

What is the Crystal version of the engine in Think?

mlmcc
0
 
Philip PinnellAuthor Commented:
Suppressing sections as a work around is a good idea and it had occurred to me. It does start becoming a bit unwieldy when there is a fair bit of other info in the section and a lot of different images. I may be stuck with this

My v of Crystal is 11.5.8.826

Don't know what Think is using. Still waiting for help from them.
0
 
Philip PinnellAuthor Commented:
Well I have nothing definite but the Think Crystal runtime is not CrystalXI R2 where as mine is.

They cannot/will not change this so I'll have to use the work around.

either insert images into different sections and conditioanlly supress the sections

or insert the images on top of each other and suppress the images conditionally
0
 
Philip PinnellAuthor Commented:
Thanks for your help
0
 
mlmccCommented:
That is CR XI R2.

mlmcc
0
All Courses

From novice to tech pro — start learning today.