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