Symptom
当ノートでは、inProc Report Application Server (RAS) .NET SDK を使用して、Crystal Reports で使用されるデータベースおよびテーブルのプロパティを確認する方法について説明します。
Environment
Resolution
以下のコードにより、Crystal Reports で使用されるデータベースおよびテーブルのプロパティを確認することができます。
ReportDocument rd = new ReportDocument();
rd.Load(Server.MapPath("CrystalReports.rpt"));
ISCDReportClientDocument rcd = rd.ReportClientDocument;
DatabaseController databaseController = rcd.DatabaseController;
CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo connectionInfo = databaseController.FindConnectionInfoByDBServerName("DatabaseName");
PropertyBag oldPb = connectionInfo.Attributes;
foreach (String attribute in oldPb.PropertyIDs)
{
if (oldPb[attribute].ToString().Equals("System.__ComObject"))
{
Response.Write(attribute + " (" + oldPb[attribute].GetType().ToString() + ") = <br>");
PropertyBag oldLogonPb = (PropertyBag)oldPb[attribute];
foreach (String logonAttribute in oldLogonPb.PropertyIDs)
{
Response.Write(logonAttribute + " = " + oldLogonPb[logonAttribute].ToString() + " (" + oldLogonPb[logonAttribute].GetType().ToString() + ")<br>");
}
}
else
{
Response.Write(attribute + " = " + oldPb[attribute].ToString() + " (" + oldPb[attribute].GetType().ToString() + ")<br>");
}
}
CrystalDecisions.ReportAppServer.DataDefModel.Tables tables = databaseController.Database.Tables;
CrystalDecisions.ReportAppServer.DataDefModel.Table customerTable = (CrystalDecisions.ReportAppServer.DataDefModel.Table)tables.FindTableByAlias("Sales_by_Category");
Response.Write("Owner" + " = " + customerTable.QualifiedName + " <br>");
Keywords
BO, table, RCD, Reports, テーブル, レポート , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To