Switch between images
Posted: Tue Sep 21, 2010 2:10 pm
I am using the WpfDesigner to create a test report. The data source has several boolean columns. On the report if the data in the column is true I want to show a green checkbox image. For false I have a read X image. I add an Image control to the report, but I cannot figure out how to have the image reflect the appropriate image based on the column. I tried adding this to the image data property:
{IIF(UserAccount.HasFullAccess==1,
System.Drawing.Image.FromFile("C:\\Development\\Icons\\GreenCheck.png"),
System.Drawing.Image.FromFile("C:\\Development\\Icons\\RedX.png")
)
}
When I try to preview the report I get the following error:
Cannot implicitly convert type 'string' to 'System.Drawing.Image'
I also notice that when I am in the Image Data tab, that nothing appears in the right, other posts seem to show something (No Data Source expander, etc).
{IIF(UserAccount.HasFullAccess==1,
System.Drawing.Image.FromFile("C:\\Development\\Icons\\GreenCheck.png"),
System.Drawing.Image.FromFile("C:\\Development\\Icons\\RedX.png")
)
}
When I try to preview the report I get the following error:
Cannot implicitly convert type 'string' to 'System.Drawing.Image'
I also notice that when I am in the Image Data tab, that nothing appears in the right, other posts seem to show something (No Data Source expander, etc).