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?
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?