I'm implementing a wpf application with rad control 2014 to export radreport to Rtf and save as byte to database then retrieve the data from database and display in RadRichTextBox.
here's my code:
Export to rtf format and save to database
and save the output of renderedReport.DocumentBytes to database.
Load the byte[] and bind to RadRichTextBox
But it causes error.
I would appreciate for any help.
Hassan
Regards
here's my code:
Export to rtf format and save to database
System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = report;Telerik.Reporting.Processing.RenderingResult renderedReport = reportProcessor.RenderReport("RTF", instanceReportSource, null);and save the output of renderedReport.DocumentBytes to database.
Load the byte[] and bind to RadRichTextBox
RadDocument document = null;IDocumentFormatProvider provider = new RtfFormatProvider();using (Stream stream = new MemoryStream(viewDocumentsCore.DocumentContent)){ document = provider.Import(stream);}radRichTextBox.Document = document;But it causes error.
I would appreciate for any help.
Hassan
Regards