Hi,
I try to write some code to send querying to a Crystal Report
Enterprise,
For example:
1. How many peramaters a given report has?
2. What are the scheduled reports?
The sequence that I used as below:
1. Create a session manager.
2. Logon the server.
3. Retrieve an Information Store Object. // I can't get this
work.
4. Use the Information Store to perform query.
The attached is the code.
Thanks for any help,
-- Heng Ma (hma@ftintl.com)
using System;
using System.Text;
using System.Reflection;
using CrystalInfoStoreLib;
using CrystalEnterpriseLib;
using CrystalDecisions.Web;
using CrystalPluginMgrLib;
namespace CrystalES
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Class1
{
public Class1()
{
}
public static void Main(string[] args)
{
CrystalEnterpriseLib.SessionMgr objSM; // ession Manager
CrystalEnterpriseLib.ISEnterpriseSession objES; // Session
CrystalInfoStoreLib.InfoStore objInfoStore; // Information Store
CrystalInfoStoreLib.ISInfoObjects objRS; // Information Objects
try
{
objSM = new SessionMgr();
objES = objSM.Logon("Administrator", "", "NBQDEV13",
"secEnterprise"
// get an Information store
//objInfoStore = (InfoStore) objES.get_Service("",
"InfoStore" // Failed
// execute a query
string strSelect = "SELECT SI_ID FROM CI_INFOOBJECTS WHERE
SI_OBTYPE=18 AND SI_OWNERID=Administrator";
objRS = objInfoStore.Query(strSelect);
Console.WriteLine(objRS.Count);
}
catch (System.Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
I try to write some code to send querying to a Crystal Report
Enterprise,
For example:
1. How many peramaters a given report has?
2. What are the scheduled reports?
The sequence that I used as below:
1. Create a session manager.
2. Logon the server.
3. Retrieve an Information Store Object. // I can't get this
work.
4. Use the Information Store to perform query.
The attached is the code.
Thanks for any help,
-- Heng Ma (hma@ftintl.com)
using System;
using System.Text;
using System.Reflection;
using CrystalInfoStoreLib;
using CrystalEnterpriseLib;
using CrystalDecisions.Web;
using CrystalPluginMgrLib;
namespace CrystalES
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Class1
{
public Class1()
{
}
public static void Main(string[] args)
{
CrystalEnterpriseLib.SessionMgr objSM; // ession Manager
CrystalEnterpriseLib.ISEnterpriseSession objES; // Session
CrystalInfoStoreLib.InfoStore objInfoStore; // Information Store
CrystalInfoStoreLib.ISInfoObjects objRS; // Information Objects
try
{
objSM = new SessionMgr();
objES = objSM.Logon("Administrator", "", "NBQDEV13",
"secEnterprise"
// get an Information store
//objInfoStore = (InfoStore) objES.get_Service("",
"InfoStore" // Failed
// execute a query
string strSelect = "SELECT SI_ID FROM CI_INFOOBJECTS WHERE
SI_OBTYPE=18 AND SI_OWNERID=Administrator";
objRS = objInfoStore.Query(strSelect);
Console.WriteLine(objRS.Count);
}
catch (System.Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}