We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to bind datasource to chart report on OnReportLoaded

Thread ID:

Created:

Updated:

Platform:

Replies:

132520 Sep 6,2017 12:24 PM UTC Sep 7,2017 05:39 AM UTC JavaScript 1
loading
Tags: ejReportViewer
Prashant Prasad
Asked On September 6, 2017 12:24 PM UTC

Hi Team,

I have created rdlc file which contains chart and want to bind datasource on OnReportLoaded event for that I have used for code.

public void OnReportLoaded(ReportViewerOptions reportOption)
{
GetReportViewerData objGetReportViewerData = new Areas.DX.Models.GetReportViewerData(Log);
reportOption.ReportModel.DataSources.Clear();
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "DataSet1", Value = objGetReportViewerData.ColumnReportReportData() });
}

public IList ColumnReportReportData()
{
DataTable dt = null;
MessageInfo objMsgInfo = new MessageInfo();
_data.RetrieveRecords(ref objMsgInfo, "SELECT ROW_NUMBER() OVER (ORDER BY ExtTbl.[INBOXSTATUS]) As [UNIQUESRL],ExtTbl. [INBOXSTATUS] As [XAxis], ISNULL(Count(ExtTbl.[INBOXREFNO]),0) As [YAxis] FROM [DX_Inbox_LOXF] AS ExtTbl WHERE ExtTbl.[INBOXSTATUS] IS NOT NULL AND ( ISNULL([INBOXSTATUS],'') <> 'Folder Created' ) GROUP BY ExtTbl.[INBOXSTATUS]", ref dt);
var list = dt.Rows.Cast().ToList();
return list;
}

Finally,

$(function () {
$("#container").ejReportViewer(
{
isResponsive: true ,
reportServiceUrl: '/api/SyncfusionReport',
processingMode: ej.ReportViewer.ProcessingMode.Local,
reportPath: '~/Reports/ColumnChartReport.rdl',
pageSettings: { orientation: ej.ReportViewer.Orientation.Landscape },
pageSettings: { paperSize: ej.ReportViewer.PaperSize.A4 },
//printMode: true,
//PrintOptions: ej.ReportViewer.PrintOptions.None,
reportPrint: "onReportPrint"
});
});

But when I run the application it not display the data.I have attached the rdlc file for your reference.

Many thanks.

Attachment: ColumnChartReport_aaeebc01.rar

Yuvaraj Devarajan [Syncfusion]
Replied On September 7, 2017 05:39 AM UTC

Hi Prashant, 
 
Thanks for contacting Syncfusion support. 
 
We have checked the mentioned problem with the shared Report Definition by passing the local dataset value of the report in OnReportLoaded method and it’s working properly at our end as shown in shared screenshot. The mentioned problem might be occurred when the list of dataset value is not passed properly in ReportDataSource, so can you please check whether the list of dataset is passed properly from ColumnReportReportData method in your application.   
 
 
 
For your reference, we have prepared a sample and it can be downloaded from below location, 
 
If the issue still persists, then revert the shared sample with issue reproducible procedure to validate the mentioned problem at our end.  
 
Regards, 
Yuvaraj D. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;