Telerik Forums
Reporting Forum
1 answer
248 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
93 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
158 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.6K+ 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
124 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
96 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
3 answers
145 views
I have a certificate that is generated using Telerik Reporting. It has been working as expected for years. No changes have been made to the certificate.  All of the sudden in the past month the certificate started generating an error "An error has occurred while processing TextBox 'txtMyTextBox': The expression contains undefined function call".

I've dealt with this type of error in the past during development. Thought it was odd to happen out of the blue. Rebuilt the dll (with no changes to the code). Plopped the dll into the bin folder. Started working again, lasting several days. Then it occurred again so I recycled the application pool. Worked again for almost 2 weeks.

I've searched all the usual spots for a solution to this issue with no results. No other issues/errors are happening on the site.

What could be causing this? More importantly, how do I fix it?

Using Telerik Reporting version 4.2.10.1221

Thanks!
Stef
Telerik team
 answered on 15 Jul 2014
4 answers
582 views
Hi,

I am using Reporting Q3 2013. I am using a crosstab which has one column group and three row groups. My issue is that due to the level of grouping, the main row group may extend to different pages, vertically. I want to be able to repeat certain rows from the group on each page. The RowHeadersPrintOnEveryPage property does not help me as it only repeats the left column if the report expands horizontally, and ColumnHeadersPrintOnEveryPage will repeat vertically, but only column values, nothing related to the row values. I aslo tried to add row values to column header, but it will only repeat the first value, as expected.

Thanks
Hinata
Top achievements
Rank 1
 answered on 15 Jul 2014
1 answer
140 views
I am trying to create a report with a Map . Something similar to the Sales By Region example supplied . Except my data has a zipcode instead of state . 

How do I use the zip code to display my points on the map . 

Setting the geoLocationMapGroup to the zipcode field does not seem to do it . 

Can you please help. 

Ivan Hristov
Telerik team
 answered on 15 Jul 2014
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?