SAP Knowledge Base Article - Public

1692334 - inProc RAS .NET SDK を使用して、Crystal Reports で使用されるデータベースおよびテーブルのプロパティを確認する方法

Symptom

当ノートでは、inProc Report Application Server (RAS) .NET SDK を使用して、Crystal Reports で使用されるデータベースおよびテーブルのプロパティを確認する方法について説明します。

Environment

  • Crystal Reports 2008
  • Crystal Reports .NET SDK
  • Report Application Server (RAS) SDK
  • 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

    Product

    Crystal Reports 2008 V0 ; Crystal Reports 2008 V1 ; SAP Crystal Reports, version for Visual Studio .NET 2008