私は報告するのが初めてです。MicrosoftaReportViewr を使用してレポートを表示しています。そのために、データセットを作成して入力しました。次に、そのデータセットを reportviewr1 のソースとして提供しようとします。しかし、実際のコーディングは取得できませんでした。私のコードは
if (cbReprt.Text == "FirmDetails")
{
ReportDocument rpt = new ReportDocument();
rpt.Load("C:\\Users\\ALEN\\Desktop\\Merchant\\MerchantAssociation\\MerchantAssociation\\CrystalReport1.rpt");
SqlConnection myCon;
SqlDataAdapter myAdapter;
DataSet1 myDataset = new DataSet1(); //The DataSet you created.
myCon = new SqlConnection("Data Source=202.88.231.102;Initial Catalog=dbs_Merchant;Persist Security Info=True;User ID=sa;Password=abc123*");
SqlCommand cmd3 = new SqlCommand("select * from View1", myCon);
cmd3.CommandType = CommandType.StoredProcedure;
myAdapter = new SqlDataAdapter(cmd3);
myAdapter.Fill(myDataset, "View1");
rpt.SetDataSource(myDataset);
reportViewer1.LocalReport.DataSources= rpt;
reportViewer1.RefreshReport();
}
しかし、私は reportViewer1.LocalReport.DataSources= rpt;を報告します。エラーを表示しています...特別な名前空間が必要かどうか?