This project has moved. For the latest updates, please go here.

html column template is not adding image

Feb 15, 2016 at 9:57 AM
I am trying to insert an image for html template column by reading from the file. but in my case the image doesnt appear in the report.
var directory = Path.Combine(AppPath.ApplicationPath, "Temp");
var filepath = Path.Combine(directory, admissionNumber + ".png");
var image = string.Format("<img height='100' width='100' src='{0}' />", filepath);

var fulladdress = string.Format("{0}, {1}", address, phonenumber);
return
@"<table style='width: 100%; font-size:12pt; cellpadding:10px; padding:10px;'>
    <tr>
        <td align='left' style='width:110px;'> Admission No</td>
        <td align='left' style='width:200px;'><b>: "+ admissionNumber + @"</b></td>
        <td align='left' style='width:110px;'></td>
        <td align='right' rowspan='6' >" + image + @"</td>
    </tr>
Feb 17, 2016 at 7:09 AM
Edited Feb 17, 2016 at 7:12 AM
My bad, making the Uri object with the file path resolve the issue. I am able to see the images now.
var filepath = new Uri(Path.Combine(directory, admissionNumber + ".png") );
var directory = Path.Combine(AppPath.ApplicationPath, "Temp");
 var filepath = new Uri(Path.Combine(directory, admissionNumber + ".png") );
 var image = string.Format("<img src='{0}' height=80 width=100 />", filepath);

                         
var tableColumn =
       @"<table style='width: 100%; font-size:12pt; cellpadding:5px; padding:5px;'>
      <tr>
            <td align='left' style='width:10px;  height:20px;'></td>
            <td align='left' style='width:110px;'>Admission No</td>
            <td align='left' style='width:250px;'><b>: " + admissionNumber + @"</b></td>
            <td align='left' style='width:110px;'></td>
            <td align='right'  rowspan=5 style='width:110px;'>" + image + @"</td>
            <td align='left' style='width:10px;'></td>
        </tr>