I ended up having the form close itself after ‘printing’. It works. It does ask if you want to run the break/routing rules, but I can live with that.
private void DynamicCriteriaReportForm_Load(object sender, EventArgs args)
{
// Add Event Handler Code
if (DynamicCriteriaReportForm.LaunchFormOptions != null && DynamicCriteriaReportForm.LaunchFormOptions.Sender != null)
{
EpiNumericEditor numOrderNum_1 = (EpiNumericEditor)csm.GetNativeControlReference("78f1864b-7dc8-4145-931d-c1d6a2b10bdd");
object ctxValue = DynamicCriteriaReportForm.LaunchFormOptions.ContextValue;
string[] values = ctxValue.ToString().Split(','); // Split string
EpiDataView dvRP = (EpiDataView)oTrans.EpiDataViews["ReportCriteria"];
string workID = oTrans.WorkStationID.ToString();
EpiDataView ds = (EpiDataView)(oTrans.EpiDataViews["ReportParam"]);
var EnableRouting = ds.dataView[ds.Row]["SSRSEnableRouting"];
var AutoAction = ds.dataView[ds.Row]["AutoAction"];
var RSN = ds.dataView[ds.Row]["ReportStyleNum"];
EnableRouting = true;
AutoAction = "SSRSPREVIEW";
RSN = 1001;
dvRP.dataView[dvRP.Row]["OrderNum_1"] = int.Parse(values[0]);
numOrderNum_1.Value = int.Parse(values[0]);
oTrans.SubmitToAgent("SystemTaskAgent", 0,0);
oTrans.PushDisposableStatusText("Reports Submitted for Preview...", true);
DynamicCriteriaReportForm.Close();
}
}