我使用的是水晶报表BO R4。我正在尝试阅读crystal reports元数据信息。我可以得到列和表的名称,其中有源xml,excel。我如何读取来源为宇宙的水晶报表的表名。我无法读取来源为宇宙的水晶报表的表格信息。
hear是示例代码:
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() );
}发布于 2013-05-22 04:40:44
我不相信您可以通过Java SDK读取宇宙的表名。我所能找到的从宇宙中读取信息的最好方法是通过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 tblhttps://stackoverflow.com/questions/16646916
复制相似问题