Telerik Forums
Reporting Forum
10 answers
438 views

Hi,

 

I'm trying out Telerik Reporting for .NET Core and I'm having an issue configuring the export device settings for CSV I've added the app.config file specified at the bottom of: http://docs.telerik.com/reporting/html5-report-viewer-asp-net-core

 

This app.config is being picked up by the program because it allowed me to input the connection string and run up the report.

 

After this I tried adding in extension settings as detailed in your support blog: http://www.telerik.com/support/kb/reporting/details/configuring-the-csv-rendering-extension

 

My implementation is below: 

<configuration>
  <configSections>
    <section
            name="Telerik.Reporting"
            type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting, Version=10.2.16.914, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
            allowLocation="true"
            allowDefinition="Everywhere"/>
  </configSections>
 
  <Telerik.Reporting>
    <Extensions>
      <Render>
        <Extension name="CSV">
          <Parameters>
            <Parameter name="NoHeader" value="true"/>
            <Parameter name="NoStaticText" value="true"/>
          </Parameters>
        </Extension>
      </Render>
    </Extensions>
  </Telerik.Reporting>
 
  <connectionStrings>
    <add name="XXX" connectionString="XXX security=True;MultipleActiveResultSets=True;App=EntityFramework;Asynchronous Processing=true" providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

 

I'm wondering if:

  1. This implementation still works for .NET Core (I assume it does because the connection string does.)
  2. If you can see any issues with my above code.
  3. Where do these settings actually get pushed in to the report viewer template, I've searched through all the related code I can find and can't find any references to the export settings.

Thanks,

Josh

Nasko
Telerik team
 answered on 13 Jun 2018
5 answers
311 views

Hello,

 

We've got a problem with the PageCount property over here. Most of the time it works (always but once...), So it seems like the pagecount has a bug?

Is there a known bug at the moment?

Our scenario is:

We've got 6 pages, but the PageCount was 5. Pagenumbering works like fine.

It happens only when there is a certain amount of data on the pages, so when I had less data, the PageCount was 6, so correct.

Any ideas?

 

Steven

Todor
Telerik team
 answered on 13 Jun 2018
3 answers
747 views

Dear Telerik,

we are trying to use a report file Item.trdx with ObjectDataSource in .NET MVC but the view can not render my report.

1) In ReportDesigner

I created a file Item.trdx, then tried to link to a fake sqlDataSource to test in preview mode all good.

2) ObjectDataSource: I have below classes in Model (I may build these classes into class library .dll later if required)

public class
ItemLocationModel
{
        public string ITEM_NO { get; set; }
        public string PREV_LOC { get; set;}       
}

public class ItemLocation
{
       [DataObjectMethod(DataObjectMethodType.Select)]
        public static IList<ItemLocationModel> GetItemLocation(string item_no)
        {
            List<ItemLocationModel> l =new List<ItemLocationModel>();           

            //fill up data here based on item_no....

            return l;
        }
}

3) In Controller: I am trying to use Resolver

class
CustomReportResolver : Telerik.Reporting.Services.Engine.IReportResolver
{
        public Telerik.Reporting.ReportSource Resolve(string item_no)
        {
Telerik.Reporting.ObjectDataSource objectDataSource = new Telerik.Reporting.ObjectDataSource();
objectDataSource.DataSource = ItemLocation.GetItemLocation(item_no);
Telerik.Reporting.Report report = new Telerik.Reporting.Report();
report.DataSource = objectDataSource;
Telerik.Reporting.InstanceReportSource reportSource = new Telerik.Reporting.InstanceReportSource();
reportSource.ReportDocument = report;           
return reportSource;
}

public class ReportsController : Telerik.Reporting.Services.WebApi.ReportsControllerBase
{
        protected override Telerik.Reporting.Services.Engine.IReportResolver CreateReportResolver()
        {
            return new CustomReportResolver();
        }
        protected override Telerik.Reporting.Cache.Interfaces.ICache CreateCache()
        {
            return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache();
        }
}

 

4) In CSHTML: i am populating the ReportViewer

<div id="reportViewer1" class="k-widget">
            loading...
</div>
    <script type="text/javascript">
        $("#reportViewer1")
            .telerik_ReportViewer({
                serviceUrl: "/api/reports/",
                templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-9.0.15.324.html',
                reportSource: {
                    report:  1
                }
            });
</script>

 

5) RESULT:

I debugged the Resolve() function and it clearly got data correctly, but it does not show my my report, it totally empty without any error even the template was loaded. My questions are:

- How to load data returned back from an InstantDataSource in CSHTML file?

- How to bind my returned data with a report file .trdx?

 

Thanks so much in advanced.

Quang

Todor
Telerik team
 answered on 12 Jun 2018
2 answers
785 views

Is there a way to convert a column from your data source to an array/concatenated string?

To give a little more detail:
I'm getting back a list of data from my query looking something like this

  1. blah    | x | 1
  2. words | y | 23
  3. hello   | z | 78

I then need to pass the comma delimited list of column 3 ("1, 23, 78") into a sub-report to be displayed.

 

Any help would be appreciated. 

Steven
Top achievements
Rank 1
 answered on 08 Jun 2018
1 answer
1.4K+ views
My API has a `ReportsController` set up like so:

using System.Web.Http.Cors;
using Telerik.Reporting.Cache.File;
using Telerik.Reporting.Services;
using Telerik.Reporting.Services.WebApi;

namespace API.Controllers
{
[EnableCors(origins: "*", headers: "*", methods: "*")]
public class ReportsController : ReportsControllerBase
{
static ReportServiceConfiguration configurationInstance;

static ReportsController()
{
configurationInstance = new ReportServiceConfiguration
{
HostAppId = "Html5App",
Storage = new FileStorage(),
ReportResolver = new ReportTypeResolver(),
// ReportSharingTimeout = 0,
// ClientSessionTimeout = 15,
};
}

public ReportsController()
{
//Initialize the service configuration
this.ReportServiceConfiguration = configurationInstance;
}
}
}

My `App_Start\WebApiConfig.cs`:

    public static class WebApiConfig
    {
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services

            config.EnableCors();
            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );
        }
    }

My `Global.asax.cs`:

    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            ReportsControllerConfiguration.RegisterRoutes(GlobalConfiguration.Configuration);
            GlobalConfiguration.Configure(WebApiConfig.Register);
        }
    }

My `web.config` has the recommended binding redirects:

    <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
      </dependentAssembly>

As far as I can tell, everything is set up correctly, I can call `api/reports/formats` and see the correct data.  When I try to load this report, I get an error.

$("#reportViewer1").telerik_ReportViewer({
serviceUrl: "http://dev-api/api/reports",
reportSource: {
report: "Logic.Reports.Report1, Logic",
parameters: reportParam
},
});

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

on the page, and displays 

`Failed to load http://dev-api/api/reports/resources/templates/telerikReportViewerTemplate-html: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:64634' is therefore not allowed access.`

in the Chrome console.  I cannot figure out what I am missing.
Silviya
Telerik team
 answered on 08 Jun 2018
3 answers
114 views
I am using the Telerik.Reporting.Map control to build some functionality in the map. What I'd like to achieve is some labels on the left top, left center and left bottom. Whenever I do that, the titles do not sit in 1 line. 

How can I align them so they are on 1 line?
Silviya
Telerik team
 answered on 08 Jun 2018
8 answers
2.1K+ views

Following these guide: 

https://www.telerik.com/blogs/telerik-reporting-and-aspnet-core

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

to create a REST service for Telerik Report, but whatever I do, I have always get this error:

Am I missing something?

 

 

 

 

 

Todor
Telerik team
 answered on 08 Jun 2018
1 answer
97 views
I have a problem watermarks.
I create my project Telerik Reporting with Winform after build my project by debug or release when i run .exe file in folder bin at my computer i not have watermark but i copy to run other computer is have watermark
T
Top achievements
Rank 1
 answered on 08 Jun 2018
2 answers
149 views

I've followed the instructions in the documentation for setting up a the MVC Report Viewer in my ASP.NET MVC web application. The app path maps to "~/Reports", and in the root of my project I have a folder named 'Reports' which contains the SampleReport.trdp. I believe I have all the other configuration in place (Global.asax, web.config etc.). 

How do I view this sample report? What is the URL for viewing any reports? The documentation is very minimal, are there any tutorials for setting up Telerik reporting in an MVC app?

Ciaran
Top achievements
Rank 1
 answered on 07 Jun 2018
1 answer
369 views

Hi,

I use the asp.net webforms viewer and set the report by setting

    reportViewer1.ReportSource.Identifier = reportFile;

I have a controller which uses a custom resolver

    public class ReportsController : ReportsControllerBase

 

Apparently this page uses the REST service to load the report but how does it know what url to use for the service? I haven't configured this explicitly as far as I can see so it seems to be hardcoded/defaulted?

Rick
Telerik team
 answered on 06 Jun 2018
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?