Wenin
March 15th, 2008, 10:31 AM
I don't know if this is possible within Crystal, but this is what I'm needing to do.
I want to obtain the data from the first record (or any record would do actually), to set a global variable.
StringVar FirstPlan;
if instr({SampleData.UC_Information_Unit_Container_ID_LKUP},':') > 0 then
FirstPlan = Left({SampleData.UC_Information_Unit_Container_ID_LKUP},
instr({SampleData.UC_Information_Unit_Container_ID_LKUP},':') - 1)
else
FirstPlan = {SampleData.UC_Information_Unit_Container_ID_LKUP};
I place the above formula field in the Report Header, suppressed
I want to sort by the results from this formula, and the global variable would be used in this formula.
if {SampleData.UC_Information_UC_Information_Type_ID_LKUP} = 'Definitions' then
FirstPlan + '03' + {SampleData.UC_Information_UC_Information_Type_ID_LKUP}
else
{SampleData.UC_Information_Unit_Container_ID_LKUP} +
if Length(ToText({SampleData.UC_Information_Sequence},0)) = 1 then
'0' + ToText({SampleData.UC_Information_Sequence},0)
else
ToText({SampleData.UC_Information_Sequence},0) +
{SampleData.UC_Information_UC_Information_Type_ID_LKUP}
Problem - FirstPlan isn't recognized as a declared variable.
Crystal Report identifies "FirstPlan" and states
"A number, currency amount, boolean, date, time, date-time, or string is expected here."
I want to obtain the data from the first record (or any record would do actually), to set a global variable.
StringVar FirstPlan;
if instr({SampleData.UC_Information_Unit_Container_ID_LKUP},':') > 0 then
FirstPlan = Left({SampleData.UC_Information_Unit_Container_ID_LKUP},
instr({SampleData.UC_Information_Unit_Container_ID_LKUP},':') - 1)
else
FirstPlan = {SampleData.UC_Information_Unit_Container_ID_LKUP};
I place the above formula field in the Report Header, suppressed
I want to sort by the results from this formula, and the global variable would be used in this formula.
if {SampleData.UC_Information_UC_Information_Type_ID_LKUP} = 'Definitions' then
FirstPlan + '03' + {SampleData.UC_Information_UC_Information_Type_ID_LKUP}
else
{SampleData.UC_Information_Unit_Container_ID_LKUP} +
if Length(ToText({SampleData.UC_Information_Sequence},0)) = 1 then
'0' + ToText({SampleData.UC_Information_Sequence},0)
else
ToText({SampleData.UC_Information_Sequence},0) +
{SampleData.UC_Information_UC_Information_Type_ID_LKUP}
Problem - FirstPlan isn't recognized as a declared variable.
Crystal Report identifies "FirstPlan" and states
"A number, currency amount, boolean, date, time, date-time, or string is expected here."