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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use CustomFunctionController to add Repository Custom Function to a re

Status
Not open for further replies.

NicoleM

Programmer
Oct 18, 2001
23
0
0
ZA
I would love to know how to add a Repository Custom Function to a reportclientdocument - If this is possible?
I need to know how to instantiate an object of type Custom Function from the enterprise repository or get a list of available custom functions.
The following code takes a "custom function object" from an existing report (which is a repository custom function) and I THINK adds it to the reportclientdocument - in fact the count of items in the customfunctioncontroller is 1 after I add the custom function but when I save the reportclientdocument they dissapear - I am not sure if I should be using ADD or INSERT method. I also was able use other controllers such as the DataDefController which works sucessfully. Please can someone help me figure out how to do this (btw where in CI_INFOOBJECTS is a custom function stored?)

Thanks Nicole

Dim rptClientDoc As ReportClientDocument
'open the report
rptClientDoc = OpenReport("report1", ceInfoStore)

Dim myCustomfunctions2 As CrystalDecisions.ReportAppServer.DataDefModel.CustomFunctions
Dim myCustomcontroller2 As CrystalDecisions.ReportAppServer.Controllers.CustomFunctionController
myCustomcontroller2 = rptClientDoc.CustomFunctionController()

myCustomfunctions2 = myCustomcontroller2.GetCustomFunctions()
Dim cf As CustomFunction
cf = getfunction(ceInfoStore, ceSession) ' Gets valid custom function object in ANOTHER report
myCustomfunctions2.Add(cf)


Dim datacont As CrystalDecisions.ReportAppServer.Controllers.DataDefController
datacont = rptClientDoc.DataDefController
datacont.RecordFilterController.SetFormulaText("currentdate > month(testing)")

SaveNewReport(ceInfoStore, rptClientDoc, "report1", "report2")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top