Telerik Forums
Reporting Forum
1 answer
323 views

Hi,

I have gone through the tuts available in the Telerik docs ( link below ) but was not able to View the report.

https://docs.telerik.com/reporting/html5-report-viewer-asp-net-core-2

Would also like to know whether the approach I have done is correct.

What I have done

1 Have an existing application which is targeting Asp.net MVC Core ( not net461 but Core) where I have added a folder with the design ( a sample .rdlc designed in Standalone Report Designer) 

2 Created a REST Service from the Telerik template and configured as per the docs and the end point ( http://localhost:[portnumber]/api/reports/formats) running successfully. 

3 In the Core project ( point 1 I have consumed the REST Service and is trying to run it but shows error ( I 'm using Javascript ReportViewer Widgets since I can't Change the Target version to net461

Is the approach  Please let me know your valuable thoughts.

Error: Error loading the report viewer's templates. (Template = /api/reports/resources/templates/telerikReportViewerTemplate-html).

TIA

Silviya
Telerik team
 answered on 22 Aug 2018
1 answer
185 views

I am trying to run a report in a web application .net core 2 

I have followed the HTML5 Report Viewer in ASP.NET Core 2 Article with no success

I have added the below controller.

namespace schoolAppCore.Controllers
{
   [Route("api/reports")]
    public class ReportsController : Controller
    {
 
 
        string reportsPath = string.Empty;
 
        public ReportServiceConfiguration ReportServiceConfiguration { get; }
 
        public ReportsController(IHostingEnvironment environment)
        {
            this.reportsPath = Path.Combine(environment.WebRootPath, "Report1.trdp");
 
            this.ReportServiceConfiguration = new ReportServiceConfiguration
            {
                HostAppId = "schoolAppCore",
                Storage = new FileStorage(),
                ReportResolver = new ReportTypeResolver()
                                    .AddFallbackResolver(new ReportFileResolver(this.reportsPath)),
            };
        }
 
        [HttpGet("reportlist")]
        public IEnumerable<string> GetReports()
        {
            return Directory
                .GetFiles(this.reportsPath)
                .Select(path =>
                    Path.GetFileName(path));
        }
 
 
    }
 
}

 and also I have added a controller named to run the View as  following:

public class TelerikController : Controller
    {
public IActionResult viewreport()
        {
            return View("reportViewer");
        }
     

 

finally the Report view itself as following:

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <title></title>
    <script src="~/lib/jquery/dist/jquery.min.js"></script>
     
    <link href="~/styles/kendo.common.min.css" rel="stylesheet" />
    <link href="~/styles/kendo.blueopal.min.css" rel="stylesheet" />
 
    <script src="~/lib/Kendo/telerikReportViewer.kendo-12.1.18.620.min.js"></script>
    <script src="~/lib/Kendo/telerikReportViewer-12.1.18.620.min.js"></script>
 
    <style>
        #reportViewer1 {
            position: absolute;
            left: 5px;
            right: 5px;
            top: 50px;
            bottom: 5px;
            overflow: hidden;
            font-family: Verdana, Arial;
        }
    </style>
 
</head>
<body>
    <div id="reportViewer1">
        loading...
    </div>
 
    <script>
        $(document).ready(function () {
            $("#reportViewer1")
                .telerik_ReportViewer({
                    serviceUrl: "api/reports/",
                    //"resources/templates/telerikReportViewerTemplate.html"
 
                    reportSource: {
                        // report: "Telerik.Reporting.Examples.CSharp.ReportCatalog, CSharp.ReportLibrary",
                        report: "Report1.trdp",
 
                        parameters: {}
                    },
                    viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
                    scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
                    scale: 1.0,
                });
        });
    </script>
</body>
</html>

 

I am getting the below error 

jquery.min.js:4 GET https://localhost:44332/telerik/api/reports/resources/templates/telerikReportViewerTemplate-html 404 ()

 

and also (viewreport:1 Uncaught (in promise) undefined)

can some one help in getting this run in core 2 Application 

 


Todor
Telerik team
 answered on 22 Aug 2018
1 answer
363 views

I am not sure if I am doing something wrong to be honest.

I have a simple Master - Detail type report. The report is displaying the correct data. However, when I run SQL Profiler to review the queries that are being executed, I see the master query run as expected. The detail query however has no filter on it. 

I expected to see the parameter value from the master report being passed to the subreport so that it filters the query.

The result of this is a slow rendering of the report. It appears that for each record in the master report, it executes the sub reports query in an unfiltered state. My sub query could have 100,000+++ records. So it grabs that entire dataset, passes it back to the master report which then picks the correct record(s) that it wants. It then moves on to the next parent record.

Is that correct? I must be doing something wrong.

Think of it this way.I have customers table and invoices table. Each customer could have numerous invoices. I want a customer listing report that shows all the invoices for those customers. The sub-report query would be something like "Select Customer, Invoice from Invoice". I would have thought it would be something like "Select Customer, Invoice from Invoice where Customer= @Customer".

 

Please let me know what I have done wrong.

Brian

Todor
Telerik team
 answered on 22 Aug 2018
4 answers
376 views

Hi,

I have created several reports using Telerik reporting. But when the user exports a report, at least to Excel, I have to be able to set the Width to 1 page by default. I have tried several options but I don't seem to be able to set this property using the configuration sections. I am currently using reports in an MVC project. In the device information settings for Excel 2007, I cannot find any configuration to control this property. Is there some how to achieve this?

This requirements is a must from the client, since they don't want to go to the Page Setup -> Scale to Fit menu on Excel to do this change. Currently they have a completely custom solution to generate reports in Excel and this option is already set on this solution, so they consider this missing functionality as a downgrade to their current solution which is unacceptable for them.

I would appreciate a lot to have the same functionality also on PDF, since their reports are quite large and they want to fit them inside one page when exporting to PDF (I know I can play with the font sizes and textbox/table columns sizes but since I have already done the reports, doing these changes will require a lot of time which I unfortunately don't have at this moment).

 

Thanks

Todor
Telerik team
 answered on 22 Aug 2018
3 answers
302 views

Hi

I am trying to print my reports in html format. Unfortunately the page border does not seem to fit a printed page. In portrait I get the top of next page printing border at the bottom of the first ( see attachment). In landscape I lose the bottom of the border. Is there a way to completely remove the border or fix the page sizes to the printed page size.

My browser (chrome) is printing to A4 and the report files are set to A4 size.

 

Any ideas would be of great help.

Thanks

Craig

Silviya
Telerik team
 answered on 22 Aug 2018
3 answers
263 views

Hi, 

 

I have installed the last visual studio update (15.7.6), and after this, Telerik Reporting Controls dissappear from Toolbox. I have removed and reinstall reporting, but the problem continues.

 

I have this problem on my 2 computers, both, updated to vs 15.7.6 and both with missing reporting controls. All other telerik wpf controls is working fine, only reporting controls that is missing.

 

Help me please!

Silviya
Telerik team
 answered on 20 Aug 2018
4 answers
1.0K+ views

We are evaluating whether we can use Telerik reporting as our reporting platform going forward. In working with reports and the report designer, we've run across questions between the two report file types (.trdp and .cs files). The questions we have are:

  • If we are starting to create our reports today, which is the "preferred" type to use?
  • Can Telerik Reporting Server handle .cs files?
  • Is there a way to convert between the two types (either way)? If so, can you link documentation as we are unable to find it.
  • What are the differences between the file types? And what are the intended use cases?
  • Do they both support templates - both code and/or styling?

Thanks.

Rod
Top achievements
Rank 1
 answered on 17 Aug 2018
3 answers
1.0K+ views
We are evaluating Telerik Reporting for various reporting scenarios.  In one of the meetings it was asked if there was a way to set a textbox of a specific size (cangrow = false, canshrink=false, and the area being used is set appropriately) and have the size of the text automatically determined so that all of the text can be displayed within the defined area at the greatest possible font size.

From what I can tell there is not an easy way to accomplish this but I might be able to define a number of conditional rules to the textbox that check the length of the text and apply an appropriate style.  While this would work I don't think that it is the easy solution they are looking for.  This would be more of a trial and error scenario that could be very time consuming and difficult to maintain.  Is there a better alternative that I am just not seeing.
Nasko
Telerik team
 answered on 16 Aug 2018
2 answers
1.4K+ views

I want to build a System.Data.DataTable in my report code to display some quick summary data. I would like to bind the System.Data.DataTable to a Telerik.Reporting.Table and have the columns and rows automatically generated, but I can not figure out how to get it to work.

I keep finding bits and pieces of code, but nothing that shows me what I need to do from end to end. For example, http://docs.telerik.com/reporting/object-data-source-how-to-bind-to-data-table shows a way of doing the binding, but does not indicate what needs to be done on the design side so it is not working for me.

Does anyone have a quick (and full) example that will point me in the right direction?

Thanks.

Raul
Top achievements
Rank 1
 answered on 15 Aug 2018
1 answer
361 views

Hi,

I am very new to Telerik.  I am trying to add a report that I created, into a reportviewer programatically and I was able to successfully do it with a static "Hello World" report.  Now my problem is I am trying the same but this time with a report requiring several parameters and the report is not displaying in the viewer.

Here is my code below.  I have also attached the output on my browser.  I would appreciate it if anyone can point out whatever I am missing, with some examples.  I am sure it something very silly that I completely missed out.  Thanks.

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        Telerik.ReportViewer.Html5.WebForms.ReportSource rptSource = new Telerik.ReportViewer.Html5.WebForms.ReportSource();
        rptSource.IdentifierType = Telerik.ReportViewer.Html5.WebForms.IdentifierType.TypeReportSource;
        rptSource.Identifier = typeof(SellThroughSummary).AssemblyQualifiedName;
        rptSource.Parameters.Add("CoName","Beside LLC");
        rptSource.Parameters.Add("BrandDes", "ALL");
        rptSource.Parameters.Add("SeasonDes", "SS18");
        rptSource.Parameters.Add("StoreDes", "TDM-D");
        rptSource.Parameters.Add("GenDes", "ALL");
        rptSource.Parameters.Add("CatDes", "ALL");
        rptSource.Parameters.Add("Descr", "ALL");
        rptSource.Parameters.Add("FromDt", "2018-01-01");
        rptSource.Parameters.Add("ToDt", "2018-01-31");
 
        this.ReportViewer1.ReportSource = rptSource;
 
        Telerik.Reporting.SqlDataSource sqlDataSource = new Telerik.Reporting.SqlDataSource();
        sqlDataSource.ProviderName = "System.Data.SqlClient";
        sqlDataSource.ConnectionString = "ReportLibrary.Properties.Settings.ReportServer";
        sqlDataSource.SelectCommand = "MIS_SellThru";
        sqlDataSource.SelectCommandType = Telerik.Reporting.SqlDataSourceCommandType.StoredProcedure;
        sqlDataSource.Parameters.Add("CoName", System.Data.DbType.String, "Beside LLC");
        sqlDataSource.Parameters.Add("BrandDes", System.Data.DbType.String, "ALL");
        sqlDataSource.Parameters.Add("SeasonDes", System.Data.DbType.String, "SS18");
        sqlDataSource.Parameters.Add("StoreDes", System.Data.DbType.String, "TDM-D");
        sqlDataSource.Parameters.Add("GenDes", System.Data.DbType.String, "ALL");
        sqlDataSource.Parameters.Add("CatDes", System.Data.DbType.String, "ALL");
        sqlDataSource.Parameters.Add("Descr", System.Data.DbType.String, "ALL");
        sqlDataSource.Parameters.Add("FromDt", System.Data.DbType.String, "2018-01-01");
        sqlDataSource.Parameters.Add("ToDt", System.Data.DbType.String, "2018-01-31");
        sqlDataSource.CommandTimeout = 0;
    }       
}

 

 

Silviya
Telerik team
 answered on 15 Aug 2018
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?