Hi expert, I created an Option variable with two strings A, B and added to the request page of the report. In the RDLC, I uploaded two images(A, B) and set the image property embed and visibility to hide. In the hide value, I have the following code:
=Switch(Fields!image.Value=1,"A", Fields!image.Value=2, "B")
When I ran the report and selected the option A(not sure why it is not displaying as option button, but instead it showed the dropdown list A, B), Image A didn't show (
only showed icon of missing image). But when I selected B from the dropdown list, it showed image B perfectly. I tried to switch A & B, but this time image B which was A on the first testing didn't show on the report (only showed the icon of missing image). When I selected B (It was A on the first test), the image showed perfectly.
Why does it not work for the first dropdown item in my case? I need your professional advice. Thank you very much!
Your Statement was quite confusing but please find below as per my understanding -
a) Option field are shown in report as you see them.
b) why are using embedded report, I am not sure about it.
c) I tried using database image and it worked fine with me. Here is what I did -
1. added one more field say picture 2 in company information and added same to page.
2. imported the image from the company information card.
3. Created a report based on company information. Used calcfields to get values of images.
4. Create a option variable as you said.
5. created three images in visual layout.
6. 1 image have -
Source Expr - =First(Fields!Picture_CompanyInformation.Value,"DataSet_Result")
Visiblity - =IIF(Fields!MyOption.Value ="A",False,TRUE)
6. 2 image have -
Source Expr - =First(Fields!Picture2_CompanyInformation.Value,"DataSet_Result")
Visiblity - =IIF(Fields!MyOption.Value ="B",False,TRUE)
6. 3 image have -
Source Expr - =IIF(Fields!MyOption.Value = "A",First(Fields!Picture_CompanyInformation.Value, "DataSet_Result"),First(Fields!Picture2_CompanyInformation.Value, "DataSet_Result"))
Visiblity - SHOW.
It works fine. I don't know what is the issue that you have.
You can find related objects from my skydrive folder [NAV 2013]. Here is the link -
Let me know if you require any further information.
Thank you expert! I tried exactly as you said, but only B logo showed no matter what option I selected. I tried to study your sample. But after importing the object, I cannot run it and it displayed the error of that I didn't have the right. Please advise! Thank you!
Renumber the Report object to your licensed Range. May be somewhere in 50000.
Let me know if any issues.
Hi expert, I cannot do anything. renaming, opening etc. Thank you!
Can you tell me a free Report ID in your Permitted Range. I will re-number and re-send it to you.
Hi expert! Thank you for your kind reply and help! How about 50050? BTW, I have imported the object you gave to me, but I cannot delete it from the system now. Is there any way to remove it? Thank you!
I have another way, I use to insert different Pictures in an invoice header:
First create a global record variable - FirmaTmp (Rec=Company) and set property to temporary.
IF COMPANYNAME = 'CompanyXXX' THEN FirmaTmp.Picture.IMPORT(Drive+':\Logo\XXX.bmp');
IF COMPANYNAME = 'ITG Hosting A/S' THEN FirmaTmp.Picture.IMPORT(Drive+':\Logo\itghosting.bmp');
With this code you dont have to chance the company-record.
Maybe you can use this.
Other Microsoft Sites
I'm a Customer
I'm a Partner
Follow Microsoft Dynamics