or
After we try we got the problems below;
The current solution
we are manual create the connection string by hardcode "see Code #1" it's give us the preview on design time
below are the current source code we are using for the moment
public partial class Report1 : Telerik.Reporting.Report |
{ |
public Report1() |
{ |
/// <summary> |
/// Required for telerik Reporting designer support |
/// </summary> |
InitializeComponent(); |
sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand(); |
sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter(); |
sqlConnection1 = new System.Data.SqlClient.SqlConnection(); |
sqlConnection1.ConnectionString = |
"Data Source=Develop_telerik;Initial Catalog=insurance;Persist Security Info=True;User ID=sa;Password=rYnI@6%33$3kdnOOk"; |
sqlSelectCommand1.CommandText = "SELECT * FROM TelerikReport"; |
sqlSelectCommand1.Connection = sqlConnection1; |
sqlDataAdapter1.SelectCommand = sqlSelectCommand1; |
this.DataSource = sqlDataAdapter1; |
} |
} |
} |
[Code #1]
above the code inside the report
It's gave us the preview in design time
System.Data.SqlClient.SqlCommand sqlSelectCommand1; |
System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1; |
System.Data.SqlClient.SqlConnection sqlConnection1; |
Report1 _report1 = new Report1(); |
sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand(); |
sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter(); |
sqlConnection1 = new System.Data.SqlClient.SqlConnection(); |
sqlConnection1.ConnectionString = ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ToString(); |
sqlSelectCommand1.CommandText = "SELECT * FROM TelerikReport"; |
sqlSelectCommand1.Connection = sqlConnection1; |
sqlDataAdapter1.SelectCommand = sqlSelectCommand1; |
_report1.DataSource = sqlDataAdapter1; |
ReportViewer1.Report = new Report1(); |
[Code #2]
above are the code in the ReportView page
Any ideas, to improve the development time or anyone has the sample project like this.
Kind Regards,
Kwan