3

I am using Crystal reports BO SDK R4. i am trying to read crystal reports meteadata infomration. I can able to get column and tables names which has source xml,excel. How can i read table names for the crystal reports which has source as universe.I am unable to read tables information for crystal reports which has source as universe.

hear is the sample code:

  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() );


                       }
Navyah
  • 1,660
  • 10
  • 33
  • 58

1 Answers1

-1

I don't believe you can read the table names for a universe via the Java SDK. The best I have been able to find in reading information from a universe is to use macro libraries via Office.

The only code I have a sample of is

'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
shrub34
  • 796
  • 6
  • 17
  • Thank you for the reply, but i must read class information for crystal reports which has source as universe using BO RAS SDK – Navyah May 22 '13 at 05:27