[]
        
(Showing Draft Content)

Applying Reporting Configuration

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) method to specify the path to the configuration file. Below is an example of how to integrate it within the middleware:

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 interface. Below is an example of how to create a custom configuration provider:

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:

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