Question

Within the Crystal Reports APIs that come standard with Visual Studios, is there any way to extract a file path from a report existing on a Business Objects Enterprise server? We create a ReportDocument object and load it using an InfoStore and an EnterpriseSession. We're looking for a way to programatically extract the file path name so we can use it for metadata in our extraction process. Also, we tried using the FileName property in the ReportDocument class, but it just returns a report CUID.

If we can't figure out a way to do this, we will just do this programatically through a recursive function, but I would definitely prefer to find a property that has this stored.

Was it helpful?

Solution 2

FYI, this is how we came up with a solution for the problem.

All we use is a StringBuilder and an InfoObject query that looks like the following:

string sReportQueryString = 
    "SELECT SI_ID, SI_CUID, SI_NAME, SI_PATH, SI_PARENT_CUID " + 
    "FROM CI_INFOOBJECTS " + 
    "WHERE SI_PROGID='CrystalEnterprise.Report' AND SI_INSTANCE = 0";

After, we call our recursive method and execute the following code:

if (rptInfo.ParentID != 0)
{
    pathName.Insert(0, "\\" + rptInfo.Parent.ToString());
    getPath(rptInfo.Parent, ref pathName);
}

Where rptInfo is an InfoObject and pathName is a StringBuilder.

OTHER TIPS

This is possible just from the InfoStore. In your query you want to include the SI_FILES in the reply. If you're already doing a select * from CI_INFOOBJECTS where SI_NAME='XYZ' then you will already have it coming back.

The tricky part is that the SI_FILES property is in a property bag and has 2 parts that you care about:

  1. SI_FILE1
  2. SI_PATH

SI_FILE1 is the true file name as it was stored within the File Repository System (FRS). The SI_PATH is the path of the file within the FRS. The path will be similar to frs://Input/a_135/028/000/7303/ The first section frs://Input refers to the path as configured for the FRS inside the CMC. The rest of the path is a regular filesystem path to where the SI_FILE1 is stored.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top