FlexReports
ActiveReports
SSRS Reports
PDF Files
Sample
Source
1
2
3
4
5
6
7
8
9
10
11
12
13
using Microsoft.AspNetCore.Mvc;
  
namespace FlexViewerExplorer.Controllers
{
    public partial class FlexViewerController : Controller
    {
        // GET: Intro
        public ActionResult Intro()
        {
            return View();
        }
    }
}
1
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.IO;
  
namespace FlexViewerExplorer
{
    public class Startup
    {
        public Startup(IHostingEnvironment env)
        {
            // Set up configuration sources.
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
  
            Environment = env;
  
            builder.AddEnvironmentVariables();
            Configuration = builder.Build();
        }
        public static IHostingEnvironment Environment { get; set; }
  
        public IConfigurationRoot Configuration { get; set; }
  
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
            services.AddSession();
        }
  
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
  
            app.UseStaticFiles();
            app.UseSession();
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action}/{id?}",
                    defaults: new { controller = "FlexViewer", action = "Intro" });
            });
  
            app.UseStorageProviders().AddDiskStorage("PdfsRoot", Path.Combine(env.WebRootPath, "PdfsRoot"));
            app.UseReportProviders().AddFlexReportDiskStorage("ReportsRoot", Path.Combine(env.WebRootPath, "ReportsRoot"));
  
            var ssrsUrl = Configuration["AppSettings:SsrsUrl"];
            var ssrsUserName = Configuration["AppSettings:SsrsUserName"];
            var ssrsPassword = Configuration["AppSettings:SsrsPassword"];
            app.UseReportProviders().AddSsrsReportHost("c1ssrs", ssrsUrl, new System.Net.NetworkCredential(ssrsUserName, ssrsPassword));
        }
    }
}