Reporting and 2016 ASP.NET CORE 1.0

9 posts, 0 answers
  1. Rick Hubka
    Rick Hubka avatar
    42 posts
    Member since:
    Apr 2006

    Posted 17 Mar 2016 Link to this post

    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.

  2. Stef
    Admin
    Stef avatar
    3611 posts

    Posted 18 Mar 2016 Link to this post

    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
  3. Soumya
    Soumya avatar
    1 posts
    Member since:
    May 2017

    Posted 10 May Link to this post

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

     

  4. Stef
    Admin
    Stef avatar
    3611 posts

    Posted 10 May Link to this post

    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
  5. Emrah
    Emrah avatar
    2 posts
    Member since:
    Apr 2015

    Posted 18 Sep Link to this post

    Hello,

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

    Thank you, regards

  6. Katia
    Admin
    Katia avatar
    596 posts

    Posted 21 Sep Link to this post

    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
  7. Emrah
    Emrah avatar
    2 posts
    Member since:
    Apr 2015

    Posted 05 Oct in reply to Katia Link to this post

    Hi Katia,

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

    Thank you, regards.

  8. Burak
    Burak avatar
    1 posts
    Member since:
    Jun 2013

    Posted 06 Oct Link to this post

    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?

     

  9. Katia
    Admin
    Katia avatar
    596 posts

    Posted 09 Oct Link to this post

    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
Back to Top