Help DataSet for WebReport
Help DataSet for WebReport
Code:
protected void Wrp_Usuario_StartReport(object sender, EventArgs e)
{
StringBuilder SqlQuery = new StringBuilder();
SqlCommand MsSql_Command = new SqlCommand();
SqlDataAdapter MsSql_DataAdapter = new SqlDataAdapter();
DataSet MsSql_DataSet = new DataSet();
SqlConnection MsSql_Connection;
string Cnx = "Data Source=10.1.1.10;Initial Catalog=db_univag;Persist Security Info=True;User ID=univagweb2;Password=**********";
SqlQuery.AppendLine(" SELECT TOP 50 ");
SqlQuery.AppendLine(" codigo ");
SqlQuery.AppendLine(" , funcionario ");
SqlQuery.AppendLine(" , nome_completo ");
SqlQuery.AppendLine(" , nome_login ");
SqlQuery.AppendLine(" FROM usuario ");
MsSql_Connection = new SqlConnection(Cnx);
MsSql_Command.Connection = MsSql_Connection;
MsSql_Command.CommandType = CommandType.Text;
MsSql_Command.CommandTimeout = 300;
MsSql_Command.CommandText = SqlQuery.ToString();
MsSql_DataAdapter.SelectCommand = MsSql_Command;
MsSql_DataAdapter.Fill(MsSql_DataSet, "usuario");
MsSql_Connection.Dispose();
MsSql_Connection.Close();
if (MsSql_DataSet.Tables["usuario"].Rows.Count > 0)
{
Report report = Wrp_Usuario.Report;
report.RegisterData(MsSql_DataSet.Tables["usuario"], "usuario");
}
}
Thank you!!
Matheus Vinicios
Cuiab??/MT - Brazil
Code:
protected void Wrp_Usuario_StartReport(object sender, EventArgs e)
{
StringBuilder SqlQuery = new StringBuilder();
SqlCommand MsSql_Command = new SqlCommand();
SqlDataAdapter MsSql_DataAdapter = new SqlDataAdapter();
DataSet MsSql_DataSet = new DataSet();
SqlConnection MsSql_Connection;
string Cnx = "Data Source=10.1.1.10;Initial Catalog=db_univag;Persist Security Info=True;User ID=univagweb2;Password=**********";
SqlQuery.AppendLine(" SELECT TOP 50 ");
SqlQuery.AppendLine(" codigo ");
SqlQuery.AppendLine(" , funcionario ");
SqlQuery.AppendLine(" , nome_completo ");
SqlQuery.AppendLine(" , nome_login ");
SqlQuery.AppendLine(" FROM usuario ");
MsSql_Connection = new SqlConnection(Cnx);
MsSql_Command.Connection = MsSql_Connection;
MsSql_Command.CommandType = CommandType.Text;
MsSql_Command.CommandTimeout = 300;
MsSql_Command.CommandText = SqlQuery.ToString();
MsSql_DataAdapter.SelectCommand = MsSql_Command;
MsSql_DataAdapter.Fill(MsSql_DataSet, "usuario");
MsSql_Connection.Dispose();
MsSql_Connection.Close();
if (MsSql_DataSet.Tables["usuario"].Rows.Count > 0)
{
Report report = Wrp_Usuario.Report;
report.RegisterData(MsSql_DataSet.Tables["usuario"], "usuario");
}
}
Thank you!!
Matheus Vinicios
Cuiab??/MT - Brazil
Comments
Everything seems correct. What is your question?
report.RegisterData(MsSql_DataSet.Tables["usuario"], "Usuario");
What better product for me to buy? Here the company is education and medium enterprises.
Thank you!
Since you use ASP.NET, you need FastReport.Net Win+Web, or FastReport.Net Professional (if you need source code).
Team = upto 4 developers
Site = unlimited number of developers in one company