Search results
Suggest a FeaturePDF

How to load the report from the database

You must load the report using the Stream option available with reportOption.ReportModel. To load the report from the database, please follow these steps:

From byte array

[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
    byte[] bytes = ""; // provide your byte array report data
    MemoryStream reportStream = new MemoryStream(bytes);
    reportOption.ReportModel.Stream = reportStream;
}

From base64String

[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
    string base64String = ""; // provide your base64 report data

    byte[] bytes = System.Convert.FromBase64String(base64String);
    MemoryStream reportStream = new MemoryStream(bytes);
    reportOption.ReportModel.Stream = reportStream;
}

From string

[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
    string reportData = ""; // provide your database report data
    byte[] bytes = System.Text.Encoding.ASCII.GetBytes(reportFile);
    MemoryStream reportStream = new MemoryStream(bytes);
    reportOption.ReportModel.Stream = reportStream;
}
CONTENTS
Having trouble getting help?
Contact Support
CONTENTS
Having trouble getting help?
Contact Support