Ceci est mon recueil HSC lignes de données de base de données ne sont pas affichées dans le rapport de rdlc
protected void btnCreateBill_Click(object sender, EventArgs e)
{
DisplayReport();
}
private DataTable TotalInfoData()
{
try
{
// Open Sql Connection
SqlConnection SqlCon = new SqlConnection(@"Data Source=PRATIKPC;Initial Catalog=dbbilling2.0;Integrated Security=True");
SqlCon.Open();
// Create a Command
SqlCommand SqlComm = new SqlCommand();
SqlComm.Connection = SqlCon;
SqlComm.CommandType = CommandType.Text;
SqlComm.CommandText = "select * from tblTotalFee where Class='" + ClassDropDownList.SelectedItem.Value + "'and StudentID='" + StudentNameDropDownList.SelectedItem.Value+"'";
// Create instance of Northwind DataSetXSD
DataSet1.tblTotalFeeDataTable TotalInfoData = new DataSet1.tblTotalFeeDataTable();
// Set a Data Commands
SqlDataAdapter SqlDa = new SqlDataAdapter(SqlComm);
SqlDa.Fill(TotalInfoData); // Fill Data in NorthwindDataSet Object.
return TotalInfoData;
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
private void DisplayReport()
{
try
{
// Clear the Data Source
ReportingForPrintingReportViewer.LocalReport.DataSources.Clear();
// Set a DataSource to the report
// First Parameter - Report DataSet Name
// Second Parameter - DataSource Object i.e DataTable
ReportingForPrintingReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", TotalInfoData()));
// OR Set Report Path
ReportingForPrintingReportViewer.LocalReport.ReportPath = HttpContext.Current.Server.MapPath("~/Report.rdlc");
// Refresh and Display Report
ReportingForPrintingReportViewer.LocalReport.Refresh();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
Pourquoi aucune sortie à venir dans le rapport ?? Il y a des lignes dans ma base de données mais elles n'ont pas été retournées. Mon rapport ressemble à ceci après l'opération. Pourquoi les lignes ne sont-elles pas affichées?
Ceci est mon jeu de données
Y a-t-il une exception? – TechDo
@techdo Non il n'y a pas d'exception –