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
1000
System.Web.HttpException at exporting WHDG
posted

Hi,

I have WebHierarchicalDataGrids on a page that I would like to export to PDF, when do so, I receive the following error:

Error message: 'C:\ProjectPath' is not a valid virtual path. - /PageName.aspx

Source

Class: VirtualPath

Method: Create

Help link: 

Inner exception: System.Web.HttpException: 'C:\ProjectPath' is not a valid virtual path.

at System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options)
at System.Web.HttpServerUtility.MapPath(String path)
at Infragistics.Documents.LinkedStyleCollection.get_StylesheetPath()
at Infragistics.Documents.GraphicsCache.get_StylesheetPath()
at Infragistics.Documents.GraphicsCache.ResolvePath(String filename)
at Infragistics.Documents.GraphicsCache.GetImage(String imagePath)
at Infragistics.Documents.ReportRenderer.ExportHierarchicalGrid(WebHierarchicalDataGrid hGrid)
at Infragistics.Documents.ReportRenderer.Render()
at Infragistics.Web.UI.GridControls.WebDocumentExporter.ConfigureHierarchicalSection(WebHierarchicalDataGrid grid, Report report, ISection hSection)
at Infragistics.Web.UI.GridControls.WebDocumentExporter.Export(WebHierarchicalDataGrid grid, Report report, ISection section)
at Infragistics.Web.UI.GridControls.WebDocumentExporter.Export(WebHierarchicalDataGrid grid)
at ProjectPath.PageName.lnkbtnExportar_Click(Object sender, EventArgs e) in C:\ProjectPath\PageName.aspx.vb:line 276
at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e)
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

The grid and document exporter:

The grid and the document exporter are on the same asp:UpdatePanel
The grid does have a custom pager like the one of the samples (WebDataGrid)
The grid uses a DataSet as DataSource that I rebind on every PostBack. 

 

<ig:WebHierarchicalDataGrid ID="whdg" runat="server" Width="980px" AutoGenerateColumns="False" AutoGenerateBands="false" EnableAjax="true" EnableAjaxViewState="true" EnableTheming="true" EnableDataViewState="true" StyleSetName="Claymation" DataKeyFields="ID" InitialExpandDepth="0" InitialDataBindDepth="0" OnInitializeRow="whdg_InitializeRow" OnColumnSorted="whdg_ColumnSorted">

        <ExpandCollapseAnimation SlideOpenDirection="Auto" SlideOpenDuration="300" SlideCloseDirection="Auto" SlideCloseDuration="300"/>

        <AjaxIndicator Enabled="True"/>

        <Behaviors>

            <ig:Activation Enabled="false">

            </ig:Activation>

            <ig:Sorting Enabled="true" SortingMode="Single">

                <ColumnSettings>

                    <ig:SortingColumnSetting ColumnKey="TipoImage" Sortable="true"/>

                    <ig:SortingColumnSetting ColumnKey="Usuario" Sortable="true"/>

                    <ig:SortingColumnSetting ColumnKey="FechaHora" Sortable="true"/>

                    <ig:SortingColumnSetting ColumnKey="Accion" Sortable="true"/>

                    <ig:SortingColumnSetting ColumnKey="Mensaje" Sortable="true"/>

                </ColumnSettings>

            </ig:Sorting>

            <ig:Paging Enabled="true">

                <PagerTemplate>

                    <ag:WebDataGridPaginacion ID="whdgPaginacion" runat="server" OnPageChanged="whdgPaginacion_PageChanged"/>

                </PagerTemplate>

            </ig:Paging>

        </Behaviors>

        <EmptyRowsTemplate><div style="text-align:center;width:980px;padding:45px 0">No hay datos disponible.</div></EmptyRowsTemplate>

        <Columns>

            <ig:BoundDataField Key="ID" DataFieldName="SeguimientoID" Hidden="true"/>

            <ig:BoundDataField Key="TipoImage" DataFieldName="Tipo" Header-Text="Tp" Width="36px"/>

            <ig:BoundDataField Key="Usuario" DataFieldName="Usuario" Header-Text="Usuario" Width="142px"/>

            <ig:BoundDataField Key="FechaHora" DataFieldName="FechaHora" Header-Text="Fecha y hora" Width="140px" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}"/>

            <ig:BoundDataField Key="Accion" DataFieldName="Accion" Header-Text="Acción" Width="180px"/>

            <ig:BoundDataField Key="Mensaje" DataFieldName="Mensaje" Header-Text="Mensaje" Width="452px"/>

        </Columns>

        </ig:WebHierarchicalDataGrid>

        <ig:WebDocumentExporter ID="WebDocumentExporter1" runat="server" ExportMode="Download" DataExportMode="AllDataInDataSource" TargetPaperSize="A4" TargetPaperOrientation="Portrait" EnableStylesExport="true" Format="PDF"/>

 

Version: 10.3.20103.2105