Calling a BAQ report

I am still relatively new to Epicor and very new to this type of endeavor. I am trying to run/call a BAQ Report from a button click and am not sure how to accomplish this in my customization

My Report ID is SerialNumberLab
BAQ ID is BAQR_SerialNumbers

This is the code I have thus far inside my button click handler.

Ice.UI.Rpt.BAQReport.Transaction trans = new Ice.UI.Rpt.BAQReport.Transaction(oTrans);

trans.LoadBAQReportData(“SerialNumberLab”);

EpiDataView edvData = (EpiDataView)trans.EpiDataViews[“ReportParams”];
string strCarton = edvData.dataView[edvData.Row][“Carton”].ToString();
string strPart = edvData.dataView[edvData.Row][“Part”].ToString();

trans.RunDirect(“Preview”);

edvData.Dispose();
trans.Dispose();

It isn’t working as desired though. Have any of you guys ever tried to do this or do any of you see what I have done wrong?

Here is how we do it. There is a bit more here then just calling the report. You also need to set printer settings, which can be seen from the trace when calling the BAQ Report from the menu. (I am assuming that is how folks call it today)

private void printReport()
	{
	    // ** Place Event Handling Code Here **
		string[] printerInfo = GetDefaultPrinter(((Session)oTrans.Session).UserID);
	    string printer = printerInfo[0];
		string pageSettings = printerInfo[1];
		string printerSettings = printerInfo[2];
	    string agentID = "";
		string strSerialNum = edvSerialNumDV.dataView[edvSerialNumDV.Row]["SerialNumber"].ToString();
	
	    try
	    {
	        Session otSession = (Session)oTrans.Session;
	
	        //Set the workstationID
	        string workStation = Ice.Lib.Report.EpiReportFunctions.GetWorkStationID(otSession);
	
	        //Get or Set the AgentID
	        using (var aSA = new SysAgentAdapter(oTrans))
	        {
	            aSA.BOConnect();
	            aSA.GetDefaultTaskAgentID(out agentID);
	            if (!string.IsNullOrEmpty(agentID)) { agentID = "SystemTaskAgent"; }
	        }
	
			for (int i =0; i < 1; i++)
	        {
	            var baqR = WCFServiceSupport.CreateImpl<Ice.Proxy.Rpt.BAQReportImpl>((Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BAQReportSvcContract>.UriPath);
	            var dynamicReport = WCFServiceSupport.CreateImpl<Ice.Proxy.BO.DynamicReportImpl>((Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.DynamicReportSvcContract>.UriPath);
	
	            // GET DEFAULT REPORT PARAMETERS
	            var rptDs = dynamicReport.GetByID("ETK_RMA_Trav");
	            var baqRptDS = baqR.GetNewBAQReportParam("ETK_RMA_Trav");
	            baqRptDS.BAQReportParam[0].Option01 = strSerialNum;
	            baqRptDS.BAQReportParam[0].AutoAction = "SSRSClientPrint";
	            baqRptDS.BAQReportParam[0].WorkstationID = workStation;
				baqRptDS.BAQReportParam[0].PrinterName = printer;
				baqRptDS.BAQReportParam[0].RptPageSettings = pageSettings;
				baqRptDS.BAQReportParam[0].RptPrinterSettings = printerSettings;
	            baqRptDS.BAQReportParam[0].SSRSRenderFormat = "PDF";
	            baqRptDS.BAQReportParam[0].BAQRptID = "ETK_RMA_Trav";
	            baqRptDS.BAQReportParam[0].ReportID = "ETK_RMA_Trav";
	            baqRptDS.BAQReportParam[0].Summary = false;
	            baqRptDS.BAQReportParam[0].ReportStyleNum = 1;
	            baqRptDS.BAQReportParam[0].BAQID = "ETK_RMA_Trav";
	            baqRptDS.BAQReportParam[0].ReportTitle = "Depot RMA Traveller";
	            rptDs.BAQRptOptionFld[0].FieldValue = strSerialNum;
	
	            rptDs.AcceptChanges();
	            StringWriter writer = new StringWriter();
	            rptDs.WriteXml(writer);
	            baqRptDS.BAQReportParam[0].Filter1 = writer.ToString();
	            baqR.SubmitToAgent(baqRptDS, agentID, 0, 0, "Erp.UIRpt.BAQReport");
	        }
	    }
	    catch (Exception ex)
	    {
	        MessageBox.Show("An error occured trying to print report." + ex.Message);
	    }
	}

Thank you sir. I will look at this.