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
70
Webdatagrid 'C:\inetpub\wwwroot\Images' is not a valid virtual path.
posted

Dear all,

Iam using webdatagrid, 

when i try to export the datagrid contents to pdf i got this error

'C:\inetpub\wwwroot\Images' is not a valid virtual path.

[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,