cancel
Showing results for 
Search instead for 
Did you mean: 

How to print or preview all records separately on each separate page?

0 Kudos
146

I have many records to print separately on each separate page by Single Click..

Note: I am able to print Same report on single page for single record by StudentID..

but using below code previewing only first page first record, but not displaying rest of records by ClassID. a class has many records of many students.

--- the code is below....

using (SqlConnection conn = new SqlConnection(DbConnection.connectionString()))

{

string query = "select * From ExamResultsExtended " +

"Where classid like '%"+cboFilterClass.SelectedValue+"%' and Section like '%"+cboFilterSection.SelectedValue+"%' order by RollNo";

SqlCommand cmd = new SqlCommand(query, conn);

DataTable dtReportData = new DataTable();

conn.Open();

SqlDataReader sdr = cmd.ExecuteReader();

dtReportData.Load(sdr);

ReportForm rf = new ReportForm();

rf.ReportName = @"Exam_Reports\MarksheetCardMain.rpt";

rf.dtReportData = dtReportData;

rf.WindowState = FormWindowState.Maximized;

rf.StartPosition = FormStartPosition.CenterScreen;

rf.Show();

}

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

To see all of the data, you need to remove "classid like '%"+cboFilterClass.SelectedValue+"%' and" from the Where clause.

-Dell

Answers (0)