private byte[] _toByte(byte[] reportFile, ReportExtension fileExtension, IDictionary <string, string> paramValues = null)
        {
            this._reportBuilderReader = new ReportReader(reportFile);

            if (paramValues != null)
            {
                this._setReportParameters(paramValues);
            }

            this._setDataSets();

            return(this._reportViewer.Render(fileExtension.Value));
        }
Example #2
0
        /// <summary>
        /// Loads the specified report.
        /// </summary>
        /// <param name="inputPath"></param>
        /// <param name="inputName"></param>
        /// <param name="report"></param>
        /// <returns></returns>
        protected bool LoadReport(string inputPath, string inputName, out Report report)
        {
            report = CaptureFileException(() => "The specified report is not a valid file path.", () =>
            {
                var factory = new ReportContainerFactory(new FileSystem(), inputPath, inputName);

                using (IReportContainer inputContainer = factory.MakeForReading())
                {
                    IReportReader reportReader = reportManager.CreateReportReader(inputContainer);
                    return(Context.ProgressMonitorProvider.Run(pm => reportReader.LoadReport(true, pm)));
                }
            });

            return(report != null);
        }
Example #3
0
 public static T ReadFromString <T>(this IReportReader reportReader, string source, bool needTrimValues = true)
 {
     using (var xmlReader = XmlReader.Create(new StringReader(source)))
         return(reportReader.Read <T>(xmlReader, needTrimValues));
 }