Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

Its my 3rd day in wpf reporting. But i did not get solution. Oh god help me!

I am trying crystal report, but that login problem is irritating. So I switched to Microsoft report, but its also not fine.

I get this error :

a data source instance has not been supplied for the data source 'dataset1' on reporting.

My code -

 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>


thanks in advance.

i goggled for this error. they give one suggestion to add ReportDataSource. but i already did that.

Update Question -
Posted
Updated 8-Apr-11 2:32am
v11

ljljkljgt;<&[]>
 
Share this answer
 
ReportDataSource rds = new ReportDataSource("DataSet1",dc);

The second parameter here is just your connection string. It's not actually a data source. I assume you're trying to pass ds (your DataSet) here instead of dc.
 
Share this answer
 
Comments
Sagotharan Jagadeeswaran 8-Apr-11 6:56am    
thank u friend. now only i focus here.
ReportDataSource has 7 possibility.
ReportDataSource(string name, object dataSource Value),.
in that i create obj and put in that. but what i give for string name?.

mcs_kioskDataSet kds = new mcs_kioskDataSet();
ReportDataSource rds = new ReportDataSource("?", kds);

i check,.
mcs_kioskDataSet kds = new mcs_kioskDataSet();
ReportDataSource rds = new ReportDataSource("mcs_kioskDataSet", kds);
and
mcs_kioskDataSet kds = new mcs_kioskDataSet();
ReportDataSource rds = new ReportDataSource(kds.DataSetName, kds);
also but that report is not visible. what i do for that?.
Sagotharan Jagadeeswaran 8-Apr-11 7:15am    
i try,
string dc = ConfigurationManager.AppSettings["Connection String"];
mcs_kioskDataSet kds = new mcs_kioskDataSet();
ReportDataSource rds = new ReportDataSource(dc,kds);
also,.. but no improvement. pls tell me what mistake i made?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900