Solved

Launch BAQ Report from Actions Menu

  • 7 December 2020
  • 3 replies
  • 584 views

  • Participating Frequently
  • 6 replies

I recently was able to add a new menu item to the Action Menu within Transfer Order Shipment Entry but not I need it to launch a BAQ report we’ve created.

I’ve taken the example given from here: Epicor: Call a BAQ From Code Customization — GingerHelp but nothing happens when I select the new menu item. 

Ideally we’d like the PackNum field to populate from TOS entry but here’s what it should look like it does launch:

So question is how do I launch the report and pull in the data from the entry screen?

Thanks,

Neal

icon

Best answer by Jeff.Sutera 9 December 2020, 22:16

View original

3 replies

The way we do it is, use the launch form options and pass the value into the form ..

 

            LaunchFormOptions lfo = new LaunchFormOptions();
            lfo.CallBackToken = "CallMeAnytime";
            lfo.ValueIn = “FieldValue”;
            ProcessCaller.LaunchForm(oTrans, "MENUID", lfo);

 

then in the report form, in the form load method you add this.

 

        EpiDataView edv = (EpiDataView)oTrans.EpiDataViews["ReportParam"];
        int TranID = 0;

        if (BAQReportForm.LaunchFormOptions != null && BAQReportForm.LaunchFormOptions.ValueIn != null) {

            TranID = Convert.ToInt32(BAQReportForm.LaunchFormOptions.ValueIn);
        }

        edv.dataView[edv.Row]["Field1"] = TranID;

Jeff,

I’m still struggling with passing the data but are you saying to put the top launchformoptions within the report customization and then the bottom “epiDataview” within the Transfer Order customization?

Appreciate your help.

 

Thanks,

Neal

So we did the same thing you are doing with the DMR Form.. We created a BAQ Report, created a menu item so we can launch it from the form..

 

This method is called in the initialization.  This sets up the tool click event so when you select your action menu, it will run the method for the launch form.  the Value In will be your pack num

 

This goes into your transfer Order Customization

    private void InitializePrintNCRActionID()
    {
        try
        {
            ButtonTool printNCRForm = new ButtonTool(printNCRFormToolName);
            
            printNCRForm.SharedProps.Caption = "Print NCR Form";
            
            PopupMenuTool actionsMenu = (PopupMenuTool)baseToolbarsManager.Tools["ActionsMenu"];
            baseToolbarsManager.Tools.Add(printNCRForm);
            actionsMenu.Tools.Add(printNCRForm);
            
            Image imageI = EpiUIImages.GetImage("InternalFunction");
            Image ImageE = EpiUIImages.GetImage("ExternalProcess");
            Infragistics.Win.Appearance appI = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appE = new Infragistics.Win.Appearance();
            appI.Image = imageI;
            appE.Image = ImageE;

            printNCRForm.SharedProps.AppearancesSmall.Appearance = appE;
            printNCRForm.SharedProps.AppearancesLarge.Appearance = appE;
                
            printNCRForm.ToolClick += OnPrintNCRForm;
        }

 

    private void OnPrintNCRForm(object sender, ToolClickEventArgs args)
    {
        try
        {
            LaunchFormOptions lfo = new LaunchFormOptions();
            lfo.CallBackToken = "CallMeAnytime";
            lfo.ValueIn = drDMRHead.NonConfID;
            ProcessCaller.LaunchForm(oTrans, "UDNCRFRM", lfo);
        }
        catch 
        {
            MessageBox.Show("Must Have a DMR populated before printing out the NCR Form");
        }
    }

 

This is a shortcut so you dont have to use the edv.CurrentDataRow[“FieldName”].  This Code gives you direct access to the field names except for any UD fields you may add to the table.  

private DMRProcessingDataSet.DMRHeadRow drDMRHead
    {
        get { return edvDMRHead.CurrentDataRow as DMRProcessingDataSet.DMRHeadRow;}
    }

 

This goes into the BAQ Report Form

 

    private void BAQReportForm_Load(object sender, EventArgs args)
    {
        EpiDataView edv = (EpiDataView)oTrans.EpiDataViews["ReportParam"];
        int TranID = 0;

        if (BAQReportForm.LaunchFormOptions != null && BAQReportForm.LaunchFormOptions.ValueIn != null) {

            TranID = Convert.ToInt32(BAQReportForm.LaunchFormOptions.ValueIn);
        }

        edv.dataView[edv.Row]["Field1"] = TranID;
    }

Reply