How to Display Multiple Images in One Control

Hi

I have a small Problem In my Report 5 Images there and i Want to display in single Control

i.e selectMintLogo is Option Variable when i select First one First Image will be displyed and i wrote in Expression as

Switch(Fields!SelectMintLogo.Value=Image1,Convert.ToBase64String(Fields!Image1.value),

Fields!SelectMintLogo.Value=Image2,Convert.ToBase64String(Fields!Image2.value))

Like That For 5 images but it Doesn’t Display Any Image.

Note:- i used Code.Get Data and Set Data

Is this Expresion is Correct and any More suggestion Please…[:(]

Thanks & Regards,

Akil Reddy

do you want to display the images at the same time in a table in a row or do you want to display one image at a time and change/switch according to a defined condition?

Hi jonathan,

Thanks For Rply…

As i Mentioned SelectMintLogo is Option Variable and I declared in Request page this Options like that

SelectMintLogo:Image1

Image1 will be displayed in Control1

SelectMintLogo:Image2

Image2 Will be Displayed in Same Control1

Like That i Have a 5 Images

For This one i used Case statement but it is not worked

please Give suggestion…

Thanks in Advance…

Akil

do you call calcfields(picture) before rendering the report?

Hi jonathan,

This is the Code i Written

CASE SelectMintManLogo OF

0:BEGIN

MintManlogo.CALCFIELDS(“Thank You Mint logo”);

Thankspicture:=TRUE;

END;

1:BEGIN

MintManlogo.CALCFIELDS(“Life is Sweet Mint”);

LifeisPicture:=TRUE;

END;

2:BEGIN

MintManlogo.CALCFIELDS(“Yum Mint”);

YumMintPicture:=TRUE;

END;

3:BEGIN

MintManlogo.CALCFIELDS(“Have A Sweet Day Mint”);

HaveAswtDayMintPicture:=TRUE;

END;

4:BEGIN

MintManlogo.CALCFIELDS(“Eat More Candy Mint”);

EatMoreMintPicture:=TRUE;

END;

END;

But i didn’t Get any Image…

Hi Ramesh,

You can try using nested if else in the image control expression that will work.

hi ramesh,

try Convert.FromBase64String instead of Convert.ToBase64String in your switch formula or remove the Convert.ToBase64String and use Fields!Image.Value instead.

in general, the whole thing looks like a bit complicated.

try following:

create a new table “Report Image” to store the pictures. fields:
No. (Code 10 or integer), Picture (Blob, Bitmap), Name (Text 50)

the names should be the values you use for the pictures (“Yum Mint”, …).

use exactly these values as values for the option string (–> request page).

so you can select the picture via setrange(Name, ).

in the report create a global variable TempReportImage (temporary=yes), add TempReportImage.Picture as field (name it e.g. Header_Image) to the report dataitem, load the image into local variable ReportImage according the selected option, then set TempReportImage.Picture = ReportImage.Picture. So the needed image is loaded (use trigger OnPreReport). Simply set the Header_Image field as value to a report image control.

something like that.