问题:Web 13版本报表,使用UseCustomStore载入报表时,如果在报表设计时选择了主题色,则预览后丢失主题色。
重现:
使用AR13 SP2自带的WebDesigner_MVC范例,修改Startup.cs如下:
using System;
using System.IO;
using System.Linq;
// using Microsoft.Extensions.Configuration;
using System.Web;
using GrapeCity.ActiveReports.Aspnet.Designer;
using GrapeCity.ActiveReports.Aspnet.Viewer;
using WebDesigner_MVC.Implementation;
using WebDesigner_MVC.Services;
using Owin;
using Microsoft.Owin;
using Microsoft.Owin.StaticFiles;
using Microsoft.Owin.FileSystems;
using System.Web.Mvc;
using System.Web.Routing;
using GrapeCity.ActiveReports;
[assembly: OwinStartup(typeof(WebDesigner_MVC.Startup))]
namespace WebDesigner_MVC
{
public class Startup
{
private static readonly DirectoryInfo ResourcesRootDirectory =
new DirectoryInfo(String.Format(@"{0}.\resources\", HttpRuntime.AppDomainAppPath));
private static readonly DirectoryInfo TemplatesRootDirectory =
new DirectoryInfo(String.Format(@"{0}.\templates\", HttpRuntime.AppDomainAppPath));
private static readonly DirectoryInfo DataSetsRootDirectory =
new DirectoryInfo(String.Format(@"{0}.\datasets\", HttpRuntime.AppDomainAppPath));
public void Configuration(IAppBuilder app)
{
app.UseErrorPage();
var dataSetsService = new FileSystemDataSets(DataSetsRootDirectory);
var templatesService = new FileSystemTemplates(TemplatesRootDirectory);
app.Use((context, next) =>
{
context.Set(typeof(IDataSetsService).ToString(), dataSetsService);
context.Set(typeof(ITemplatesService).ToString(), templatesService);
return next.Invoke();
});
app.UseDesigner(config => config.UseFileStore(ResourcesRootDirectory, true ));
app.UseReporting(
config => {
//原代码
//config.UseFileStore(ResourcesRootDirectory);
//重现的代码
config.UseCustomStore(reportId =>
{
var fileInfo = new FileInfo(Path.Combine(String.Format(@"{0}.\resources\", HttpRuntime.AppDomainAppPath), reportId));
PageReport report= new PageReport(fileInfo);
return report.Report;
});
}
);
app.UseStaticFiles(new StaticFileOptions { FileSystem = new PhysicalFileSystem(String.Format(@"{0}.\wwwroot\", HttpRuntime.AppDomainAppPath)) });
}
}
}
|