PDA

View Full Version : psFunction



Roel Westhoff [W4]
6-Jun-2010, 05:10 AM
Hello DAW,

I'm trying to add some header information in a report.
In Crystal i can create a function that can set a variable in report

If i look in the documentation there is psFunction but if i use the sample-code a function can not be set.

Is the documentation correct?
Can supply me with a sample code that works

Roel

Vincent Oorsprong
7-Jun-2010, 12:14 AM
Roel,

I would like to learn what code you have tried to see if the documentation can be improved. Are you getting errors? Where did you code the instruction?

Code that works is like:


Set psFunction sReportId "customername" to "return ('ABC Inc.')"

As you can see the first parameter is the report id. You can pass a blank string or C_USEMAINVRWREPORTID if you want to set a function for the main report.

Roel Westhoff [W4]
7-Jun-2010, 05:05 AM
Hello Vincent,

I'm using the supplied VRW example to incorporate in our application. The oReport is created dynamically and this is different from the supplied examples.

Setting a psfunction generates a error because of the dynamic character of oReport
Haven't found a neat solution yet (can incorporate it in the oVrwReportView.pkg but that is not the solution)

Roel

Vincent Oorsprong
7-Jun-2010, 03:59 PM
Roel,

When needing more flexibility the 3rd wizard option or the template is the best and easiest solution.

Roel Westhoff [W4]
9-Jun-2010, 10:49 AM
Hello Vincent,

I had a look at the wizard output but couldn't find a solution for setting a psFunction
As i said before in the cVrwReportView.pkg it is possible to add the psFunction but this not the correct place to do it.

Roel