Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"Logging": {
"LogLevel": {
"Default": "Warning",
"DevExpress": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions AspNetCore.Reporting.MVC/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"Logging": {
"LogLevel": {
"Default": "Information",
"DevExpress": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
Expand Down
36 changes: 10 additions & 26 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
}
```

- Configure Storage and Cache cleaners on application startup. This allows you to specify how long you want to reserve resources to store document data on the server. Note that after a document's data is removed for the Storage and Cache, you cannot navigate or print this document.

Check failure on line 123 in Readme.md

View workflow job for this annotation

GitHub Actions / vale

[vale] Readme.md#L123

[DX.SentenceStart] Do not start a sentence with a 'This allows'. It sounds vague.
Raw output
{"message": "[DX.SentenceStart] Do not start a sentence with a 'This allows'. It sounds vague.", "location": {"path": "Readme.md", "range": {"start": {"line": 123, "column": 64}}}, "severity": "ERROR"}

[ServiceRegistrator.cs](AspNetCore.Reporting.Common/Services/ServiceRegistrator.cs#L17-L21)

Expand Down Expand Up @@ -153,7 +153,7 @@
}
```

In the [IConnectionProviderService](https://docs.devexpress.com/CoreLibraries/DevExpress.DataAccess.Wizard.Services.IConnectionProviderService) interface returned by the IConnectionProviderFactory, initialize and return the connection.

Check warning on line 156 in Readme.md

View workflow job for this annotation

GitHub Actions / vale

[vale] Readme.md#L156

[Microsoft.OxfordComma] Use the Oxford comma in 'In the IConnectionProviderService interface returned by the IConnectionProviderFactory, initialize and'.
Raw output
{"message": "[Microsoft.OxfordComma] Use the Oxford comma in 'In the IConnectionProviderService interface returned by the IConnectionProviderFactory, initialize and'.", "location": {"path": "Readme.md", "range": {"start": {"line": 156, "column": 1}}}, "severity": "WARNING"}

[CustomSqlDataConnectionProviderFactory.cs](AspNetCore.Reporting.Common/Services/Reporting/CustomSqlDataConnectionProviderFactory.cs#L31-L38)

Expand Down Expand Up @@ -235,9 +235,9 @@
}
```

### Token-based Authentication

Check warning on line 238 in Readme.md

View workflow job for this annotation

GitHub Actions / vale

[vale] Readme.md#L238

[DX.HeadingCapitalization] 'Token-based Authentication' doesn't match our guidelines for title case. See tw wiki for details.
Raw output
{"message": "[DX.HeadingCapitalization] 'Token-based Authentication' doesn't match our guidelines for title case. See tw wiki for details.", "location": {"path": "Readme.md", "range": {"start": {"line": 238, "column": 5}}}, "severity": "WARNING"}

The following code snippet shows how to pass the access token:

Check failure on line 240 in Readme.md

View workflow job for this annotation

GitHub Actions / vale

[vale] Readme.md#L240

[DX.StyleRules-Remove] Remove the 'V + how to + V' construction and only use the verb that comes next. E.g. 'shows how to use' -> 'uses'.
Raw output
{"message": "[DX.StyleRules-Remove] Remove the 'V + how to + V' construction and only use the verb that comes next. E.g. 'shows how to use' -\u003e 'uses'.", "location": {"path": "Readme.md", "range": {"start": {"line": 240, "column": 28}}}, "severity": "ERROR"}
[site.js](AspNetCore.Reporting.MVC/wwwroot/js/site.js)

```js
Expand Down Expand Up @@ -289,9 +289,9 @@

Review the project's [Views/Home/DesignReport.cshtml](AspNetCore.Reporting.MVC/Views/Home/DesignReport.cshtml) or [Views/Home/DisplayReport.cshtml](AspNetCore.Reporting.MVC/Views/Home/DisplayReport.cshtml) files for the full code.

### Token-based Authentication in Angular

Check warning on line 292 in Readme.md

View workflow job for this annotation

GitHub Actions / vale

[vale] Readme.md#L292

[DX.HeadingCapitalization] 'Token-based Authentication in Angular' doesn't match our guidelines for title case. See tw wiki for details.
Raw output
{"message": "[DX.HeadingCapitalization] 'Token-based Authentication in Angular' doesn't match our guidelines for title case. See tw wiki for details.", "location": {"path": "Readme.md", "range": {"start": {"line": 292, "column": 5}}}, "severity": "WARNING"}

The following code snippet shows how to pass the access token in an Angular application:

Check failure on line 294 in Readme.md

View workflow job for this annotation

GitHub Actions / vale

[vale] Readme.md#L294

[DX.StyleRules-Remove] Remove the 'V + how to + V' construction and only use the verb that comes next. E.g. 'shows how to use' -> 'uses'.
Raw output
{"message": "[DX.StyleRules-Remove] Remove the 'V + how to + V' construction and only use the verb that comes next. E.g. 'shows how to use' -\u003e 'uses'.", "location": {"path": "Readme.md", "range": {"start": {"line": 294, "column": 28}}}, "severity": "ERROR"}

[report-viewer.ts](AspNetCore.Reporting.Angular/AspNetCore.Reporting.Angular.Client/src/app/reportviewer/report-viewer.ts#L32-L41)

Expand All @@ -318,7 +318,7 @@

### Implement User Authorization

To authorize a user and restrict access to reports based on arbitrary logic, implement and register an [IWebDocumentViewerAuthorizationService](https://docs.devexpress.com/XtraReports/DevExpress.XtraReports.Web.WebDocumentViewer.IWebDocumentViewerAuthorizationService) with [WebDocumentViewerOperationLogger](https://docs.devexpress.com/XtraReports/DevExpress.XtraReports.Web.WebDocumentViewer.WebDocumentViewerOperationLogger).

Check warning on line 321 in Readme.md

View workflow job for this annotation

GitHub Actions / vale

[vale] Readme.md#L321

[Microsoft.OxfordComma] Use the Oxford comma in 'To authorize a user and restrict access to reports based on arbitrary logic, implement and'.
Raw output
{"message": "[Microsoft.OxfordComma] Use the Oxford comma in 'To authorize a user and restrict access to reports based on arbitrary logic, implement and'.", "location": {"path": "Readme.md", "range": {"start": {"line": 321, "column": 1}}}, "severity": "WARNING"}

You can also implement an `DevExpress.XtraReports.Web.WebDocumentViewer.IExportedDocumentStorage` to prevent unauthorized access to documents generated during asynchronous export and printing operations.

Expand Down Expand Up @@ -427,37 +427,21 @@

### Log Errors that Occurred in the Code of DevExpress Reporting Components

To handle exceptions generated by DevExpress reporting components, implement and register a logger service and override the `Error` method in your service implementation. In the `Error` method's implementation, save errors to a log or database. If a Visual Studio debugger is attached, you can set a breakpoint and inspect errors in the Watch window.
DevExpress reporting components write log messages through the standard [Microsoft.Extensions.Logging](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/) API. Messages go to the logging providers registered in the application, so no custom logger class is required. To save errors to a file or database, register a logging provider that writes to that storage.

##### Implement a Logger Class
Use the `DevExpress` log category to configure which messages are logged. The following *appsettings.json* configuration logs DevExpress messages with the `Information` level and higher:

[ReportingLoggerService.cs](AspNetCore.Reporting.Common/Services/Reporting/ReportingLoggerService.cs):

```csharp
public class ReportingLoggerService: LoggerService {
readonly ILogger logger;
public ReportingLoggerService(ILogger logger) {
this.logger = logger;
}
public override void Error(Exception exception, string message) {
var logMessage = $"[{DateTime.Now}]: Exception occurred. Message: '{message}'. Exception Details:{Environment.NewLine}{exception}";
logger.LogError(logMessage);
}

public override void Info(string message) {
logger.LogInformation(message);
}
```json
"Logging": {
"LogLevel": {
"Default": "Information",
"DevExpress": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
```

##### Register the Logger

Call `LoggerService.Initialize` at application startup and pass the logger factory obtained from the DI container:

```cs
LoggerService.Initialize(new ReportingLoggerService(loggerFactory.CreateLogger("DXReporting")));
```

### Use Custom Exception Handlers

Use custom exception handler services to customize error details that are passed to the client and displayed in the client UI:
Expand Down Expand Up @@ -540,7 +524,7 @@

DevExpress client reporting controls use the DevExtreme localization mechanism to localize the UI and messages.

To localize DevExpress reporting controls, go to [localization.devexpress.com](https://localization.devexpress.com/), download the JSON files for the localization, and save them to the `localization` folder within the application's `wwwroot` folder. After that, configure the view as described below:

Check failure on line 527 in Readme.md

View workflow job for this annotation

GitHub Actions / vale

[vale] Readme.md#L527

[DX.StyleRules-Remove] Better alternatives: 'Once complete' or 'Once ready'.
Raw output
{"message": "[DX.StyleRules-Remove] Better alternatives: 'Once complete' or 'Once ready'.", "location": {"path": "Readme.md", "range": {"start": {"line": 527, "column": 251}}}, "severity": "ERROR"}

1. In the client `CustomizeLocalization` event, load the localization JSON files:

Expand Down
Loading