Hi, I have a RadGrid defined below. When I click the built-in "Export to PDF" button I get the error listed below:
I found out that it has to do with the ImageURL of the <asp:Image> contained in of the child grid column. If I put a URL link (like "http://somedomain.com/someimage.jpg") it exports correctly.
Is there a way to workaround this or, worse case, handle the export event and remove the image from the export?
Thanks
<telerik:RadGrid ID="RadGrid4" runat="server" Width="99.7%" PageSize="20" AllowPaging="false" AllowSorting="True" AllowFilteringByColumn="false" AllowMultiRowSelection="True" ShowGroupPanel="false" GridLines="None" ShowFooter="false" ShowHeader="true" GroupingEnabled="false" Skin="WebBlue" EnableHeaderContextAggregatesMenu="false" EnableHeaderContextMenu ="false" AutoGenerateColumns="false" EnableViewState="True" OnItemCommand="RadGrid4_OnItemCommand" OnDetailTableDataBind="RadGrid4_DetailTableDataBind" OnItemDataBound="RadGrid4_OnItemDataBound" OnNeedDataSource="RadGrid4_NeedDataSource" OnGroupsChanging="RadGrid4_OnGroupsChanging" OnColumnsReorder="RadGrid4_OnColumnsReorder"> <MasterTableView HierarchyLoadMode="ServerBind" CommandItemDisplay="Top" CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowExportToExcelButton="true" CommandItemSettings-ShowExportToWordButton="true" CommandItemSettings-ShowExportToPdfButton="true" CommandItemSettings-ShowExportToCsvButton="true" AllowMultiColumnSorting="true" Caption=""> <Columns> <telerik:GridTemplateColumn HeaderText="Name" meta:resourcekey="labName" UniqueName="strEnterpriseSiteContactNameValue" HeaderStyle-Width="50%" Resizable="true" Reorderable="true" SortExpression="strEnterpriseSiteContactNameValue"> <ItemTemplate> <%# Eval("strEnterpriseSiteContactNameValue")%> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Title" meta:resourcekey="labTitle" UniqueName="strEnterpriseSiteContactTitleValue" HeaderStyle-Width="50%" Resizable="true" Reorderable="true" SortExpression="strEnterpriseSiteContactTitleValue"> <ItemTemplate> <%# Eval("strEnterpriseSiteContactTitleValue")%> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Company" meta:resourcekey="labCompany" UniqueName="strEnterpriseSiteContactCompanyValue" HeaderStyle-Width="50%" Resizable="true" Reorderable="true" SortExpression="strEnterpriseSiteContactCompanyValue"> <ItemTemplate> <%# Eval("strEnterpriseSiteContactCompanyValue")%> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> <DetailTables> <telerik:GridTableView ShowHeader="false" Name="Detail"> <Columns> <telerik:GridTemplateColumn HeaderText="" UniqueName="strEnterpriseSiteContactField" HeaderStyle-Width="25%" ItemStyle-CssClass="GridFieldColumn" Resizable="true" Reorderable="true"> <ItemTemplate> <%# Eval("strEnterpriseSiteContactField")%> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="" UniqueName="strEnterpriseSiteContactFieldValue" HeaderStyle-Width="75%" Resizable="true" Reorderable="true"> <ItemTemplate> <%# Eval("strEnterpriseSiteContactFieldValue")%> <asp:HyperLink ID="hlEnterpriseSiteContact" Target="_blank" runat="server" Text='<%# Eval("strEnterpriseSiteContactLinkResource")%>' NavigateUrl='<%# Eval("strEnterpriseSiteContactLinkValue")%>'></asp:HyperLink> <asp:Image runat="server" ID="imageProfile" ImageUrl='<%# "ImageHandler.ashx?FileLocation=" + DataBinder.Eval(Container.DataItem, "strEnterpriseSiteContactProfileImageDirectoryPath") + "&FileName=" + DataBinder.Eval(Container.DataItem, "strEnterpriseSiteContactProfileImageFilePath") %>' AlternateText="" Height="80px" Width="65px" BorderWidth="0"></asp:Image> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </telerik:GridTableView> </DetailTables> </MasterTableView> <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> <ClientSettings AllowRowsDragDrop="false" AllowDragToGroup="false" AllowColumnsReorder="false" ReorderColumnsOnClient="false" ColumnsReorderMethod="Reorder"> <Resizing AllowRowResize="False" EnableRealTimeResize="True" ResizeGridOnColumnResize="false" AllowColumnResize="true" AllowResizeToFit="true"/> <Animation AllowColumnReorderAnimation="false" AllowColumnRevertAnimation="true" /> <Selecting AllowRowSelect="false" /> </ClientSettings> <SortingSettings SortedBackColor="Azure" EnableSkinSortStyles="false" /> <GroupingSettings ShowUnGroupButton="true" /> </telerik:RadGrid>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.SystemException: System.ArgumentException: Illegal characters in path. at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path) at System.Web.InternalSecurityPermissions.PathDiscovery(String path) at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) at System.Web.HttpRequest.MapPath(VirtualPath virtualPath) at System.Web.HttpServerUtility.MapPath(String path) at Telerik.Web.Apoc.Image.ApocImageFactory.TryMapPath(String path, String& physPath) at Telerik.Web.Apoc.Image.ApocImageFactory.Make(String href) at Telerik.Web.Apoc.Fo.Flow.ExternalGraphic.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area) at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region) at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area) at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree) at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence) at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement() at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)I found out that it has to do with the ImageURL of the <asp:Image> contained in of the child grid column. If I put a URL link (like "http://somedomain.com/someimage.jpg") it exports correctly.
Is there a way to workaround this or, worse case, handle the export event and remove the image from the export?
Thanks