none
Not rendering HTML for Chart Reports in LocalReport RRS feed

  • Question

  • Hi,

    I have try to export report in Html using below code but it is not rendering properly.

    .rdl file contains chart

    I have attached screen shot of Html

    Highly appreciate if you can help on us to resolve this issue.

    thanks

    PlatForm: ASP.NET Core

    public string _reportPath = @"..\\RenderReportAPI\\employeeChart.rdl";

    string mimtype ="";
    int extension = 1;

                   LocalReport localReport = new LocalReport(_reportPath);

                _dataSourceName = "DataSet1";
                _dataSourceList = Employee.GetEmployees();                                   
                localReport.AddDataSource(_dataSourceName, _dataSourceList);

               

                System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
                var result = localReport.Execute(RenderType.Html, extension, null, findString: mimtype);

    Friday, March 15, 2019 2:18 PM

All replies

  • Hi Chiranjiv Rathod

    According to your description , seems you want to export the report in the html in the asp .net core application ,right ?

    If so , seems currently the asp .net core application do not support the ssrs (reportviewer) features.

    While you could try to use the third party extension like ASP.NET Core Report Viewer or MvcReportViewer to achieve your requirement.

    And you also could refer to Reporting Services Web Services with .NET CORE 2 for details.

    You could submit your suggestion in feedback link .If the requirement mentioned by customers for many times, the product team may consider to add this feature in the next SQL Server version. Your feedback is valuable for us to improve our products and increase the level of service provided. Let's look forward this application together.

    If possible,  you could offer the detailed project file to us for more further research .

    Thanks for your understanding and support. Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    Monday, March 18, 2019 6:38 AM
  • Hi,

    Asp.Net Core do not support ssrs(ReportViewer) ok fine with that.

    In my case when i execute .rdl file that contains Tables than it is perfectly working fine but .rdl file that contains Charts than it  causes problem

    I am pasting here my full code what i have done.

    string mimtype = "";
    int extension = 1;
    LocalReport localReport = new LocalReport(_reportPath);
    _dataSourceName = "DataSet1";
    //_dataSourceList = Employee.GetEmployees();
    //NillDeclaration nillDeclaration = new NillDeclaration();
    _dataSourceList = Classes.Employee.GetEmployees();
    // _dataSourceNillDeclarationList = nillDeclaration.GetNillDeclarationData();
    localReport.AddDataSource(_dataSourceName, _dataSourceList);

    //ReportParameter reportParameter = new ReportParameter();
    //reportParameter.Name = "myToken";

    //Parameters.Add("myToken", "chintu143");

    System.Text.Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

    var result = localReport.Execute(RenderType.Html, extension, parameters: Parameters, findString: mimtype);

    List<ReportProperty> list = new List<ReportProperty>();

    string HTML = Encoding.UTF8.GetString(result.MainStream);


    // HTML = HttpUtility.HtmlDecode(HTML);

    // HTML =Regex.Replace(HTML,"\"","'");

    string CSS = Encoding.UTF8.GetString(result.SecondaryStream);

    list.Add(new ReportProperty { Content = HTML, Css = CSS });

    return list;

    I am sending HTML and CSS both to Angular IFrame.

    Here is the Angular Code:

    <div >
    <iframe Id="Report" width="600" height="300" src="{{ReportContent}}"></iframe>
    </div>

    bindIframe(content: any, css: any) {
    debugger;
    this.ReportContent = content +='<Style>'+css+'</Style>';
    const iframe = <HTMLIFrameElement>document.getElementById('Report');
    iframe.contentDocument.write(content);
    iframe.height = iframe.contentDocument.scrollingElement.scrollHeight.toString();
    iframe.width = iframe.contentDocument.scrollingElement.scrollWidth.toString();
    }


    It is working fine for Table reports,but for chart reports it is not rendering properly

    Thanks

    Monday, March 18, 2019 9:50 AM
  • Hi Chiranjiv Rathod

    For not familiar with the report development , could not do more further research about your code .

    From your scenario, seems the chart are not displayed in the html , it seems proved that the asp .net core are not support the ssrs .

    I suggest you post your issue to the asp .net forum for more professional support .

    Thanks for your support and understanding.

    Best Regards,

    Eric Liu


    Best Regards, Eric Liu MSDN Community Support Please remember to click Mark as Answer if the responses that resolved your issue, and to click Unmark as Answer if not. This can be beneficial to other community members reading this thread.

    Tuesday, March 19, 2019 3:05 AM