Память рабочего процесса IIS продолжает увеличиваться с каждым новым отчетом Devexpress.C#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Гость
 Память рабочего процесса IIS продолжает увеличиваться с каждым новым отчетом Devexpress.

Сообщение Гость »

Код: Выделить всё

 protected void Page_Load(object sender, EventArgs e)
{

XtraReport report = new XtraReport();
report.LoadLayout(reportsDirectory + "\\" + Request.Params["rptnme"]);
//For backward compatibility
SqlDataSource.DisableCustomQueryValidation = true;
SqlDataSource.AllowCustomSqlQueries = true;

//Allow all scripts to be run via devexpress for backward compatibility
ScriptPermissionManager.GlobalInstance = new ScriptPermissionManager(ExecutionMode.Unrestricted);

if (report.DataSource is SqlDataSource)
{
ParseParams(report);
}

if (report.DataSource != null)
{
report.DataSourceDemanded += report_DataSourceDemanded;
((SqlDataSource)report.DataSource).ConfigureDataConnection += new ConfigureDataConnectionEventHandler(devReports_Default_ConfigureDataConnection);
}

SubReports(report);

if (Request.Params.Count > 0)
{
if (Request.Params["DisplayName"] != null)
{
report.DisplayName = Request.Params["DisplayName"];
}
}

if (Request.Params["exptyp"] == "pdf" || Request.Params["exptyp"] == "ALL")
{
// Specify export options.
PdfExportOptions pdfExportOptions = new PdfExportOptions()
{
PdfACompatibility = PdfACompatibility.PdfA1b
};

}

DocViewer1.OpenReport(report);

}















This code is part of an ASP.NET Web Forms page that is used to load and display a report using DevExpress's reporting tools. Here's a breakdown of what the Page_Load method does:
  • It first creates a new XtraReport object, which represents a report.
  • It then loads the layout of the report from a file. The file path is constructed by concatenating the reportsDirectory (which is read from the application's configuration) and the report name, which is passed as a parameter in the request.
  • It disables custom query validation and allows custom SQL queries for the SqlDataSource. This is done for backward compatibility.
  • It sets the ScriptPermissionManager.GlobalInstance to a new ScriptPermissionManager with ExecutionMode.Unrestricted, which allows all scripts to be run via DevExpress for backward compatibility.
  • If the report's data source is a SqlDataSource, it calls the ParseParams method to parse the parameters for the report's queries.
  • If the report has a data source, it subscribes to the DataSourceDemanded event and the ConfigureDataConnection event of the SqlDataSource. The DataSourceDemanded event is raised when the report's data source is demanded, and the ConfigureDataConnection event is raised when the data connection of the SqlDataSource needs to be configured.
  • It calls the SubReports method to handle any subreports in the report.
  • If there are parameters in the request, it sets the display name of the report to the value of the "DisplayName" parameter.
  • If the "exptyp" parameter in the request is "pdf" or "ALL", it creates a new PdfExportOptions object and sets its PdfACompatibility property to PdfACompatibility.PdfA1b. This is used to specify the options for exporting the report to PDF. However, the actual export to PDF is commented out in this code.
  • Finally, it opens the report in DocViewer1, which is a ASPxWebDocumentViewer control that displays the report to the user.
    This method is called every time the page is loaded. It reads the report name from the request parameters, loads the report, configures it, and displays it to the user.


Источник: https://stackoverflow.com/questions/781 ... port-beein
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C#»