Hello every One,
I am using Microsoft Report Viewer under VS2008.
I have following problems in reporting [ Windows Forms Application]
1.
Can I make reports without using any DataSet.xsd file ?
2.
How can I specify database path at run time for reports, because it will change on user's computer. I don't want to store it in connection string in .config or any file. Also ConnectionString contains password for database.
3.
For 5 Reports I think single report viewer control on a form will do this, and 5 different .rdlc files will be required ,
but how many DataSet.xsd files do I need to create? [If I use].
4.
I created one Dataset1.xsd file, added one Table adapter ,
That started configuration wizard then I followed whole thing, wrote query & Finish etc.
But it asks to store connection string ...... I don't want it.
If I don't store how to achieve Reporting?
I created DataSet1.xsd file , just to draw fields on Report1.rdlc , then I want to forget this.
I use following code to show report at run time.
private void button1_Click(object sender, EventArgs e)
{
SqlCeConnection con=new SqlCeConnection("Data Source=" +
Global.MyAppPath + @"\Database\CityPride.sdf;password=xyz");
con.Open();
DataSet ds=new DataSet("login");
SqlCeDataAdapter da=new SqlCeDataAdapter ("select * from login",con);
da.Fill(ds,"Login");
ReportDataSource rds = new ReportDataSource();
rds.Name = "login";
rds.Value = ds.Tables[0];
reportViewer1.LocalReport.ReportPath = "..\\..\\Reports\\Report1.rdlc";
reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.DataSources.Add(rds);
reportViewer1.Refresh();
reportViewer1.RefreshReport();
}
Does not work what is wrong?
It gives error:-
a data source instance has not been supplied for the data source DataSet1_Login
Please Help, Thanks.
[edit]Code block added - OriginalGriff[/edit]