Telerik レポートは初めてです。私は多かれ少なかれ、このKB 記事に従おうとしています。
そこで説明されているアプローチは、ウィザードをバイパスします。データベースは SQL Server 2000 で、ウィザードは 2005 以降を要求するため、ウィザードをバイパスする必要があります。
ツールボックスからレポートに sqlDataAdapter をドラッグ アンド ドロップします。アダプターは、レポートのコンストラクターで構成されます。
レポートにテキスト フィールドを追加し、そのプロパティ ページに移動して [値] の省略記号 [...] ボタンをクリックし、ダイアログの左下にある [フィールド] をクリックすると、右側のペインに「データソースがありません」。
設計時にデータソースを認識させるにはどうすればよいですか? 私は何が欠けていますか?ありがとう
namespace EventsReportingClassLibrary
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using Telerik.Reporting;
using Telerik.Reporting.Drawing;
/// <summary>
/// Summary description for Report1.
/// </summary>
public partial class Report1 : Telerik.Reporting.Report
{
private SqlConnection CNN;
private SqlDataAdapter DA
{
get { return sqlDataAdapter1; // dropped from the toolbox onto report}
}
private string ConnectionString
{
get { return "server=server5\\SQL2K;Initial Catalog=foo;User Id=foo2;Password=foo3;Pooling=yes"; }
}
public Report1()
{
InitializeComponent();
CNN = new SqlConnection(ConnectionString);
DA.SelectCommand = new SqlCommand("select * from myView",CNN);
DA.SelectCommand.CommandType = CommandType.Text;
this.DataSource = DA;
}
private void Report1_NeedDataSource(object sender, System.EventArgs e)
{
// fires at run-time if datasource of this report is null
}
}
}