I have a c# application that uses a report to print a document, if a mistake is discovered in the data they can edit the data and reprint the document. The updated data appears on the screen but the document does not reflect the updated data unless we close the form and reopen, reselect the record and then reprint. In the report the data comes from a view in the database. I have checked that the store data is not checked is there any other setting that will help refresh the data?
ConnectionInfo ThisConnection = new ConnectionInfo();
ThisConnection.ServerName = witSsetiings1.MyConnection.ServerName;
ThisConnection.DatabaseName = witSsetiings1.MyConnection.DatabaseName;
ThisConnection.IntegratedSecurity = witSsetiings1.MyConnection.IntegratedSecurity;
ThisConnection.UserID = witSsetiings1.MyConnection.UserID;
ThisConnection.Password = witSsetiings1.MyConnection.Password;
TableLogOnInfo MyLogOn = new TableLogOnInfo();
foreach (Table Mytable in wt_cert.Database.Tables) // make point to correct report
{
MyLogOn = Mytable.LogOnInfo;
MyLogOn.ConnectionInfo = ThisConnection;
MyLogOn.ReportName = witSsetiings1.certCertified;
Mytable.ApplyLogOnInfo(MyLogOn);
}
wt_cert.SetParameterValue("PK_certificate", pk_cert);
wt_cert.SetParameterValue("P_Only", p_only);
wt_cert.PrintOptions.PrinterName = witSsetiings1.printerCert;
int copiesCert = 1;
if (this.TxtCert_copies.Text.Equals("").Equals(true)) // added true 021914
{
copiesCert = Convert.ToInt16(witSsetiings1.copiesCertified);
}
else
{
copiesCert = Convert.ToInt16(this.TxtCert_copies.Text);
}
wt_cert.PrintToPrinter(copiesCert, false, 0, 0);