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

Transitioning from .trdx to .cs in report Viewer

4 Answers 292 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kurt
Top achievements
Rank 1
Kurt asked on 02 Nov 2015, 06:09 PM

I have gotten the ASP.NET MVC Report Viewer working in my MVC application using the sample code provided on the website.  I am viewing the sample report called SampleReport.trdx.  

I have created a test report using the Visual Studio Designer and of course it is of .cs extension.  ActiveUsers.cs.

In the ReportViewerView.cshtml the report source is set like so:  .ReportSource(new UriReportSource() { Uri = "SampleReport.trdx" })

How to I change the reportsource to use the activeusers.cs; I have tried .ReportSource(new UriReportSource() { Uri = "ActiveUsers.cs" }) and it says the name cannot be resolved.

Regards,

Kurt

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 03 Nov 2015, 02:52 PM
Hi Kurt,

Reports created by the VS Report Designer can be wrapped in a TypeReportSource by using the report type's assembly qualified name (<namespace>.<class>, <assembly_name>).

For more details, please check Report Sources.


I hope this information is helpful.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kurt
Top achievements
Rank 1
answered on 05 Nov 2015, 01:38 PM

I have to say this is frustrating to say the least.  I have created a simple report, and still get this error when following your directions.

Error creating report instance (Report = Rfmt.Client.Reports.ReportDefinitions.UserReport, Rfmt.Client.Reports).
Report 'Rfmt.Client.Reports.ReportDefinitions.UserReport, Rfmt.Client.Reports' cannot be resolved. 

 

0
Kurt
Top achievements
Rank 1
answered on 05 Nov 2015, 05:23 PM
I am saying this closed, I cannot get reports to render that are in another project than the web application, but that is my problem and not telerik's I suppose.
0
Stef
Telerik team
answered on 09 Nov 2015, 01:15 PM
Hello Kurt,

The ReportSource can be set as follows:
.ReportSource(new TypeReportSource() { TypeName = typeof(Rfmt.Client.Reports.ReportDefinitions.UserReport).AssemblyQualifiedName })

The actual assembly qualified name can be also checked by using the AssemblyName from the project's Properties and the namespace and class name written in the report's file. Note that the name is case sensitive.


Verify also both reports and viewer's projects use the same Telerik Reporting version, and the Reporting REST service has a ReportTypeResolver:
static ReportsController()
      {
          var appPath = HttpContext.Current.Server.MapPath("~/");
          var reportsPath = Path.Combine(appPath, @"..\..\..\Report Designer\Examples");
          var resolver = new ReportFileResolver(reportsPath)
              .AddFallbackResolver(new ReportTypeResolver());
 
          configurationInstance = new ReportServiceConfiguration
          {
              HostAppId = "Html5DemoApp",
              Storage = new FileStorage(),
              ReportResolver = resolver,
              // ReportSharingTimeout = 0,
              // ClientSessionTimeout = 15,
          };
      }


Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Kurt
Top achievements
Rank 1
Answers by
Stef
Telerik team
Kurt
Top achievements
Rank 1
Share this question
or