我在水晶报表中编写自定义函数以使用记录选择获取记录时感到困惑。
当我们在记录选择中创建公式时,它将根据使用的参数在生成的 SQL-Query 中添加 where 子句。现在我想编写自定义公式,它将以编程方式提取记录:
即使我写了一个函数:
Function (stringVar st)(
stringVar selection;
if (st <> 'ALL') then (
selection = st;
)
else(
//In this case the user select only single value, it will fetch the result to that //particular column value in the table.. otherwise it leaves that particular row..
selection = "multiple selection";
)
)
现在,使用 select Expert 在记录选择中使用自定义函数的代码将是:
if(myfunction({?parameter1}) <> "ALL") then
(
// what code should i write to select that particular record...
if(myfunction({?parameter2})) <> "ALL" ) then
(
//do selection from the previously selection of rows which have this parameter
if(myfunction({?parameter3}) <> "ALL") then
(
//do selection from the previously selection of rows which have this
//parameter
)
else (//do something else)
)
else (//do something else)
)
else (//do something else)
提前致谢。