This is a migrated thread and some comments may be shown as answers.

Report 'Report1.trdp' cannot be resolved.

1 Answer 519 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Francisco
Top achievements
Rank 1
Francisco asked on 09 Sep 2019, 09:43 AM
My View
 
<style>
 
        #reportViewer1 {
            position: relative;
            width: 1300px;
            height: 900px;
        }
    </style>
 
@(Html.TelerikReporting().ReportViewer()
        .Id("reportViewer1")
        .ServiceUrl(Url.Content("/api/reports/"))
        .TemplateUrl("/Resources/Templates/telerikReportViewerTemplate.html")
        .ReportSource(new UriReportSource() { Uri = "Report1.trdp" })
        .ViewMode(ViewMode.Interactive)
        .ScaleMode(ScaleMode.Specific)
        .Scale(1.0)
        .PersistSession(false)
        .PrintMode(PrintMode.AutoSelect)
)
 
My controller
 
namespace OvalWeb.Controllers
{
    using System.IO;
    using System.Web;
    using Telerik.Reporting.Cache.File;
    using Telerik.Reporting.Services;
    using Telerik.Reporting.Services.Engine;
    using Telerik.Reporting.Services.WebApi;
 
    //The class name determines the service URL.
    //ReportsController class name defines /api/report/ service URL.
    public class ReportsController : ReportsControllerBase
    {
        static ReportServiceConfiguration preservedConfiguration;
 
        static IReportServiceConfiguration PreservedConfiguration
        {
            get
            {
                if (null == preservedConfiguration)
                {
                    preservedConfiguration = new ReportServiceConfiguration
                    {
                        HostAppId = "OvalWebReport",
                        Storage = new FileStorage("C:/Storage"),
                        ReportResolver = CreateResolver(),
                        // ReportSharingTimeout = 0,
                        // ClientSessionTimeout = 15,
                    };
                }
                return preservedConfiguration;
            }
        }
 
        public ReportsController()
        {
            this.ReportServiceConfiguration = PreservedConfiguration;
        }
 
        static IReportResolver CreateResolver()
        {
            var appPath = HttpContext.Current.Server.MapPath("~/");
            var reportsPath = Path.Combine(appPath, @"Report\Designs\Ventas\Tickets\Familia");
 
            return new ReportFileResolver(reportsPath)
                .AddFallbackResolver(new ReportTypeResolver());
        }
    }
}

 

It shows me the error attached.

What could be the problem?

1 Answer, 1 is accepted

Sort by
0
Francisco
Top achievements
Rank 1
answered on 10 Sep 2019, 11:16 AM

solve the issue

removing this code .AddFallbackResolver(new ReportTypeResolver());

Tags
General Discussions
Asked by
Francisco
Top achievements
Rank 1
Answers by
Francisco
Top achievements
Rank 1
Share this question
or