This is a migrated thread and some comments may be shown as answers.

Reporting and 2016 ASP.NET CORE 1.0

8 Answers 380 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rick Hubka
Top achievements
Rank 1
Rick Hubka asked on 17 Mar 2016, 05:45 PM

I have made an ASP.NET CORE 1.0 web app.  Yes I know it's not final.  For the life of me I can not figure out how to get my Reports to display.

Is it possible?  Anyone succeeded and can share the steps and a bit of code?

Thanks

I guess I'll never change.  I am always drawn to trying the Bleeding Edge in development.  Yes.  It always bites me.

8 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 18 Mar 2016, 05:56 PM
Hello Ricki,

The available Telerik Reporting Nuget packages are for educational purpose only, not ready for production.
More details how to get the packages and test them are discussed in the Reporting in MVC 6 forum thread.

Let us know if you have any further questions.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Soumya
Top achievements
Rank 1
answered on 10 May 2017, 05:28 AM

Can we use telerik reporting in dotnet core 1.0.0 preview 2 003131 version??

 

0
Stef
Telerik team
answered on 10 May 2017, 12:41 PM
Hello Soumya,

The latest Nuget packages are built for .NET Core 1.0.1 projects targeting .NET4.6.1 framework - HTML5 Report Viewer in ASP.NET Core.

You can use an older version of Telerik Nuget packages to target an earlier release of .NET Core. Nuget packages are accessible through the private Telerik Nuget feed, that can be accessed with your Telerik account's credentials.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Emrah
Top achievements
Rank 1
answered on 18 Sep 2017, 07:49 AM

Hello,

Could you please share an example project for it can be downloaded (without report viewer) in asp core

Thank you, regards

0
Katia
Telerik team
answered on 21 Sep 2017, 06:56 AM
Hi Emrah,

I am attaching here one sample project that is targeting ASP.NET Core 1.0.1.

Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Emrah
Top achievements
Rank 1
answered on 05 Oct 2017, 04:30 PM

Hi Katia,

If you have same project using Entity Framework, could you please share it also?

Thank you, regards.

0
Burak
Top achievements
Rank 1
answered on 06 Oct 2017, 03:13 PM

Hi Katia,

I am looking your example, and i saw some problem about asp.net core. Your example framework type .net framework 4.x but you say this project is asp.net core but i cant find it, and i am developing on asp.net core but telerik.reporting not working with this code.

 

public static string reportsPath;
public static byte[] ExportToPDF(string report, Telerik.Reporting.DataSource dbSource, Dictionary<string, object> parameters = null)
{
 
    Telerik.Reporting.Report reportToExport;
    if (parameters != null)
        reportToExport = Resolve(report, parameters);
    else
        reportToExport = Resolve(report);
    reportToExport.DataSource = dbSource;
    ReportProcessor reportProcessor = new ReportProcessor();
    InstanceReportSource instanceReportSource = new InstanceReportSource();
    instanceReportSource.ReportDocument = reportToExport;
    RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
    return result.DocumentBytes;
}
 
public static Telerik.Reporting.Report Resolve(string report, Dictionary<string, object> parameters = null)
{
    var urs = new UriReportSource();
    urs.Uri = reportsPath + "\\" + report;
    if (parameters != null)
        foreach (var parameter in parameters)
        {
            urs.Parameters.Add(new Telerik.Reporting.Parameter(parameter.Key, parameter.Value));
        }
    return UnpackageReport(urs);
 
}
public static Telerik.Reporting.Report UnpackageReport(UriReportSource uriReportSource)
{
    var reportPackager = new ReportPackager();
    var dir = Directory
        .GetFiles(reportsPath)
        .Select(path =>
            Path.GetFileName(path));
    using (var sourceStream = System.IO.File.OpenRead(uriReportSource.Uri))
    {
        var report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream);
        return report;
    }
}
 
public static DataTable ToDataTable<T>(this IList<T> data)
{
    PropertyDescriptorCollection props =
        TypeDescriptor.GetProperties(typeof(T));
    DataTable table = new DataTable();
    for (int i = 0; i < props.Count; i++)
    {
        PropertyDescriptor prop = props[i];
        table.Columns.Add(prop.Name, prop.PropertyType);
    }
    object[] values = new object[props.Count];
    foreach (T item in data)
    {
        for (int i = 0; i < values.Length; i++)
        {
            values[i] = props[i].GetValue(item);
        }
        table.Rows.Add(values);
    }
    return table;
}

 

and i attached your projects properties. Could you help me about how it work?

 

0
Katia
Telerik team
answered on 09 Oct 2017, 01:16 PM
Hi all,

@Emrah, unfortunately I do not have a sample project that satisfies the exact requirements listed by you at hand. In general, to connect the report to ADO.NET Entity Data Model you can use EntityDataSource ComponentEntityDatasource component requires a constructor where it can pass a connection string for connecting to the source database, more detailed information can be found in EntityDatasource Settings help article.
Steps how to connect to EF model are provided in EntityDataSource Wizard help article.

@Burak, .NET Core project that hosts the Reporting REST service must target standard .NET framework e.g. net461, this is required by the rendering mechanism that depend on the GDI+ API.
For targeting multiple platforms with ASP.NET Core Application, you can add HTML5 Viewer as a JavaScript widget which does not require any Telerik NuGet packages.
The Reporting REST service can be hosted separately where the HTML5 Viewer will only need the address of the service.

More detailed information is provided in the updated HTML5 Report Viewer in ASP.NET Core 2 help article.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Rick Hubka
Top achievements
Rank 1
Answers by
Stef
Telerik team
Soumya
Top achievements
Rank 1
Emrah
Top achievements
Rank 1
Katia
Telerik team
Burak
Top achievements
Rank 1
Share this question
or