a data source instance has not been supplied for the data source 'dataset1'
private void Window_Loaded(object sender, RoutedEventArgs e) { dbl_cust = from recs in MainWindow.mcsEntity.mcs_custfeed select recs; string c = dbl_cust.FirstOrDefault().mcs_CustFeed_Name.ToString(); DataSet1 ds = new DataSet1(); foreach (var custfee in dbl_cust) { string cn = custfee.mcs_CustFeed_Name; string cq = custfee.mcs_CustFeed_Qustion; int yn = custfee.mcs_CustFeed_YesNo; ds.Tables[0].Rows.Add(cn, cq, yn); } string dc = ConfigurationManager.AppSettings["Connection String"]; ReportDataSource rds = new ReportDataSource("DataSet1",dc); reportViewer1.ProcessingMode = ProcessingMode.Local; reportViewer1.LocalReport.ReportPath = @"D:\Jagadeeswaran\Project\User\User\Report1.rdlc"; reportViewer1.RefreshReport(); host.Child = reportViewer1; } } private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument) { Tables tables = reportDocument.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables) { TableLogOnInfo tableLogonInfo = table.LogOnInfo; tableLogonInfo.ConnectionInfo = connectionInfo; table.ApplyLogOnInfo(tableLogonInfo); } }
<window x:class="User.FeedbackReport" xmlns:x="#unknown"> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:crystal="clr-namespace:CrystalDecisions.Windows.Forms;assembly=CrystalDecisions.Windows.Forms" xmlns:viewer="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms" xmlns:dalsi="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms" Title="FeedbackReport" Height="700" Width="1000" Loaded="Window_Loaded" xmlns:my="clr-namespace:SAPBusinessObjects.WPF.Viewer;assembly=SAPBusinessObjects.WPF.Viewer" WindowStartupLocation="CenterScreen"> <windowsformshost name="host" margin="0,34,0,0"> <viewer:reportviewer x:name="reportViewer1" xmlns:viewer="#unknown" /> </windowsformshost> </window>
ReportDataSource rds = new ReportDataSource("DataSet1",dc);
ds
dc
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)