如何使用 C# 打开 SAP Business One 报表查看器

How to open SAP Business One Report Viewer Using c#

我正在创建一个插件,它将打开来自 BP Master 的 Crystal 报告,将有一个按钮可以打开它。但我无法调用默认的 SAP B1 Report viewrr。有人可以向我提出建议吗?

public static bool Layout_Preview(string ReportName, string First_Parameter)
                {
                    Recordset oRS = (Recordset)SBOC_SAP.G_DI_Company.GetBusinessObject(BoObjectTypes.BoRecordset);
                    oRS.DoQuery("SELECT MenuUID FROM OCMN WHERE Name = '" + ReportName + "' AND Type = 'C'");
                    SAPbouiCOM.Form form = null;
                    if (oRS.RecordCount > 0)
                    {
                        string MenuID = oRS.Fields.Item(0).Value.ToString();
                        SBOC_SAP.G_UI_Application.ActivateMenuItem(MenuID);
                        form = SBOC_SAP.G_UI_Application.Forms.ActiveForm;
                        ((EditText)form.Items.Item("1000003").Specific).String = First_Parameter;
                        form.Items.Item("1").Click(BoCellClickType.ct_Regular);
                        return true; 
                    }
                    else
                    {
                        SBOC_SAP.G_UI_Application.MessageBox("Report layout 'ReportName' not found.", 0, "OK", null, null);
                        return false;
                    }

                }