Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Retrieve parameters from scheduled reports as pdf

I'm planning Crystal reports from my application to Crystal Reports Server in the email queue. I want to sent the reports as pdf. Sending emails works fine. In the CMS (Crystal Reports Server) I can see the history and scheduled reports with their parameters.

I would like to retrieve the parameters and used email addresses in my application for completed reports (history) and scheduled reports.

If I retrieve the history, the infoObjects that are scheduled as "Report", but when I retrieve them from the history it appears they are not object type Report but type Pdf:

string query = "Select SI_ID, SI_NAME, SI_OWNER, SI_DESCRIPTION, SI_STATUS, SI_STATUSINFO " +

",SI_RECURRING, SI_SCHEDULEINFO.SI_OUTCOME " +

"FROM CI_INFOOBJECTS " +

"WHERE SI_KIND='CrystalReport' AND SI_RECURRING=0";

dt.Columns.Add("Naam");

dt.Columns.Add("Weetniet");

dt.Columns.Add("Eigenaar");

dt.Columns.Add("Status");

dt.Columns.Add("");

dt.Columns.Add("");

InfoObjects infoObjects = infoStore.Query(query);

foreach (InfoObject infoObject in infoObjects)

{

try

{

Report report = (Report)infoObject;

dt.Rows.Add(

infoObject.Title,

infoObject.Properties["SI_NAME"],

infoObject.Properties["SI_OWNER"],

infoObject.SchedulingInfo.Status,

(CeScheduleType)infoObject.SchedulingInfo.Type,

infoObject.Properties["SI_STATUSINFO"]

);

}

catch (Exception e)

{

Alert.Show("Fout in opvragen geschiedenis\n" + e);

}

}

The instruction "Report report = (Report)infoObject;" throws the exception:

Unable to cast object of type 'CrystalDecisions.Enterprise.Desktop.Pdf' to type 'CrystalDecisions.Enterprise.Desktop.Report'.

For the Pdf Object I cannot find the properties to find the email addresses and parameters. Since I can see these in the CMS, they must be there somewhere...

Does anyone know how to do this?

Former Member
replied

you cannot cast report instance of pdf type to Report interface object. For PDF instances, just get the

SI_SCHEDULEINFO.SI_DESTINATIONS and SI_PARAMS property bag of the InfoObject of pdf type and go throught the property bag properties to retrieve destination or parameter information.

If you query for the pdf instance using query builder you can check the structure of those property bags.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question