0
我使用來自System.Web.DataVisualization的圖表。該進程無法訪問文件錯誤與System.Web.UI.DataVisualization.Charting
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
...
<asp:Chart ImageType="Png" runat="server" ID="chartStatComp" Palette="BrightPastel"
ImageLocation="~/CRM/Reports/chartStatComp_#SEQ(100,10)" ImageStorageMode="UseImageLocation"
Width="620" Height="300">
<ChartAreas>
<asp:ChartArea Name="MainChartArea">
</asp:ChartArea>
</ChartAreas>
<Series>
<asp:Series ChartArea="MainChartArea" ChartType="Pie" XValueType="String" YValueType="Int32"
CustomProperties="DoughnutRadius=25, PieDrawingStyle=Concave, CollectedLabel=Other, MinimumRelativePieSize=20"
XValueMember="StateDescription" YValueMembers="CNT" Legend="Legend" IsVisibleInLegend="true"
IsValueShownAsLabel="true">
</asp:Series>
</Series>
<Legends>
<asp:Legend LegendStyle="Table" Name="Legend" Alignment="Near"
TitleAlignment="Near">
<CellColumns>
<asp:LegendCellColumn Text="Color" ColumnType="SeriesSymbol" />
<asp:LegendCellColumn Text="#LEGENDTEXT" ColumnType="Text" Alignment="TopLeft" HeaderText="State" />
<asp:LegendCellColumn Text="#VAL" ColumnType="Text" Name="Cnt" Alignment="TopLeft"
HeaderText="Count" />
<asp:LegendCellColumn Text="#PERCENT" ColumnType="Text" Name="Percentage" Alignment="TopLeft"
HeaderText="%" />
</CellColumns>
</asp:Legend>
</Legends>
</asp:Chart>
它在大多數情況下運作良好。但有時用戶會得到例外:
System.IO.IOException: The process cannot access the file '~\Reports\chartStatComp_000001.png' because it is being used by another process.
它發生的事情非常罕見,但確實如此。 有沒有人遇到類似的問題?
好吧。我只是添加了代碼巫婆給文件獨特的名稱和清理舊的。新文件更新被鎖定。 –