?
Solved

Crystal Reports Conditional graphics

Posted on 2010-01-13
14
Medium Priority
?
889 Views
Last Modified: 2013-12-04
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
0
Comment
Question by:Philip Pinnell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 2
  • +1
14 Comments
 
LVL 6

Expert Comment

by:magedroshdy
ID: 26302381
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 26302449
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
 
LVL 6

Expert Comment

by:magedroshdy
ID: 26302491
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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 13

Author Comment

by:Philip Pinnell
ID: 26302625
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
 
LVL 6

Expert Comment

by:magedroshdy
ID: 26302669
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 26302716
>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
 
LVL 6

Assisted Solution

by:magedroshdy
magedroshdy earned 600 total points
ID: 26302834
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 26302872
>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
 
LVL 16

Accepted Solution

by:
wykabryan earned 1400 total points
ID: 26303452
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
 
LVL 101

Expert Comment

by:mlmcc
ID: 26310586
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 26339206
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 26368955
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
 
LVL 13

Author Comment

by:Philip Pinnell
ID: 26368970
Thanks for your help
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 26375119
That is CR XI R2.

mlmcc
0

Featured Post

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question