Class able to start jsreport nodejs server allong with .net process, synchronize local templates with it and mange it's lifecycle
Inheritance: IEmbeddedReportingServer
Esempio n. 1
0
        public void SetUp()
        {
            Monitor.Enter(_locker);
            _embeddedReportingServer = new EmbeddedReportingServer(3000);
            _embeddedReportingServer.StartAsync().Wait();

            _reportingService = _embeddedReportingServer.ReportingService;
        }
Esempio n. 2
0
        public void SetUp()
        {
            Monitor.Enter(_locker);
            _embeddedReportingServer = new EmbeddedReportingServer(3000);
            _embeddedReportingServer.CleanServerData();
            _embeddedReportingServer.StartAsync().Wait();

            _reportingService = new ReportingService("http://localhost:3000");
        }
Esempio n. 3
0
        public static void Main()
        {
            var embededReportingServer = new EmbeddedReportingServer() { PingTimeout = new TimeSpan(0, 0, 100) };
            embededReportingServer.StartAsync().Wait();

            var reportingService = new ReportingService(embededReportingServer.EmbeddedServerUri);
            reportingService.SynchronizeTemplatesAsync().Wait();

            var rs = new ReportingService("http://localhost:2000");
            var r = rs.GetServerVersionAsync().Result;


            var result = rs.RenderAsync("Report1", null).Result;

            Console.WriteLine("Done");
            embededReportingServer.StopAsync().Wait();

        }
Esempio n. 4
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            DbInterception.Add(new SchoolInterceptorTransientErrors());
            DbInterception.Add(new SchoolInterceptorLogging());
            
            //its important to set RelativePathToServer otherwise jsreport will run from bin folder
            //that would cause application recycle with every generated report
            var EmbeddedReportingServer = new EmbeddedReportingServer(){ RelativePathToServer = "../App_Data", StartTimeout = new TimeSpan(0,0,20)};

            //wait for nodejs server to start
            EmbeddedReportingServer.StartAsync().Wait();
            //synchronize local *.jsrep files with embedded server
            EmbeddedReportingServer.ReportingService.SynchronizeTemplatesAsync().Wait();
            ReportingService = EmbeddedReportingServer.ReportingService;

            //alternatively you can also use a remote jsreport server on prem or even jsreportonline
            //ReportingService = new ReportingService("https://test.jsreportonline.net", "username", "password");
            //ReportingService.SynchronizeTemplatesAsync().Wait();
        }
Esempio n. 5
0
        public void SetUp()
        {
            Monitor.Enter(_locker);
            _embeddedReportingServer = new EmbeddedReportingServer(3000)
            {
                Configuration = new
                {
                    authentication = new
                    {
                        cookieSession = new
                        {
                            secret = "dasd321as56d1sd5s61vdv32"
                        },
                        admin = new
                        {
                            username = "******",
                            password = "******"
                        }
                    },

                },
                Username = "******",
                Password = "******"
            };
            _embeddedReportingServer.StartAsync().Wait();

            _reportingService = _embeddedReportingServer.ReportingService;
        }