private void PrintBTN_Click(object sender, EventArgs e)
{
printPreviewDialog1.ShowDialog();
}
private void PrintDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
List<empView> lst = (from s in db.empView orderby s.fullName select s).ToList();
MyReports report = new MyReports();
report.AddHeader(e);
report.AddFooter(e);
report.PrintTitle("דוח עובדים", 80, e);
int row = 50, col = 180, idx = 1;
report.printStringRTL("סד", col, row, 12, e);
report.printStringRTL("שם", col-20, row, 12, e);
report.printStringRTL("טלפון", col-50, row, 12, e);
report.printStringRTL("תפקיד", col-100, row, 12, e);
report.printStringRTL("ת לידה", col-140, row, 12, e);
row += 10;
foreach(empView x in lst)
{
report.printStringRTL(idx.ToString(), col, row, 10, e);
report.printStringRTL(x.fullName, col – 20, row, 10, e);
report.printString(x.phone, col – 90, row, 10, e);
report.printStringRTL(x.roleName, col – 100, row, 10, e);
report.printStringRTL(x.bDate.ToString("dd/MM/yyyy"), col – 140, row, 10, e);
idx++;
row += 5;
}