我有一个ActiveReports [ActiveReports版本8,.Net] DLL,我的代码在 Print 控制器的 Preview 动作中调用 . 出于某种原因,当用户同时访问它时(当然是来自不同的会话),数据会被破坏,他们会看到彼此的数据或缺少数据 .
public ActionResult Preview(int? id)
{
if (id != null)
{
string reportInfo = null;
....
MyARNamespace.ActiveReportsClass report = new MyARNamespace.ActiveReportsClass();
try
{
using (MemoryStream stream = new MemoryStream())
{
reportInfo = report.RunReport(parameters, stream);
if (stream.Length != 0)
{
stream.Position = 0;
byte[] pdf = stream.ToArray();
return File(pdf, "application/pdf");
}
else
{
return HttpNotFound(reportInfo);
}
}
}
catch(Exception ex)
{