0

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.

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

any help will be appreciated.

Regards,

Omar Hassan
  • 727
  • 1
  • 11
  • 24
  • Do you have the markup for the page that generates this error? I would like to see any css links and also the related web.config settings for the infragistics.web section. – alhalama Mar 10 '14 at 14:21
  • Done, check the question now after editing it. – Omar Hassan Mar 12 '14 at 08:50
  • You also need to provide the css links on the page as the property that is a factor is to determine whether the exporter is parsing the styles or not. Please provide these for the page and also provide the infragistics.web section of the web.config file. – alhalama Mar 12 '14 at 12:29

0 Answers0