Telerik Forums
Reporting Forum
1 answer
334 views
I have been creating a report using Telerik Report in a ASP.NET MVC application and I have a question.

I would like to know, how can we create a ReportViewer for a dynamic report with ASP.NET MVC?

we do not have a TRDX file, we need to create it dynamic. It just a simple list of data, nothing special.

For sample, I have a action in my controller and it creates a Telerik.Reporting.Report object dynamiclly and add some items like TextBoxes, Labels pointing to fields and add a List<Product> as a dataSource of this report. The report is ok and we can export to PDF and see the result, but I would like to present it into a ReportViewer like HTML5 version. How can I do it? How can I make my action return a object to the View and render it in a Telerik Report Viewer and get the resources like exporting to other formats.

Thank you.
Stef
Telerik team
 answered on 21 Jul 2014
1 answer
134 views
Hey!
I build an report with 8 subreports (each need this own datasource). I need to visible each of the subreports only a precondition (different for each subreport)  become conform. So I set a binding visible = only when precondition is true. Thats work fine.

But:
When I render my report it is very slow, so about 3 min for 29 sites.

Is it possible that the subreports going to render anyhow although the visibilty is set to false. If true how can I reach that the subreports only render when my precondition  become true.
I think that is the solution to render the report faster.
Or you have any solution to get the rendering faster?

Horst
KS
Top achievements
Rank 1
 answered on 18 Jul 2014
1 answer
105 views
it's possible to search for something within a report inside the Windows Forms Report Viewer ?
Nasko
Telerik team
 answered on 18 Jul 2014
1 answer
119 views
We tend to update reports very often and need to know what version of a report the user is using when they ask questions. Is there any way to display the revision number of a report or the last date that they file was written?

Thanks,
Don Rule
http://translationalsoftware.com
Hinata
Top achievements
Rank 1
 answered on 18 Jul 2014
1 answer
469 views
Hello,

I have a master report which contains many subreports. Every subreport uses its own datasource with its own design. Their visibility is controlled via the binding property of the subreport.

It looks like all subreports are bound to their SqlDatasource regardless of if they're visible or not. Is there an easy way to bind only the subreports to their datasources which are visible?

I'm using the Report Designer for Visual Studio.
Nasko
Telerik team
 answered on 18 Jul 2014
1 answer
181 views
Hi,

I just updated my telerik version to 2014.
I had this code:

ReportViewer1.Report = report; (report is Telerik.Reoporting.Report object).
But I get an error that ReportViewer1.Report is obsolete.

What should I do in order to display "Telerik.Reporting.Report" item inside report viewer as I did in the past?


Stef
Telerik team
 answered on 17 Jul 2014
23 answers
302 views
Hello

We have updated a few projects pereviously written under SL3 with Telerik components v. 2009.3.1120.1030 , reporting v.3.2.9.1104 to SL4  v. 2010.3.1110.1040  reporting v. 4.2.10.1110, containing few reports. In the SL3 version, the globalization of the reportviewer worked o.k. following the (obsolete?, it's from 2008) KB-article (http://www.telerik.com/support/kb/reporting/report-viewers/localizing-the-telerik-report-viewer.aspx).

While the localization of the SL-forms and the reports (titles, labels, etc. in code behind) works, the reportviewer's buttons and tooltips do not display the localized values from Telerik.ReportViewer.WebForms.Resources.[culture].resx placed in the App_GlobalResources folder.

Checking the threads at runtime, all culture info (in silverlight AND Web-part) is reflecting the selected culture, but no go for the viewer... it does not adopt any of the cultures! Am I missing something?

Greetings
Rudolf
Stef
Telerik team
 answered on 17 Jul 2014
1 answer
234 views
I follow the blog post from Establishing a Telerik RESTful Reporting Service in under 5 Minutes and I can now have the web api up and run.

For all the report (trdx file) in the web api, we need to state the connection string in the web.config, but for our case, we have a class which provide the DB connection string to the program like:

Container ctx = new Container();

reportSource = ctx.ConnectionString;

How can I implement to my new Web API project in this case?
Stef
Telerik team
 answered on 16 Jul 2014
1 answer
86 views
We need to design a report which one of the parameter is multi selection from a table, but the table contain over 3000+ records.

Is there a way (or similar) which we can do a search first, then add the value to the parameter, then execute the report?
Stef
Telerik team
 answered on 16 Jul 2014
3 answers
1.9K+ views
I've recently began updating one of our projects from Reporting Q1 2013 to Q2 2014, but have ran into the problem of trying to pass a Model to an objectdatasource.  Previously, I used http://blogs.telerik.com/careypayette/posts/13-03-26/telerik-reporting-in-mvc-sure-it-takes-8-quick-steps- to display the ReportViewer using .aspx and would use an InstanceReportSource to render the report:

aspx View
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<MyProject.Models.MyModel>" %>

protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        var instanceReportSource = new InstanceReportSource();
 
        Report report = new Report1(Model);
 
        instanceReportSource.ReportDocument = report;
 
        ReportViewer1.ReportSource = instanceReportSource;
        ReportViewer1.ViewMode = ViewMode.Interactive;
    }

Report class:
using MyProject.Models;

namespace Admissions.Reports
{
    using Telerik.Reporting;
 
    public partial class Report1 : Report
    {
        public Report1()
        {
            InitializeComponent();
        }
 
        public Report1(MyModel model) : this()
        {
            DataSource = model;
        }
    }
}


With the new version of Telerik Reporting, InstanceReportSource is obsolete when using the new razor syntax to generate the report so we have to use UriReportSource or TypeReportSource.

@{
    var uriRS = new UriReportSource() { Uri = "1"};
}
@(
Html.TelerikReporting().ReportViewer().Id("reportViewer1")
   .ServiceUrl("/api/reports/")
   .TemplateUrl("/Content/ReportViewer/templates/telerikReportViewerTemplate.html")
        .ReportSource(uriRS)
        .ViewMode(ViewModes.INTERACTIVE)
        .ScaleMode(ScaleModes.SPECIFIC)
        .Scale(1.0)
        .PersistSession(false)
      )

I've tried to use a custom report resolver (example at bottom of OP (http://www.telerik.com/forums/%27bad-request%27---%27missing-report-name%27-when-using-instancereportsource-in-asp-net-mvc-report-viewer), and was able to pass data in using InstanceReportSource, but I wasn't able to attach any report parameters since the Model is being populated inside of the resolver (which I'd prefer not to do) and the report is created in the resolver and not actually using any parameters from the view.

namespace Admissions.Controllers
{
    public class ReportsController : ReportsControllerBase
    {
        protected override ICache CreateCache()
        {
            return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache();
        }
 
        protected override IReportResolver CreateReportResolver()
        {
            return new CustomReportResolver();
        }
    }
 
    public class CustomReportResolver : IReportResolver
    {
        public ReportSource Resolve(string reportId)
        {
            var report = new Report();
 
            report = new Report1(new DashboardViewModel { TotalRolesCount = "Hello Report World" });
 
            var irs = new InstanceReportSource { ReportDocument = report };
 
            return irs;
        }
    }
}

Has anyone found a way to pass the Model directly into the report, (var report = new Report1(Model) ); or a solution that would work equally well?
Stef
Telerik team
 answered on 16 Jul 2014
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?