Telerik Forums
Reporting Forum
1 answer
515 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
225 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
369 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
274 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
111 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
1 answer
182 views
I have a report with a sub report that I use for Hierarchial data.  On the sub reports I have the data indented slightly.  This of course causes the width of the sub report, which is equal to the parent report, except it is also indented, so it hangs off the edge of the parent.  How can I fix this?
Hinata
Top achievements
Rank 1
 answered on 16 Jul 2014
4 answers
1.7K+ views
I'm trying to create a report where the data only exists at runtime.  Currently our system calculates this data and returns it as a datatable.  From what I have read, it seems like I can, at runtime assign this table as the datasouce for a report with a a datasource of ObjectDataSource.

Unfortunately I'm striking out.   Here is my code for a simple test

​ 'perform the projections - this calls a routine that returns the desired table in odt2
oUtilities.PerformSingleProjection(CInt(SSG.Common.WebUtil.GetQueryStringValue("courseID")), CInt(SSG.Common.WebUtil.GetQueryStringValue("scheduleID")), odt, odt2, bOngoingUnitsExist, bSuccessfulProjections)

' Creating and configuring the ObjectDataSource component:
Dim objectDataSource As New Telerik.Reporting.ObjectDataSource()
Dim report As New BYOC.ReportLib.ProjectionDetails_KCG
objectDataSource.DataSource = odt2
report.DataSource = objectDataSource
instanceReportSource.ReportDocument = report

​ReportViewer1.ReportSource = instanceReportSource
ReportViewer1.RefreshReport()

On the report my only logic is that the Datasource property is set to ObjectDataSource1 (with no configurations on the objectdatasource) and I have one text field set to =Fields.DisplayText which is a column in the odt2 table.

Unfortunately the report runs but is blank and I can tell that odt2 has 13 rows in it.

What am I missing??

Thanks

Chris

Nasko
Telerik team
 answered on 16 Jul 2014
1 answer
154 views
Hi,

I have 2 questions regarding excel reporting:

1. Is it possible to use XLSX rendering with Right-To-Left layout?

2. Is it possible to keep excel cells border as default (Width=1) for the whole sheet?

Thanks,
Asaf.
Nasko
Telerik team
 answered on 15 Jul 2014
1 answer
131 views
We have a client/server solution, and our client software is Winforms.  Our client-side does not have access to the database server, but it communicates to our server through our own home-rolled rpc services (ip and/or http communication).  

We have a partially implemented solution where our server software runs the sql and sends it back to the client as a datatable, along with the Telerik report definition.  Our client software puts these two pieces together, and displays the resulting Telerik report in a ReportViewer.

This works fine, except we want to utilize Telerik reports where report parameter tokens are embedded into the sql statements, e.g. "SELECT * FROM TableA WHERE FieldA = @parameterA".  This does not work with our current solution, as our server does not have the parameter values to inject into the sql, because at that point, the ReportViewer on the client side has not yet allowed the user to select parameter values.

What approach would you recommend to resolve this?  Continue with our solution and somehow send the user's parameter values to the server before the ReportViewer attempts to display the report (i.e. right as the user clicks the "Preview" button)?  It seems like we are re-inventing the wheel.

Or use Telerik Reporting Services (REST or WCF), and scrap our current approach?  I'm not sure I know what flavour of Telerik Reporting Services would be most appropriate in our situation, or if is the proper approach at all.

Thanks,
Eric.
Stef
Telerik team
 answered on 15 Jul 2014
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?