Button to run BAQ Report and pass filter data

Just wondering if anyone has added a button to launch a BAQ Report and pass Filter data.

I would like to add a button to the Report Qty screen that will run a BAQ Report. Ideally I would like to pass the Job number, ASM number, and Oper Seq as parameters for my BAQ report - so users would not have to re-type those fields.

Anyone done anything like this before?

Thanks,
DaveO

I have done this by using ProcessCaller, having the BAQReport tied to a menu, and a minor customization. Not sure if there are other ways but this is a pretty easy way to do it.

Mr. Dan: Thank you - Great Idea - I will have to give that a try.

DaveO

Here’s example code for printing directly to the default printer. I don’t have a BAQ example handy since there is a bug with BAQ reports on the version my customer is running that causes long delays on BAQ reports.
You shouldn’t need all the page setup stuff but I left it in there just in case.

       SOPickListReportImpl soPickListReport = WCFServiceSupport.CreateImpl<Erp.Proxy.Rpt.SOPickListReportImpl>(epiSession, Erp.Proxy.Rpt.SOPickListReportImpl.UriPath);
        int terminalID = epiSession.GetTerminalID();

        System.Drawing.Printing.PrinterSettings settings = new System.Drawing.Printing.PrinterSettings();
        string defaultPrinter = settings.PrinterName;

        System.Drawing.Printing.PageSettings ps = (System.Drawing.Printing.PageSettings)settings.DefaultPageSettings.Clone();

        ps.Margins.Left = 16;
        ps.Margins.Right = 16;
        ps.Margins.Top = 25;
        ps.Margins.Bottom = 100;
        //ps.PaperSize.Kind=
        string pageSettings = ps.ToString();
        pageSettings = pageSettings.Substring(15);
        pageSettings = pageSettings.Substring(0, pageSettings.Length - 1);
        pageSettings = pageSettings.Replace("Landscape=False", "Landscape=True");

        SOPickListReportDataSet reportDS = soPickListReport.GetNewParameters();
        soPickListReport.GetDefaults(reportDS);
        reportDS.Tables["SOPickListReportParam"].Rows[0]["PrinterName"] = defaultPrinter;
        reportDS.Tables["SOPickListReportParam"].Rows[0]["OrderList"] = orderNum.ToString();
        reportDS.Tables["SOPickListReportParam"].Rows[0]["FromDate"] = "01/01/2000";
        reportDS.Tables["SOPickListReportParam"].Rows[0]["ToDate"] = "01/01/2099";
        reportDS.Tables["SOPickListReportParam"].Rows[0]["AutoAction"] = "SSRSClientPrint";
        //            reportDS.Tables["SOPickListReportParam"].Rows[0]["AutoAction"] = "SSRSPREVIEW";

        reportDS.Tables["SOPickListReportParam"].Rows[0]["AgentID"] = "SystemAgent";


        reportDS.Tables["SOPickListReportParam"].Rows[0]["WorkstationID"] = Environment.MachineName + " " + terminalID.ToString();
        pageSettings = "Color = False, Landscape = True, Margins =[Margins Left = 16 Right = 16 Top = 16 Bottom = 16], PaperSize =[PaperSize Letter Kind = Letter Height = 1100 Width = 850], PaperSource =[PaperSource Automatically Select Kind = FormSource], PrinterResolution =[PrinterResolution X = 600 Y = 600]";
        reportDS.Tables["SOPickListReportParam"].Rows[0]["RptPageSettings"] = pageSettings;
        reportDS.Tables["SOPickListReportParam"].Rows[0]["RptPrinterSettings"] = @"PrinterName=""" + defaultPrinter + @""",Copies=1,Collate=False,Duplex=Simplex,FromPage=0,ToPage=0";

        soPickListReport.SubmitToAgent(reportDS, "SystemAgent", 0, 0, "Erp.UIRpt.SOPickListReport");

Carson,

Do you have the full code example of this snippet? Includes and what not.
Getting the error on the following:
Compiling Custom Code …

----------errors------------

Error: CS0234 - line 63 (219) - The type or namespace name ‘SOPickListReportDataSet’ does not exist in the namespace ‘Erp.Proxy.Rpt’ (are you missing an assembly reference?)

** Compile Failed. **

private void btnReport_Click(object sender, System.EventArgs args)
{
	// ** Place Event Handling Code Here **
	string strOrder = txtOrder.Value.ToString();
	var epiSession = (Ice.Core.Session)oTrans.Session;
    Erp.Proxy.Rpt.SOPickListReportImpl soPickListReport = WCFServiceSupport.CreateImpl<Erp.Proxy.Rpt.SOPickListReportImpl>(epiSession, Erp.Proxy.Rpt.SOPickListReportImpl.UriPath);
	Erp.Proxy.Rpt.SOPickListReportDataSet reportDS = soPickListReport.GetNewParameters();
}

Thanks,

Ken

Hi

How did you pass the current record through?

I can get my utton to call my baq report- but id like to pass through the dmr number from the Inspection Processing screen

Thankyou