PrintDocument printDoc = new PrintDocument();
printDoc.PrinterSettings.Copies = 2;
printDoc.PrinterSettings.Collate = true;
The CSV page prints when the button is clicked but it will not collate.
Also, I am working on getting a button to do two things. I have it doing one thing already: When I click it it generates a file and saves it
private void GenerateRejCSV()
{
try
{
SqlCommand cmdViewRej = new SqlCommand("ViewSubmittedRejuvenateRecords", connection);
cmdViewRej.CommandType = CommandType.StoredProcedure;
SqlDataReader reader;
reader = cmdViewRej.ExecuteReader();
string sfile = "";
while (reader.Read())
{
string s1 = reader["BARRELID"].ToString() + "," + reader["SCANNEDDATE"].ToString() +
"," + reader["OAKTYPE"].ToString() + "," + reader["ROWNUMBER"].ToString() + "," + reader["USERID"].ToString() +
"," + reader["SCANNEDTIME"].ToString() + "\r\n";
sfile = sfile + s1;
}
File.WriteAllText(csvpath + textBoxRejuvenate.Text + ".CSV", sfile);
reader.Close();
}
I need it to also print the file that this generates with the same click. Is that possible?