# Applying Reporting Configuration

## Content

Reporting configuration allows you to define various settings in ActiveReports.NET related to data retrieval, text rendering, and more through a configuration file. You can easily integrate this reporting configuration into your middleware by using one of the following methods.

## Applying Configuration from a File

You can use the [UseConfig(string path)](/activereportsnet/api/v20.1/MESCIUS.ActiveReports.Web.Viewer/GrapeCity.ActiveReports.Aspnetcore.Viewer.ReportingSettings.UseConfig.html) method to specify the path to the configuration file. Below is an example of how to integrate it within the middleware:

```CSharp
using GrapeCity.ActiveReports.Aspnetcore.Viewer;
app.UseReportViewer(config =>
{
    config.UseConfig(Path.Combine(builder.Environment.ContentRootPath, "Config", "ActiveReports.config"));
});
```

## Applying Dynamic Configuration

To apply dynamic configuration, the first step is to implement the [IConfigurationProvider](/activereportsnet/api/v20.1/MESCIUS.ActiveReports.Web.Viewer/GrapeCity.ActiveReports.Web.Viewer.IReportViewerBackendApi.ConfigurationProvider.html) interface. Below is an example of how to create a custom configuration provider:

```CSharp
internal class CustomConfigurationProvider : GrapeCity.ActiveReports.Configuration.IConfigurationProvider
{
    private string _configContent;

    public CustomConfigurationProvider(string configPath)
    {
        string origConfigContent = File.ReadAllText(configPath);
        // Modify the original config content dynamically
        _configContent = origConfigContent;
    }

    public string Content => _configContent;
}
```

Once you've implemented the custom configuration provider, you can apply it to the middleware like this:

```CSharp
using GrapeCity.ActiveReports.Aspnetcore.Viewer;
app.UseReportViewer(config =>
{
    config.UseConfig(new CustomConfigurationProvider(Path.Combine(builder.Environment.ContentRootPath, "Config", "ActiveReports.config")));
});
```