Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Error Adding Image on Export
posted

I'm trying to export a grid that has an image column to PDF.

I'm currently using the CellExporting Event to try add the image.

 protected void dExporter_CellExporting(object sender, DocumentCellExportingEventArgs e)
        {
            if (!e.IsHeaderCell && !e.IsFooterCell && !e.IsSummaryCell)
            {
                if (e.GridCell.Column.Key == "ImageUrl")
                {

                    // Remove Html Tags
                    var url = e.GridCell.Text;
                    var startPos = url.IndexOf("\"") + 1;
                    var endPos = url.LastIndexOf("\"");

                    url = url.Substring(startPos, endPos - startPos);
                    e.ReportCell.AddImage(new Infragistics.Documents.Graphics.Image(url));
                }
            }
        }

 

The issue I am having is that e.ReportCell is always null.
How do I initialize this so that I can format the ReportCell, or should I be trying to do this in a different way