找回密码
 立即注册

QQ登录

只需一步,快速开始

大帮手软件

注册会员

21

主题

54

帖子

175

积分

注册会员

积分
175

微信认证勋章

大帮手软件
注册会员   /  发表于:2019-12-2 17:50  /   查看:2771  /  回复:4
问题: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)) });
                }
        }
}


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

4 个回复

倒序浏览
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2019-12-2 19:07:36
沙发
您好,这个问题,我这边使用在线设计器测试了,没有重现你反馈的问题。我使用我们网站上发布的在线设计器,测试一切现实都是正常的
回复 使用道具 举报
大帮手软件
注册会员   /  发表于:2019-12-2 19:43:36
板凳
重点是config.UseCustomStore,请问您改了吗?是否有按这里的代码测试
回复 使用道具 举报
大帮手软件
注册会员   /  发表于:2019-12-2 19:54:57
地板
继续测试后发现,使用 PageReport report= new PageReport(fileInfo)方式载入会有这个问题,使用其它方法载入没有这个问题。
回复 使用道具 举报
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2019-12-3 09:26:28
5#
好的,我去试试
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部