问题
I have a task to export a repeat grid's content to Excel. I have read an article, but I still can't realize how to properly use it. I tried to repeat article's steps to provide pzRDExportWrapper, but after I click "Save" button I get the error:
Method: Rule-Obj-Activity instance not found: Sb-FW-CTrackFW-Work.pzRDExportWrapper. Details: Invalid value for Activity name passed to ActivityAssembler.
Could anybody give me any suggestions? Thank you.
回答1:
You invoke activity from another activity which applies to class Sb-FW-CTrackFW-Work
. Rule Resolution use primary context Sb-FW-CTrackFW-Work
class and try invoke activity pzRDExportWrapper
from it and you get error (because rule resolution can't found invoked activity in this class).
Activity pzRDExportWrapper
applies to Rule-Obj-Report-Definition
class. Try invoke from it.
Try activity step as below:
Call Rule-Obj-Report-Definition.pzRDExportWrapper
Or use step page for this step which defined as applies to Rule-Obj-Report-Definition
class(you can declare it on Pages&Classes tab)
回答2:
Okay. I have resolved the issue (thank you njc). I have two sections on a lone web page. A context of the first section is my custom data page Co-Name-FW-Data-Search. The Search page has some single value properties which are initialized by an user via an UI. The second section is a repeat grid section, a report definition as a source. My Search page pointed out in a Pages and Classes tab. Also there is a Page, which is created by report definition and contains results. The report definition takes Search’s values as parameters.
So, I have created an activity and passed the Search page and a Cods-Pega-List MyResultList as parameters. There are some steps in the activity:
- Check if Search is null. If true- skip step; else - transfer Search properties into Params props with Data Transform.
- Set Param.exportmode = "excel"
- Call pzRDExportWrapper with Step Page MyResultList.pyReportDefinition. Pass current parameter page.
P.S.: If it doesn’t work try to play with report definition’s settings.
P.P.S.: An only minus of pzExportWrapper is that it invokes report definition again.
来源:https://stackoverflow.com/questions/43325807/why-does-the-error-occurs-then-i-try-to-utilize-pzrdexportwrapper-in-pega-7-1-8