如何从资源文件映像更改RDLC报告映像 - 在运行时?

问题描述:

我在VS2010有一个小项目。使用我的RDLC报告,我使用名为Image4的Image Control,我在我的资源文件中添加了3个图像[resx]



Hi, I have a small project in VS2010. With my RDLC Report, I am using Image Control called - Image4 and I added 3 Images to my resource file [resx]

static Reflection.Assembly pxAssembly = Reflection.Assembly.GetExecutingAssembly();
static String pxResName = pxAssembly.GetName().Name + ".ImageResources";
static ResourceManager s_pxResourceManager = (new Resources.ResourceManager(pxResName,pxAssembly));
static System.Drawing.Image MyLogoImg1 = (safe_cast<System.Drawing.Image>(s_pxResourceManager.GetObject("Logo_S1")));
static System.Drawing.Image MyLogoImg2 = (safe_cast<System.Drawing.Image>(s_pxResourceManager.GetObject("Logo_P1")));
static System.Drawing.Image MyLogoImg3 = (safe_cast<System.Drawing.Image>(s_pxResourceManager.GetObject("Logo_C1")));





我希望在运行期间根据我的字段值更改Image4 ...是否可以?





I wish to change the Image4 according to my field value during runtime...Is it possible?

Image4.Value=IIf(First(Fields!company_name.Value, "DataSet1").ToString().Trim().Contains("C.N"), ? , ? )



感谢帮助


Thanks For The Helps