Retrieving a custom value from an instance

Use the InfoStore Query method to retrieve the custom value. You use the key, with which you added the value, in the Where clause of the query to retrieve it. If the property does not exist in the property bag then no results will be returned.

To retrieve a custom value from an instance
  1. Retrieve the instance using InfoStore.Query.
  2. Retrieve the InfoObject interface.
  3. Retrieve the custom value using the InfoObject's Properties property.

These steps are explained in Retrieving a custom value from an instance.

Go to the next step: Retrieving the SchedulingInfo interface and setting scheduling options.

Example


var InfoObjects;

var InfoObject;

var Email = "me@somewhere.com"

InfoObjects = IStore.Query

("Select Email From CI_INFOOBJECTS Where SI_PROGID='CrystalEnterprise.Report' "

+ "And SI_INSTANCE=1 And Email='" + Email + "'");


if (InfoObjects.Count == 0)

{

Response.Write ("No instances of the custom value " + Email + " could be found.");

return;

}

Now, if any results are returned, you can display the title of the report containing the custom value.

Response.Write ("Looking for your instances containing the custom value: ("+Email+"): <BR>");


for (k=1;k<=InfoObjects.Count;k++)

{

InfoObject = InfoObjects.Item(k);

Response.Write ("Found: " + InfoObject.Title + "<BR>");

}

For more information, see the Example.



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com