Display a image in ssrs

static public str getImage()
{
    CompanyInfo info = CompanyInfo::find();
    BinData binData = new BinData();
    str ret;
    ;
    //conver image to base64String as .net requirement
    bindata.setData(CompanyImage::find(curext(), info.TableId, info.RecId).Image);
    ret = binData.base64Encode();
    return ret;
}
 
Call this method in SRS and set the source of the image to be this method. 
[DataMethod(), AxSessionPermission(SecurityAction.Assert)]
public static System.Byte[] GetCompanyLogo()
{
    string logoImage = (string)SessionManager.GetSession().CallStaticRecordMethod("CompanyInfo", "getImage");
    byte[] imageBytes = Convert.FromBase64String(logoImage);
    
    return imageBytes; 
}

  

posted @ 2014-09-10 09:18  Sprite.z  Views(261)  Comments(0Edit  收藏  举报