How to load the report from the database
To load a report from a database in the Bold Reports® ASP.NET MVC Report Writer, convert the report data to a memory stream and pass it with the Stream option of the writer.LoadReport() method. Use the option that matches how the database stores the report:
How do I load a report from a byte array?
To load a report from a byte array, create a MemoryStream from the bytes and pass it to the LoadReport() method of the Report Writer.
byte[] bytes = ""; // provide your byte array report data
MemoryStream reportStream = new MemoryStream(bytes);
BoldReports.Writer.ReportWriter writer = new BoldReports.Writer.ReportWriter();
writer.LoadReport(reportStream);How do I load a report from a base64 string?
To load a report from a base64 string, convert the string to bytes with System.Convert.FromBase64String, create a MemoryStream, and pass it to the LoadReport() method of the Report Writer.
string base64String = ""; // provide your base64 report data
byte[] bytes = System.Convert.FromBase64String(base64String);
MemoryStream reportStream = new MemoryStream(bytes);
BoldReports.Writer.ReportWriter writer = new BoldReports.Writer.ReportWriter();
writer.LoadReport(reportStream);How do I load a report from a string?
To load a report from a string, convert the string to bytes with System.Text.Encoding.ASCII.GetBytes, create a MemoryStream, and pass it to the LoadReport() method of the Report Writer.
string reportData = ""; // provide your Report data
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(reportData);
MemoryStream reportStream = new MemoryStream(bytes);
BoldReports.Writer.ReportWriter writer = new BoldReports.Writer.ReportWriter();
writer.LoadReport(reportStream);