//Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\bold-reports\common\bold.reports.common.min.js",
                resourcesPath + @"\bold-reports\common\bold.reports.widgets.min.js",
                //Chart component script
                resourcesPath + @"\bold-reports\data-visualization\ej.chart.min.js",
                //Report Viewer Script
                resourcesPath + @"\bold-reports\bold.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
            {
                resourcesPath + @"\dependent\jquery.min.js"
            };

            reportOption.ReportModel.ExcelOptions = new BoldReports.Writer.ExcelOptions()
            {
                ExcelSaveType        = BoldReports.Writer.ExcelVersion.Excel2013,
                ReadOnlyRecommended  = true,
                ExcelSheetProtection = Syncfusion.XlsIO.ExcelSheetProtection.DeletingColumns,
            };
        }
        /// <summary>
        /// Report Initialization method that is triggered when report begin processed.
        /// </summary>
        /// <param name="reportOptions">The ReportViewer options.</param>
        public void OnInitReportOptions(ReportViewerOptions reportOptions)
        {
            //throw new NotImplementedException();

            // Add RDL Server and database credentials here

            // Report Server

            string user     = ConfigurationHelper.AppSettings <string>("EasyLOB.Report.RDL.User");
            string password = ConfigurationHelper.AppSettings <string>("EasyLOB.Report.RDL.Password");

            reportOptions.ReportModel.ReportServerCredential = new System.Net.NetworkCredential(user, password);
            //string domain = ConfigurationHelper.AppSettings<string>("EasyLOB.Report.RDL.Domain");
            //reportOptions.ReportModel.ReportServerCredential = new System.Net.NetworkCredential(user, password, domain);

            // Report Path

            //reportOptions.ReportModel.ReportPath = ...

            // Data Source Credentials

            //string connection = MultiTenantHelper.Tenant.Connections[0].ConnectionName;
            //string[] userPassword = AdoNetHelper.GetUserPassword(connection);
            //DataSourceCredentials dataSourceCredentials = new DataSourceCredentials(connection, userPassword[0], userPassword[1]);
            //reportOptions.ReportModel.DataSourceCredentials.Add(dataSourceCredentials);
        }
Beispiel #3
0
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string filePath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/Resources/docs/product-list.rdlc");;

            // Opens the report from application Resources folder usinf FileStream
            FileStream reportStream = new FileStream(filePath, FileMode.Open, FileAccess.Read);

            reportOption.ReportModel.Stream         = reportStream;
            reportOption.ReportModel.ProcessingMode = ProcessingMode.Local;
            reportOption.ReportModel.DataSources.Add(new BoldReports.Web.ReportDataSource {
                Name = "list", Value = ProductList.GetData()
            });

            string resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\bold-reports\common\bold.reports.common.min.js",
                resourcesPath + @"\bold-reports\common\bold.reports.widgets.min.js",
                //Chart component script
                resourcesPath + @"\bold-reports\data-visualization\ej.chart.min.js",
                //Report Viewer Script
                resourcesPath + @"\bold-reports\bold.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
            {
                resourcesPath + @"\dependent\jquery.min.js"
            };
        }
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            var resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\reports\common\ej.reporting.common.min.js",
                resourcesPath + @"\reports\common\ej.reporting.widgets.min.js",
                //Chart component script
                resourcesPath + @"\reports\data-visualization\ej.chart.min.js",
                //Gauge component scripts
                resourcesPath + @"\reports\data-visualization\ej.lineargauge.min.js",
                resourcesPath + @"\reports\data-visualization\ej.circulargauge.min.js",
                //Map component script
                resourcesPath + @"\reports\data-visualization\ej.map.min.js",
                //Report Viewer Script
                resourcesPath + @"\reports\ej.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
                                                                                    {
                "https://code.jquery.com/jquery-1.10.2.min.js"
            };

            reportOption.ReportModel.ExcelOptions = new Syncfusion.Reporting.Writer.ExcelOptions()
            {
                ExcelSaveType        = Syncfusion.Reporting.Writer.ExcelVersion.Excel2013,
                ReadOnlyRecommended  = true,
                ExcelSheetProtection = Syncfusion.XlsIO.ExcelSheetProtection.DeletingColumns,
            };
        }
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            var resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\reports\common\ej.reporting.common.min.js",
                resourcesPath + @"\reports\common\ej.reporting.widgets.min.js",
                //Chart component script
                resourcesPath + @"\reports\data-visualization\ej.chart.min.js",
                //Gauge component scripts
                resourcesPath + @"\reports\data-visualization\ej.lineargauge.min.js",
                resourcesPath + @"\reports\data-visualization\ej.circulargauge.min.js",
                //Map component script
                resourcesPath + @"\reports\data-visualization\ej.map.min.js",
                //Report Viewer Script
                resourcesPath + @"\reports\ej.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
                                                                                    {
                "https://code.jquery.com/jquery-1.10.2.min.js"
            };

            reportOption.ReportModel.PPTOptions = new Syncfusion.Reporting.Writer.PPTOptions()
            {
                FormatType = Syncfusion.Reporting.Writer.PPTSaveType.PowerPoint2013,
            };
        }
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string     basePath    = _hostingEnvironment.WebRootPath;
            FileStream inputStream = new FileStream(basePath + @"\Reports\" + reportOption.ReportModel.ReportPath, FileMode.Open, FileAccess.Read);

            reportOption.ReportModel.Stream = inputStream;
        }
Beispiel #7
0
 public void OnInitReportOptions(ReportViewerOptions reportOption)
 {
     reportOption.ReportModel.DataSources.Clear();
     reportOption.ReportModel.DataSources.Add(new ReportDataSource {
         Name = "Sales", Value = SalesDetails.GetData()
     });
 }
Beispiel #8
0
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            reportOption.ReportModel.ProcessingMode = ProcessingMode.Local;
            reportOption.ReportModel.ReportPath     = System.Web.Hosting.HostingEnvironment.MapPath(@"~/Resources/docs/product-list.rdlc");
            reportOption.ReportModel.DataSources.Add(new Syncfusion.Reporting.Web.ReportDataSource {
                Name = "list", Value = ProductList.GetData()
            });

            var resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\reports\common\ej.reporting.common.min.js",
                resourcesPath + @"\reports\common\ej.reporting.widgets.min.js",
                //Chart component script
                resourcesPath + @"\reports\data-visualization\ej.chart.min.js",
                //Gauge component scripts
                resourcesPath + @"\reports\data-visualization\ej.lineargauge.min.js",
                resourcesPath + @"\reports\data-visualization\ej.circulargauge.min.js",
                //Map component script
                resourcesPath + @"\reports\data-visualization\ej.map.min.js",
                //Report Viewer Script
                resourcesPath + @"\reports\ej.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
                                                                                    {
                "https://code.jquery.com/jquery-1.10.2.min.js"
            };
        }
Beispiel #9
0
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string basePath = _hostingEnvironment.ContentRootPath;
            // Here, we have loaded the sample report report from application the folder wwwroot. Sample.rdl should be there in wwwroot application folder.
            FileStream reportStream;

            if (reportOption.ReportModel.ReportPath == "HasPaid.RDL")
            {
                reportStream = new FileStream(basePath + @"\Reports\HasPaid.Rdl", FileMode.Open, FileAccess.Read);
            }
            else
            {
                reportStream = new FileStream(basePath + @"\Reports\Upcoming.Rdl", FileMode.Open, FileAccess.Read);
            }


            //Ug.. XML parsing to correct the connect string
            XElement   rdl = XElement.Load(XmlReader.Create(reportStream));
            XNamespace ns  = rdl.Name.Namespace;
            XElement   ct  = rdl.Elements(ns + "DataSources").Elements(ns + "DataSource").Elements(ns + "ConnectionProperties").Elements(ns + "ConnectString").FirstOrDefault();

            if (ct != null)
            {
                ct.Value = this._connection;
            }



            reportOption.ReportModel.Stream = new MemoryStream(Encoding.UTF8.GetBytes(rdl.ToString() ?? ""));
        }
Beispiel #10
0
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            List <BoldReports.Web.ReportParameter> userParameters = new List <BoldReports.Web.ReportParameter>();

            userParameters.Add(new BoldReports.Web.ReportParameter()
            {
                Name   = "SalesOrderNumber",
                Values = new List <string>()
                {
                    "SO50753"
                }
            });
            reportOption.ReportModel.Parameters = userParameters;

            string resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\bold-reports\common\bold.reports.common.min.js",
                resourcesPath + @"\bold-reports\common\bold.reports.widgets.min.js",
                //Chart component script
                resourcesPath + @"\bold-reports\data-visualization\ej.chart.min.js",
                //Report Viewer Script
                resourcesPath + @"\bold-reports\bold.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
            {
                resourcesPath + @"\dependent\jquery.min.js"
            };
        }
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            //Add SharePoint Integrated SSRS Report Server credential
            reportOption.ReportModel.ReportServerFormsCredential = new Syncfusion.Reporting.Web.ReportServerFormsCredential("ssrs", "RDLReport1");

            //Here the "AdventureWorks" is the data source name provided in report definition. Name is case sensitive.
            reportOption.ReportModel.DataSourceCredentials.Add(new Syncfusion.Reporting.Web.DataSourceCredentials("AdventureWorks", "ssrs1", "RDLReport1"));

            var resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\reports\common\ej.reporting.common.min.js",
                resourcesPath + @"\reports\common\ej.reporting.widgets.min.js",
                //Chart component script
                resourcesPath + @"\reports\data-visualization\ej.chart.min.js",
                //Gauge component scripts
                resourcesPath + @"\reports\data-visualization\ej.lineargauge.min.js",
                resourcesPath + @"\reports\data-visualization\ej.circulargauge.min.js",
                //Map component script
                resourcesPath + @"\reports\data-visualization\ej.map.min.js",
                //Report Viewer Script
                resourcesPath + @"\reports\ej.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
                                                                                    {
                "https://code.jquery.com/jquery-1.10.2.min.js"
            };
        }
Beispiel #12
0
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            //You can update report options here

            var resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\reports\common\ej.reporting.common.min.js",
                resourcesPath + @"\reports\common\ej.reporting.widgets.min.js",
                //Chart component script
                resourcesPath + @"\reports\data-visualization\ej.chart.min.js",
                //Gauge component scripts
                resourcesPath + @"\reports\data-visualization\ej.lineargauge.min.js",
                resourcesPath + @"\reports\data-visualization\ej.circulargauge.min.js",
                //Map component script
                resourcesPath + @"\reports\data-visualization\ej.map.min.js",
                //Report Viewer Script
                resourcesPath + @"\reports\ej.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
                                                                                    {
                "https://code.jquery.com/jquery-1.10.2.min.js"
            };
        }
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            //Here the "AdventureWorks" is the data source name provided in report definition. Name is case sensitive.
            reportOption.ReportModel.DataSourceCredentials.Add(new Syncfusion.Reporting.Web.DataSourceCredentials("AdventureWorks", "demoreadonly@data-platform-demo", "N@c)=Y8s*1&dh", "Data Source=dataplatformdemodata.syncfusion.com;Initial Catalog=AdventureWorks;"));

            var resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\reports\common\ej.reporting.common.min.js",
                resourcesPath + @"\reports\common\ej.reporting.widgets.min.js",
                //Chart component script
                resourcesPath + @"\reports\data-visualization\ej.chart.min.js",
                //Gauge component scripts
                resourcesPath + @"\reports\data-visualization\ej.lineargauge.min.js",
                resourcesPath + @"\reports\data-visualization\ej.circulargauge.min.js",
                //Map component script
                resourcesPath + @"\reports\data-visualization\ej.map.min.js",
                //Report Viewer Script
                resourcesPath + @"\reports\ej.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
                                                                                    {
                "https://code.jquery.com/jquery-1.10.2.min.js"
            };
        }
Beispiel #14
0
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            var resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\reports\common\ej.reporting.common.min.js",
                resourcesPath + @"\reports\common\ej.reporting.widgets.min.js",
                //Chart component script
                resourcesPath + @"\reports\data-visualization\ej.chart.min.js",
                //Gauge component scripts
                resourcesPath + @"\reports\data-visualization\ej.lineargauge.min.js",
                resourcesPath + @"\reports\data-visualization\ej.circulargauge.min.js",
                //Map component script
                resourcesPath + @"\reports\data-visualization\ej.map.min.js",
                //Report Viewer Script
                resourcesPath + @"\reports\ej.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
                                                                                    {
                "https://code.jquery.com/jquery-1.10.2.min.js"
            };

            reportOption.ReportModel.ReportingServer        = this.Server;
            reportOption.ReportModel.ReportServerUrl        = this.ServerURL;
            reportOption.ReportModel.ReportServerCredential = new NetworkCredential("Sample", "Passwprd");
        }
Beispiel #15
0
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\bold-reports\common\bold.reports.common.min.js",
                resourcesPath + @"\bold-reports\common\bold.reports.widgets.min.js",
                //Chart component script
                resourcesPath + @"\bold-reports\data-visualization\ej.chart.min.js",
                //Report Viewer Script
                resourcesPath + @"\bold-reports\bold.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
            {
                resourcesPath + @"\dependent\jquery.min.js"
            };

            reportOption.ReportModel.CsvOptions = new BoldReports.Writer.CsvOptions()
            {
                Encoding           = System.Text.Encoding.Default,
                FieldDelimiter     = ",",
                UseFormattedValues = false,
                Qualifier          = "#",
                RecordDelimiter    = "@",
                SuppressLineBreaks = true,
                FileExtension      = ".txt"
            };
        }
Beispiel #16
0
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\bold-reports\common\bold.reports.common.min.js",
                resourcesPath + @"\bold-reports\common\bold.reports.widgets.min.js",
                //Chart component script
                resourcesPath + @"\bold-reports\data-visualization\ej.chart.min.js",
                //Report Viewer Script
                resourcesPath + @"\bold-reports\bold.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
            {
                resourcesPath + @"\dependent\jquery.min.js"
            };

            reportOption.ReportModel.PDFOptions = new BoldReports.Writer.PDFOptions()
            {
                EnableComplexScript = true,
                PdfConformanceLevel = Syncfusion.Pdf.PdfConformanceLevel.Pdf_A1B,

                //Load Missing font stream
                Fonts = new Dictionary <string, System.IO.Stream>
                {
                    { "Segoe UI", System.IO.File.OpenRead(System.Web.Hosting.HostingEnvironment.MapPath(@"~/Resources/docs/font_symbols.ttf")) },
                }
            };
        }
Beispiel #17
0
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            //Add SSRS Report Server credential
            reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("ssrs", "RDLReport1");

            //Here the "AdventureWorks" is the data source name provided in report definition. Name is case sensitive.
            reportOption.ReportModel.DataSourceCredentials.Add(new BoldReports.Web.DataSourceCredentials("AdventureWorks", "ssrs1", "RDLReport1"));

            string resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\bold-reports\common\bold.reports.common.min.js",
                resourcesPath + @"\bold-reports\common\bold.reports.widgets.min.js",
                //Chart component script
                resourcesPath + @"\bold-reports\data-visualization\ej.chart.min.js",
                //Report Viewer Script
                resourcesPath + @"\bold-reports\bold.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
            {
                resourcesPath + @"\dependent\jquery.min.js"
            };
        }
Beispiel #18
0
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            reportOption.ReportModel.WordOptions = new BoldReports.Writer.WordOptions()
            {
                FormatType     = BoldReports.Writer.WordFormatType.Docx,
                ProtectionType = Syncfusion.DocIO.ProtectionType.AllowOnlyReading,
            };

            string resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\bold-reports\common\bold.reports.common.min.js",
                resourcesPath + @"\bold-reports\common\bold.reports.widgets.min.js",
                //Chart component script
                resourcesPath + @"\bold-reports\data-visualization\ej.chart.min.js",
                //Report Viewer Script
                resourcesPath + @"\bold-reports\bold.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
            {
                resourcesPath + @"\dependent\jquery.min.js"
            };
        }
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            if (reportOption.SubReportModel != null)
            {
                // Opens the report from application Resources folder using FileStream and loads the sub report stream.
                FileStream reportStream = new FileStream(System.Web.Hosting.HostingEnvironment.MapPath(@"~/Resources/docs/product-list.rdlc"), FileMode.Open, FileAccess.Read);
                reportOption.SubReportModel.Stream = reportStream;
            }
            else
            {
                FileStream reportStream = new FileStream(System.Web.Hosting.HostingEnvironment.MapPath(@"~/Resources/docs/product-list-main.rdlc"), FileMode.Open, FileAccess.Read);
                reportOption.ReportModel.Stream = reportStream;
            }

            string resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\bold-reports\common\bold.reports.common.min.js",
                resourcesPath + @"\bold-reports\common\bold.reports.widgets.min.js",
                //Chart component script
                resourcesPath + @"\bold-reports\data-visualization\ej.chart.min.js",
                //Report Viewer Script
                resourcesPath + @"\bold-reports\bold.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
            {
                resourcesPath + @"\dependent\jquery.min.js"
            };
        }
Beispiel #20
0
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string     basePath     = $"{Directory.GetParent(Directory.GetCurrentDirectory())}";
            FileStream reportStream = new FileStream(basePath + @"\Imunizacao.Report\Reports\Imunizacao\ImunizacaoProdutoReport.rdlc", FileMode.Open, FileAccess.Read);

            reportOption.ReportModel.Stream         = reportStream;
            reportOption.ReportModel.ProcessingMode = ProcessingMode.Local;
        }
Beispiel #21
0
 //Method will be called when reported is loaded
 public void OnReportLoaded(ReportViewerOptions reportOption)
 {
     if (DefaultParameter != null)
     {
         //Set client side custom header data
         reportOption.ReportModel.Parameters = JsonConvert.DeserializeObject <List <Syncfusion.Reporting.Web.ReportParameter> >(DefaultParameter);
     }
 }
Beispiel #22
0
        // Method will be called to initialize the report information to load the report with ReportHelper for processing.
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string basePath = _hostingEnvironment.WebRootPath;

            // Here, we have loaded the sales-order-detail.rdl report from application the folder wwwroot\Resources. sales-order-detail.rdl should be there in wwwroot\Resources application folder.
            System.IO.FileStream reportStream = new System.IO.FileStream(basePath + reportOption?.ReportModel?.ReportPath, System.IO.FileMode.Open, System.IO.FileAccess.Read);
            reportOption.ReportModel.Stream = reportStream;
        }
 public void OnReportLoaded(ReportViewerOptions reportOption)
 {
     //List<BoldReports.Web.ReportParameter> userParameters = new List<BoldReports.Web.ReportParameter>();
     //userParameters.Add(new BoldReports.Web.ReportParameter()
     //{
     //    Name = "SexId",
     //    Values = new List<string>() { "75" }
     //});
     //reportOption.ReportModel.Parameters = userParameters;
 }
 public void OnReportLoaded(ReportViewerOptions reportOption)
 {
     if (reportOption.ReportModel.ProcessingMode == ProcessingMode.Local)
     {
         reportOption.ReportModel.DataSources.Clear();
         reportOption.ReportModel.DataSources.Add(new ReportDataSource {
             Name = "Sales", Value = new AdventureWorks().GetData()
         });
     }
 }
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string     basePath     = _hostingEnvironment.WebRootPath;
            FileStream reportStream = new FileStream(basePath + @"\Resources\" + reportOption.ReportModel.ReportPath, FileMode.Open, FileAccess.Read);

            reportOption.ReportModel.Stream = reportStream;

            //Add SSRS Report Server credential
            reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("sa", "Temp123");
        }
        // Method that will be called when reported is loaded
        public void OnReportLoaded(ReportViewerOptions reportOption)
        {
            // You can update report options here

            //List<BoldReports.Web.ReportParameter> userParameters = new List<BoldReports.Web.ReportParameter>();
            //userParameters.Add(new BoldReports.Web.ReportParameter()
            //{
            //    Name = "ProductCategory",
            //    Values = new List<string>() { "4" }
            //});
            //reportOption.ReportModel.Parameters = userParameters;
        }
        // Method will be called to initialize the report information to load the report with ReportHelper for processing.
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            reportOption.ReportModel.EmbedImageData = true;
            string     reportName   = reportOption.ReportModel.ReportPath;
            string     basePath     = _hostingEnvironment.WebRootPath;
            FileStream reportStream = new FileStream(basePath + @"\resources\Report\" + reportOption.ReportModel.ReportPath, FileMode.Open, FileAccess.Read);

            reportOption.ReportModel.Stream = reportStream;
            if (reportName == "load-large-data.rdlc")
            {
                Models.SqlQuery.getJson(this._cache);
                reportOption.ReportModel.DataSources.Add(new BoldReports.Web.ReportDataSource("SalesOrderDetail", this._cache.Get("SalesOrderDetail") as DataTable));
            }
        }
Beispiel #28
0
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            var data       = _context.RptMeddetails.ToList();
            var parameters = new List <ReportParameter>();

            if (DefaultParam != null)
            {
                parameters = JsonConvert.DeserializeObject <List <ReportParameter> >(DefaultParam);
                reportOption.ReportModel.DataSources.Clear();
                reportOption.ReportModel.DataSources.Add(new ReportDataSource {
                    Name = "prescrip", Value = data.Where(m => m.VisitId.Equals(Convert.ToInt64(parameters[0].Values[0])))
                });
            }
        }
        //Method will be called when initialize the report options before start processing the report
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            var resourcesPath = System.Web.Hosting.HostingEnvironment.MapPath("~/Scripts");

            reportOption.ReportModel.ExportResources.Scripts = new List <string>
            {
                resourcesPath + @"\reports\common\ej.reporting.common.min.js",
                resourcesPath + @"\reports\common\ej.reporting.widgets.min.js",
                //Chart component script
                resourcesPath + @"\reports\data-visualization\ej.chart.min.js",
                //Gauge component scripts
                resourcesPath + @"\reports\data-visualization\ej.lineargauge.min.js",
                resourcesPath + @"\reports\data-visualization\ej.circulargauge.min.js",
                //Map component script
                resourcesPath + @"\reports\data-visualization\ej.map.min.js",
                //Report Viewer Script
                resourcesPath + @"\reports\ej.report-viewer.min.js"
            };

            reportOption.ReportModel.ExportResources.DependentScripts = new List <string>
                                                                                    {
                "https://code.jquery.com/jquery-1.10.2.min.js"
            };

            //PDF encryption
            reportOption.ReportModel.PDFOptions          = new Syncfusion.Reporting.Writer.PDFOptions();
            reportOption.ReportModel.PDFOptions.Security = new Syncfusion.Pdf.Security.PdfSecurity()
            {
                UserPassword = "******"
            };

            //Word encryption
            reportOption.ReportModel.WordOptions = new Syncfusion.Reporting.Writer.WordOptions()
            {
                EncryptionPassword = "******"
            };

            //Excel encryption

            reportOption.ReportModel.ExcelOptions = new Syncfusion.Reporting.Writer.ExcelOptions()
            {
                PasswordToModify = "password",
                PasswordToOpen   = "password"
            };
            //PPT encryption
            reportOption.ReportModel.PPTOptions = new Syncfusion.Reporting.Writer.PPTOptions()
            {
                EncryptionPassword = "******"
            };
        }
        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            string     basePath     = _hostingEnvironment.WebRootPath;
            FileStream reportStream = new FileStream(basePath + @"\Resources\" + reportOption.ReportModel.ReportPath, FileMode.Open, FileAccess.Read);

            reportOption.ReportModel.Stream = reportStream;
            //Add SSRS Report Server credential
            //reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("Dev Pathways", "@Devpathways2019");
            reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("sa", "Admin@2030");
            //reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("MyData", "sa", "@Admin890"));
            //Add SSRS Report Server and data source credentials
            reportOption.ReportModel.DataSourceCredentials.Add(new BoldReports.Web.DataSourceCredentials("MyData", "sa", "@Admin890"));
            //reportOption.ReportModel.DataSourceCredentials.Add(new BoldReports.Web.DataSourceCredentials("MyData", "sa", "@Admin890", "Data Source='197.232.65.10, 2021';Initial Catalog=CCTPMIS;"));
        }