3

我正在使用 Crystal 报表 BO SDK R4。我正在尝试阅读水晶报告元数据信息。我可以获取具有源 xml、excel 的列和表名称。如何读取源为 Universe 的 Crystal Reports 的表名。我无法读取源为 Universe 的 Crystal Reports 的表信息。

听到是示例代码:

  ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
            IEnterpriseSession enterpriseSession = sessionMgr.logon("xxxxxx", "xxxxx", "xxxxxxx", "secEnterprise"); 
            System.out.println("  BO SERVER  Session Created Sucessfully     ");
            reportAppFactory = (IReportAppFactory) enterpriseSession.getService("RASReportFactory");
            IInfoStore iStore = (IInfoStore) enterpriseSession.getService("InfoStore");
            IInfoObjects reports = iStore.query("select * from CI_INFOOBJECTS where SI_KIND='CrystalReport' and si_kind !='folder'");    
            for(int i=0;i<reports.size();i++)
              {
                    IInfoObject report = (IInfoObject)reports.get(i); 
                    IReportAppFactory reportAppFactory = (IReportAppFactory) enterpriseSession.getService("RASReportFactory");
                    try
                    {
                     ReportClientDocument rcd = reportAppFactory.openDocument(report,OpenReportOptions._openAsReadOnly,java.util.Locale.US);
                      System.out.println("Report Name:- "+rcd.displayName());                                           
                      DatabaseController databasecontroller=rcd.getDatabaseController();                                                                                          
                      IDatabase database=databasecontroller.getDatabase();                                                                          
                      Tables tables=database.getTables();         
                      for(int tab=0;tab<tables.size();tab++)
                       {
                         ITable table=tables.getTable(tab);
                         System.out.println("Alias Name:"+table.getAlias());                     
                         System.out.println("Tables used :- "+table.getName() );


                       }
4

1 回答 1

-1

我不相信您可以通过 Java SDK 读取 Universe 的表名。在从宇宙中读取信息时,我能找到的最好方法是通过 Office 使用宏库。

我有一个示例的唯一代码是

'Grab the application
Set boDesignerApp = New Designer.Application
boDesignerApp.Visible = True

'Present login dialog
Call boDesignerApp.LogonDialog

'Present open dialog
Set boUniv = boDesignerApp.Universes.Open

'Hide designer
boDesignerApp.Visible = False

'iterate through the table names
For Each tbl In boUniv.Tables
    MsgBox (tbl.Name & " is table")
Next tbl
于 2013-05-21T20:40:43.550 回答