+1 800 256 3608 (toll-free in North America) or +49 7531 90 60 10| service@combit.com

Self hosting ReportServer with owin

The report server would be a very usefull addition for my customers.



It would be great to self host the report server as an owin middleware.



https://docs.microsoft.com/en-us/aspnet/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api



Here is a greate start on how to write a middleware http://benfoster.io/blog/how-to-write-owin-middleware-in-5-different-steps



I already use an self hosted owin instance (multiple instances) per customer and the requirement would be to have a seperated report server for every instances without having to install the report server on a dedicated server.



Preferable this would be a nuget package that provides the dependencies to have a running report server up in 5 minutes.



Here is some sample code how I could imagine the startup code.



I included a ListLabelFactory configuration property that could be responsible of constructing the List&Label instance which is used by report server internally. This way I could register designer functions and objects for the report server.



 

    public class Program
    {
        static void Main(string[] args)
        {
            string url = "http://localhost:8080";
            using (WebApp.Start(url))
            {
               Console.WriteLine("Server running on {0}", url);
               Console.ReadLine();
            }
       }
    }
    
    class Startup   
    {
        public void Configuration(IAppBuilder app)
        {
            var config = new ReportServerConfig
            {
                BasePath ="/combitReportServer",
                ProviderName:="...",
                ConnectionString:="...",
                ListLabelFactory = new MyListLabelFactory(),
            };
            app.UseReportServer(config);
        }
     }