-
Notifications
You must be signed in to change notification settings - Fork 204
Error Handling
Peter Gill edited this page Jun 8, 2026
·
3 revisions
The Report object exposes three members for inspecting errors that occur during parsing and rendering.
| Member | Type | Description |
|---|---|---|
ErrorMaxSeverity |
int |
Highest severity level seen so far. 4 or below means the report can still run. 5 or above means it cannot. |
ErrorItems |
IList |
List of error message strings accumulated since the last ErrorReset(). |
ErrorReset() |
method | Clears ErrorItems and resets ErrorMaxSeverity to 0. |
| Severity | Meaning |
|---|---|
| 1–4 | Warning — report continues running. Output may be incomplete or incorrect in the affected area. |
| 5+ | Fatal — report cannot run. Do not call RunGetData or RunRender. |
using Majorsilence.Reporting.Rdl;
RdlEngineConfig.RdlEngineConfigInit();
var rdlp = new RDLParser(await System.IO.File.ReadAllTextAsync("report.rdl"));
using var report = await rdlp.Parse();
if (report.ErrorMaxSeverity > 0)
{
foreach (string msg in report.ErrorItems)
Console.WriteLine("Parse error: " + msg);
if (report.ErrorMaxSeverity > 4)
{
Console.WriteLine("Report cannot run — aborting.");
return;
}
// Severity <= 4: warnings only, reset and continue
report.ErrorReset();
}
await report.RunGetData(null);Errors can also be generated during data retrieval and rendering. Check again after each step if you need complete diagnostics.
await report.RunGetData(null);
if (report.ErrorMaxSeverity > 4)
{
Console.WriteLine("Data retrieval failed:");
foreach (string msg in report.ErrorItems)
Console.WriteLine(" " + msg);
return;
}
var sg = new OneFileStreamGen("output.pdf", true);
await report.RunRender(sg, OutputPresentationType.PDF);
if (report.ErrorMaxSeverity > 0)
{
Console.WriteLine("Render warnings:");
foreach (string msg in report.ErrorItems)
Console.WriteLine(" " + msg);
}using var report = await rdlp.Parse();
if (report.ErrorMaxSeverity > 4)
{
var errors = report.ErrorItems.Cast<string>().ToArray();
return StatusCode(500, new { errors });
}-
Missing data provider assembly — the DLL named in
RdlEngineConfig.xmlcannot be found. Fix by checking the provider path or callingRdlEngineConfig.RdlEngineConfigInit(customDir). See Database Providers. -
Invalid RDL XML — the
.rdlfile is malformed. Severity 5+, report cannot run. -
Connection failure — database unreachable during
RunGetData. Severity 5. - Missing report field — a field referenced in the report is not in the dataset. Severity 1–4, report renders with a blank in that field.
- Font not found on Linux — SkiaSharp falls back to a default font. Severity 1–4. Install the required fonts; see Linux — PDF export and Fonts.