var exporter = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport();
var ReportPath = OriginalReportPath;
GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(ReportPath));
rpt.Report.DataSources[0].ConnectionProperties.ConnectString = System.Configuration.ConfigurationManager.ConnectionStrings["SQLConn"].ConnectionString;
只有1个人产生PDF时,没有任何问题,但2个人在「同时同分同秒」产生PDF时,会产生错误「An item with the same key has already been added.」
在exporter.Export(rpt.Document, path) 这一段;
请问这个要如何解决?
详细错误讯息:
GrapeCity.ActiveReports.ReportException: An unexpected error occurred. Additional information: 'An item with the same key has already been added.' ---> System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at GrapeCity.ActiveReports.Expressions.Remote.LoaderProxy.#pR1(CustomCode customCode, List`1 modules) at GrapeCity.ActiveReports.Expressions.Remote.LoaderProxy.Compile(CustomCode customCode) at #cxA.#wc0.Build(IAppDomainBuilder appDomainBuilder, CustomCode customCode, IInstanceFactory instanceFactory) at #DAA.#zc0.Build(PageReport pageReport, IAppDomainBuilder appDomainBuilder, Parameters parameters) at GrapeCity.ActiveReports.ReportEval.<>c__DisplayClass5.#MO0() at GrapeCity.ActiveReports.ReportEval.EvaluationContext..ctor(PageReport pageReport, #U9m options) at GrapeCity.ActiveReports.ReportEval.#ZSZ(PageReport pageReport, #U9m options) at GrapeCity.ActiveReports.ReportEval.#ZSZ(PageReport pageReport, Parameters parameters) at #Uj1.#aTZ.get_EvaluationContext() at #Uj1.#aTZ.<.ctor>b__4() at GrapeCity.ActiveReports.ReportsCore.Rendering.ReportParameters.ParameterInfo.get_EvaluationContext() at GrapeCity.ActiveReports.ReportsCore.Rendering.ReportParameters.ParameterInfo.Evaluate(ExpressionInfo expression) at GrapeCity.ActiveReports.ReportsCore.Rendering.ReportParameters.ParameterInfo.#2j1(Parameter parameter) at GrapeCity.ActiveReports.Expressions.ExpressionObjectModel.Parameter.#Ykf() at GrapeCity.ActiveReports.ReportsCore.Rendering.ReportParameters.ReportParametersProvider.#xEf() at GrapeCity.ActiveReports.ReportsCore.Rendering.ReportParameters.ReportParametersProvider.get_Parameters() at #Uj1.#aTZ.#DEf() at GrapeCity.ActiveReports.ReportsCore.Rendering.ReportProcessor.#Tol() at GrapeCity.ActiveReports.ReportsCore.Rendering.ReportProcessor.#fn(Boolean forceDataRefresh, Boolean forceParameterDataRefresh) at GrapeCity.ActiveReports.Document.PageDocument.#0Kf(Boolean forceDataRefresh, Boolean forceParameterDataRefresh) --- End of inner exception stack trace --- at GrapeCity.ActiveReports.Document.PageDocument.#0Kf(Boolean forceDataRefresh, Boolean forceParameterDataRefresh) at GrapeCity.ActiveReports.Document.PageDocument.Render(IRenderingExtension renderingExtension, StreamProvider streams, NameValueCollection settings, Boolean forceDataRefresh, Boolean forceParameterDataRefresh) at GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport.Export(PageDocument document, Stream stream, String pageRange) at GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport.Export(PageDocument document, String filePath, String pageRange) at GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport.Export(PageDocument document, String filePath)