Binding to set StyleBackgroundImage

2 posts, 0 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 11 Nov 2011 Link to this post

    I can set an image URI if I use a picture box.

    But the only option I seem to have when binding is to bind the actual image.

    So, given that I need to pass the URI of an image to the report (this is for the logo to be used. It is stored as a physical file on the web server. There is no option for saving it in the DB) and that I want to use said image as a background for my Page Header, what do I do?

    I know I could just use a picture box, but the image is fairly big and uses a lot of space. I can't overlap the image and the textboxes the data from my Page Header 'cos that's not allowed, so my only real option is to set the image as the background image in the style.

    As always, any and all help, etc.

  2. Elian
    Elian avatar
    435 posts

    Posted 11 Nov 2011 Link to this post

    Hello Stuart,

    You can create an user function ConvertImage(string url) that takes the URL string and converts it to Image type. The image type then can be bound to the Style.BackgroundImage.ImageData property of the page header. Find attached a sample project with this functionality.

    Kind regards,
    the Telerik team

    Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

Back to Top