Sousa Pambo

Sousa Pambo

  • NA
  • 92
  • 23.9k

Crystal report not fill

Nov 28 2016 1:21 PM
I Can't make SAP crystal Report (2010) work, help me.
 
 
 
private void frmPrintTest_Load(object sender, EventArgs e)
{
dss.Clear();
pc.preencherDetalhesFaculdade();
PrintTest pt = new PrintTest();
pt.SetDataSource(dss);
PrintTest1.SetDataSource(dss);
crystalReportViewer1.ReportSource = PrintTest1;
crystalReportViewer1.RefreshReport();
crystalReportViewer1.Zoom(90);
}
 
--------------------------------------------------------------------------------------------------
public void Details()
{
string sql = "select logo,address,director,chief,nt,website from tb_dad";
using (SqlConnection cn = new SqlConnection(con.stConexaoRH()))
{
try
{
cn.Open();
using (SqlCommand cm = new SqlCommand(sql, cn))
{
using (SqlDataReader rd = cm.ExecuteReader())
{
if (rd.Read())
{
 
DataTable dt = new DataTable();
dt = dss.ddt;
DataRow dr = dt.NewRow();
dr["logo"] = rd[0];
dr["address"] = rd[1];
dr["director"] = rd[2];
dr["chief"] = rd[3];
dr["nt"] = rd[4];
dr["website"] = rd[5];
dt.Rows.Add(dr);
}
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
//It doesn't return any data 
 
 

Answers (2)