Dear all,
Iam using webdatagrid,
when i try to export the datagrid contents to pdf i got this error
[HttpException (0x80004005): 'C:\inetpub\wwwroot\Images' is not a valid virtual path.] System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +11371527 System.Web.HttpServerUtility.MapPath(String path) +106 Infragistics.Documents.LinkedStyleCollection.get_StylesheetPath() +504 Infragistics.Documents.GraphicsCache.ResolvePath(String filename) +234 Infragistics.Documents.GraphicsCache.GetImage(String imagePath) +96 Infragistics.Documents.GraphicsCache.GetTextureBrush(String imagePath) +83 Infragistics.Documents.BackgroundTiling.Infragistics.Documents.Report.IDrawing.OnDraw(IGraphics graphics, Single x, Single y, Single width, Single height) +137 Infragistics.Documents.Report.Projection.Area.DrawBackground(IGraphics graphics, Single left, Single top, Single width, Single height, Background background) +196 Infragistics.Documents.Report.Projection.Composition.Draw(IGraphics graphics) +257 Infragistics.Documents.Report.Projection.Composition.Draw(IGraphics graphics) +352 Infragistics.Documents.Report.Projection.Composition.Draw(IGraphics graphics) +352 Infragistics.Documents.Report.Projection.Composition.Draw(IGraphics graphics) +352 Infragistics.Documents.Report.Projection.Composition.Draw(IGraphics graphics) +352 Infragistics.Documents.Report.Projection.ProjectionPage.Draw(IGraphics graphics) +120 Infragistics.Documents.Report.Report.Publish(Stream stream, FileFormat format) +3386 Infragistics.Web.UI.GridControls.WebDocumentExporter.Export(WebDataGrid grid, Report report, ISection section) +265 WebApp.Report.ExportPDF(Object sender, EventArgs e) in E:\Projects\Pro\Pro\Src\rr\ff.aspx.cs:70 System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +98 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +161 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981.
My code is as following
WebDocumentExporter1.Format = FileFormat.PDF; WebDocumentExporter1.Export(WebDataGrid1);
but when trying this line
WebDocumentExporter1.EnableStylesExport = false;
the exporting works but without exporting the grid styles.
any help will be appreciated.
Regards,
Dear Infragestics support team, please advise.
Hello Omar,
In order to be able to research this scenario and provide you with feedback I would need information on the steps to configure the scenario in order to reproduce the issue, and relevant information on the product version used. Is the grid in this scenario using a custom styleset, or a styleset path ?
A small working sample illustrating the behavior would be greatly appreciated.
Please do not hesitate to contact me with updates or questions.
Hello Petar,
the used version is v10.3 for CLR3.5.
the used grid uses the default style sheet.
working sample
<div style="width:800px; overflow:auto">
<ig:WebDataGrid ID="webDataGridReport" runat="server" Height="800px" EnableDataViewState="True" DataSourceID="SqlDataSourceReport" oninitializerow="webDataGridReport_InitializeRow" > <Behaviors> <ig:ColumnResizing> </ig:ColumnResizing> <ig:Filtering> </ig:Filtering> <ig:Paging PageSize="15" QuickPages="5" PagerAppearance="Bottom" > </ig:Paging> </Behaviors> </ig:WebDataGrid> <asp:SqlDataSource ID="SqlDataSourceReport" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"></asp:SqlDataSource>
<ig:WebScriptManager ID="WebScriptManager1" runat="server"> </ig:WebScriptManager>
<ig:WebDocumentExporter ID="WebDocumentExporter1" runat="server" DataExportMode="AllDataInDataSource"> </ig:WebDocumentExporter>
<ig:WebExcelExporter ID="WebExcelExporter1" runat="server" DataExportMode="AllDataInDataSource"> </ig:WebExcelExporter> </div>
Regards
Omar Hassan
Thank you for your reply.
There appear to be no issues with the code provided. In order to be able to examine this matter further I would need a working application which illustrates the issue so as to be able to investigate the matter locally.
Please do not hesitate to contact me with any questions or updates.
Please do not hesitate to contact me if you are still experiencing issues with this matter.