Hello,
We are using Telerik Reporting version R2 2020.
In our app to show report we use HTML5 Report Viewer and Web Report designer. Our project based on .Net Core 3.1. Currently, the report viewer is working fine but we have a problem with a web designer. I tested report web designer with a web page using the Chrome browser and it is not working fine. It shows some error messages when loading some report items. For example in my sample project I'm trying to open barcode report with report web designer. After a few seconds It shows some error messages saying "Could not generate the preview of 'barcode N'" (N - barcode number).
You can see this from the attached picture file. I could not attache my sample project because it allows only picture file.
Here my Startup file.
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddCors(o => o.AddPolicy("AllowOrigin", builder =>
{
builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod();
}));
//This is for showing picture
services.Configure<IISServerOptions>(options =>
{
options.AllowSynchronousIO = true;
});
services.AddRazorPages()
.AddNewtonsoftJson();
//Designer
// Configure dependencies for ReportServiceConfiguration.
services.TryAddSingleton<ConfigurationService>(sp => new ConfigurationService(sp.GetService<IWebHostEnvironment>()));
services.TryAddScoped<IReportSourceResolver>(sp =>
new TypeReportSourceResolver().AddFallbackResolver(new UriReportSourceResolver(
Path.Combine(sp.GetRequiredService<ConfigurationService>().Environment.WebRootPath, "Reports"))));
services.TryAddScoped<IReportServiceConfiguration>(sp =>
new ReportServiceConfiguration
{
ReportingEngineConfiguration = sp.GetRequiredService<ConfigurationService>().Configuration,
HostAppId = "Html5DemoAppCore",
Storage = new FileStorage(),
ReportSourceResolver = sp.GetRequiredService<IReportSourceResolver>()
});
// Configure dependencies for ReportDesignerServiceConfiguration.
services.TryAddScoped<IDefinitionStorage>(sp => new FileDefinitionStorage(Path.Combine(sp.GetRequiredService<ConfigurationService>().Environment.WebRootPath, "Reports")));
services.TryAddScoped<IReportDesignerServiceConfiguration>(sp => new ReportDesignerServiceConfiguration { DefinitionStorage = sp.GetRequiredService<IDefinitionStorage>() });
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app
.UseRouting()
.UseCors("AllowOrigin")
.UseDefaultFiles()
.UseStaticFiles()
.UseEndpoints(config =>
{
config.MapControllers();
});
}
}
public class ConfigurationService
{
public ConfigurationService(IWebHostEnvironment environment)
{
this.Environment = environment;
var configFileName = System.IO.Path.Combine(environment.ContentRootPath, "appsettings.json");
var config = new ConfigurationBuilder()
.AddJsonFile(configFileName, true)
.Build();
this.Configuration = config;
}
public IConfiguration Configuration { get; private set; }
public IWebHostEnvironment Environment { get; private set; }
}
Can someone help me to solve this problem?
Thank you,