Passing Field Values to BAQ Report Options

I actually managed to figure it out yesterday, using LaunchFormOptions on the button that opens the receiving form. I was having issues splitting my substring on the receiving form but it’s all working now. I still can’t get it work on a form load event though, I have to use a button on receiving form.

Code from Job Adjustment (sending form)

	public void btnmtl_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
	

		
		LaunchFormOptions lfo = new LaunchFormOptions();
		lfo.IsModal = false;
		lfo.ValueIn = (tbJobNum.Text + "~" + cboAsmSeq.Value + "~" + cboOper.Value);
		ProcessCaller.LaunchForm(oTrans, "UDPARTAG", lfo);

	}

BAQ Report (Receiving form)

	public void btnjob_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **


				if(BAQReportForm.LaunchFormOptions != null)
		{
			string val = BAQReportForm.LaunchFormOptions.ValueIn.ToString();

			string[] items = val.Split('~');
			
			string job = items[0];
			string asm = items[1];
			string opr = items[2];

			EpiDataView view = ((EpiDataView)(this.oTrans.EpiDataViews["ReportParam"]));

			view.dataView[view.Row].BeginEdit();
			view.dataView[view.Row]["field1"]= job;
			view.dataView[view.Row].EndEdit();

			view.dataView[view.Row].BeginEdit();
			view.dataView[view.Row]["field2"]= Convert.ToInt32(asm);
			view.dataView[view.Row].EndEdit();

			view.dataView[view.Row].BeginEdit();
			view.dataView[view.Row]["field3"]= Convert.ToInt32(opr);
			view.dataView[view.Row].EndEdit();
			
			oTrans.Update();
		
			txtfield1.Text = job;
			numfield2.Value = Convert.ToInt32(asm);
			numfield3.Value = Convert.ToInt32(opr);


		}	
		else
		{
		}

	}

I appreciate the help though!

1 Like