Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SDK - retrieve record_formula of Crystal Report

Status
Not open for further replies.

cmmrfrds

Programmer
Feb 13, 2000
4,690
US
My code blows up on getting the record formula when the Crystal Report format is 'Pdf' or 'Excel'.

Here is the code snippet.

Build the Select sting.

infoStr = "Select TOP 5000 SI_NAME, SI_DESCRIPTION, SI_PATH, SI_OWNER, SI_PARENT_FOLDER, SI_ID, "
infoStr = infoStr & "SI_PROCESSINFO, SI_PROCESSINFO.SI_RECORD_FORMULA, SI_FILES, SI_SCHEDULEINFO "
infoStr = infoStr & "From CI_INFOOBJECTS Where (SI_PROGID='CrystalEnterprise.Report') "
infoStr = infoStr & "and si_instance = 1 and si_recurring = 1 "

Set aResult = objInfoStore.Query(infoStr)

Get the Record Formula.

Dim CntValues As Integer, Rec_sel As Variant, indx4 As Integer
CntValues = aResult(indx).ProcessingInfo.Properties.Count
For indx4 = 1 To CntValues
''' - erred when going after 'Excel' or 'Pdf' types.
If aResult(indx).ProcessingInfo.Properties(indx4).Name = "SI_RECORD_FORMULA" Then
Rec_sel = aResult(indx).PluginInterface.RecordFormula
End If
Next

It blows up on Rec_sel = aResult(indx).PluginInterface.RecordFormula only when the format is 'Execl' or 'Pdf'. I can get the formula when the format is 'Report'.

I don't know why the format of the output would affect the record formula code. Any ideas?
 
Hi,
I am not sure that stored Excel or PDF format objects have the SI_RECORD_FORMULA populated that same as with a Report format.. Not sure though, try looking in the SDK Help files for the attributes/properties of those types..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Turkbear, you're correct - they don't store that information. That information is available only for instances that are in the Crystal Report format.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
I started out using the example in the SDK which I posted above. This worked for SI_KIND = 'CrystalReport', but not 'Pdf' or 'Excel'.

I switched to using the syntax below and it works for all of the "Kinds".

Dim CntValues As Integer, Rec_sel As Variant, indx4 As Integer
CntValues = aResult(indx).ProcessingInfo.Properties.Count
For indx4 = 1 To CntValues
''' - erred originally when going after 'Excel' or 'Pdf' types.
If aResult(indx).ProcessingInfo.Properties(indx4).Name = "SI_RECORD_FORMULA" Then
Rec_sel = aResult(indx).ProcessingInfo.Properties(indx4).Value
End If
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top