none
I will not load the image in the report RRS feed

  • Question

  •  

    I have a image in a report rep.rdlc, the properties of the image are this:
     
    MYMEType:  image/jpeg
    Source:  Database
    Value:  =Fields!FFW_LOGO.Value
     
    I have a cell in the report with the following code

    ="Logo : " & Fields!FFW_LOGO.Value

     

    When the report is render, in the cell I get this

    Logo: ~/images/images_company/moneyAndCom.jpg

     

    I have this picture moneyAndCom.jpg in the following address
    E:\controlmoneycentral\images\images_company\moneyAndCom.jpg
     
    This form of referencing the image ~/images/images_company/moneyAndCom.jpg is correct because I have called elsewhere and it work, except in the rendering of the report, the problem is that when the report is rendered, i get a red X, instead of the image.
     
    please help me
     
    Thursday, November 8, 2007 3:43 PM

Answers

  • >>This form of referencing the image ~/images/images_company/moneyAndCom.jpg is correct because I have called elsewhere and it work

     

    No, it isn't correct.  The report rendering stuff isn't part of ASP.NET, and that syntax is.  It denotes the root of the site.  Remember that the report may be rendered in a winforms control as well as a web site .  There isn't necessarily any root. <s>

     

    I will assume that what you are storing in the database is "~/images/images_company/moneyAndCom.jpg" and that E:\controlmoneycentral is the physical (Server.MapPath) root of your site.

     

    If this is correct, then I suggest you create a parameter to the report, which may be hidden, such as SiteRoot.  Now you can use an expression such as:

     

    Code Block

    =REPLACE(Fields!FFW_LOGO.Value,"~",Parameters!SiteRoot.Value)

     

     

    HTH,

     

    >L<

    Thursday, November 8, 2007 4:33 PM

All replies

  • >>This form of referencing the image ~/images/images_company/moneyAndCom.jpg is correct because I have called elsewhere and it work

     

    No, it isn't correct.  The report rendering stuff isn't part of ASP.NET, and that syntax is.  It denotes the root of the site.  Remember that the report may be rendered in a winforms control as well as a web site .  There isn't necessarily any root. <s>

     

    I will assume that what you are storing in the database is "~/images/images_company/moneyAndCom.jpg" and that E:\controlmoneycentral is the physical (Server.MapPath) root of your site.

     

    If this is correct, then I suggest you create a parameter to the report, which may be hidden, such as SiteRoot.  Now you can use an expression such as:

     

    Code Block

    =REPLACE(Fields!FFW_LOGO.Value,"~",Parameters!SiteRoot.Value)

     

     

    HTH,

     

    >L<

    Thursday, November 8, 2007 4:33 PM
  • Thank you, Lisa, I did this to fix that problem
     
    in a reportparameter i create a parameter called SiteRoot with this value ="http://localhost/controlMoneyCentral"
     
    the values of my image are this:
     
    MIMEType:  image/jpeg
    Source:  External
    Value:  =REPLACE(Fields!FFW_LOGO.Value,"~",Parameters!SiteRoot.Value)
     
    When render the cell this is the value i get:

    http://localhost/controlMoneyCentral/images/

    images_company/moneyAndCom.jpg

     
    with this the image is drawn well .
     
     
    Thursday, November 8, 2007 7:37 PM