C# RDLC Report Viewer LocalReport Execute crashes

577 Views Asked by At

I am trying to render a byte array from an RDLC file. I've done it successfully with one .rdlc but I am having issues with another. Below is my code.

    Dictionary<string, string> parameters = new Dictionary<string, string>();
    parameters.Add("ShowStates","2020");
    Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
    Encoding.GetEncoding("windows-1252");
    LocalReport report = new LocalReport(rdlcFilePath);

    var DS1 = await GetStatusReportwithFileCounts(ReportYear);
    var DS2 = GetOverallStatus(ReportYear, DS1);
    report.AddDataSource("Status_reports_SummaryDB", DS1);
    report.AddDataSource("Overall", DS2);
    var result = report.Execute(RenderType.Pdf, 1, parameters);
    return result.MainStream;

I know my DataSources are returning good data and my rdlc path is correct. For reference, we are using .Net Core, so my report rendering options seem limited. I assume the error lies within something in the .rdlc file it's self. I guess my greatest issue is I'm not really sure how to interpret the error message (Below). Any insight on where to look for errors would be appreciated.

enter image description here

0

There are 0 best solutions below