我使用webdatagrid,
当我尝试将datagrid内容导出为pdf时出现此错误
[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.
我的代码如下
WebDocumentExporter1.Format = FileFormat.PDF;
WebDocumentExporter1.Export(WebDataGrid1);
但在尝试此行时
WebDocumentExporter1.EnableStylesExport = false;
导出有效,但没有导出网格样式。
<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>
任何帮助将不胜感激。
此致