tellamugali
Technical User
I am using Crystal Reports 8.5 to query a Pathology Information system written in cache, I am a newbie to Crystal reports and any knowlege I have is either from trial and error or thanks to Tek-Tips.
I am using the below formulae extract data my client wants from a patient episode. I am extracting the result (VISTD_TestData) based on the contents of another field in the table (TestCode_DR). I separated into separate Formula Fields for troubleshooting purposes.
@ProdImpCheck
{EP_VisitTestSetData.VISTD_TestCode_DR} in "B0056"
@Product
If {@ProdImpCheck} THEN (EP_VisitTestSetData.VISTD_TestData}
@ResCheck
{EP_VisitTestSetData.VISTD_TestCode_DR} in "B3500"
@Result
If {@ResCheck} THEN {EP_VisitTestSetData.VISTD_TestData}
@TimeCheck
{EP_VisitTestSetData.VISTD_TestCode_DR} in "B3516"
@HTime
If {@TimeCheck} Then {EP_VisitTestSetData.VISTD_TestData}
@Time
local stringvar tim2txt:=totext({@HTime});
local stringvar tim2num:= if istime(tim2txt) then tim2txt else "";
if tim2num <> "" then ctime(tim2num)
@DateCheck
{EP_VisitTestSetData.VISTD_TestCode_DR} in "B3517"
@Hdate
If {@DateCheck} THEN {EP_VisitTestSetData.VISTD_TestData}
@Date
//Converts date from horlog to date format
local stringvar hor2txt:=totext({@HDate});
local datevar horstart:=date(1840,12,31);
local numbervar hor2num:=if isnumeric(hor2txt) then tonumber(hor2txt) else 0;
if hor2num>0 then horstart+hor2num
I have 3 problems:
1.The results are displayed on separate rows for the group, grouped by Episode
Episode____Time____Date___Product___Result___Comment
Epis1
_____________________________________Res1____Blob or Memo
__________________________Prod1
__________________21/12/2006
__________15:00PM
I have tried the solution posted by synapsevampire as a response to “Repeating Rows” and modifying it for my report.
Group header (used to reset it)
whileprintingrecords;
stringvar test:=””
@test
whileprintingrecords;
stringvar test:
If {@ResCheck} THEN {EP_VisitTestSetData.VISTD_TestData}
Now in the group footer use:
whileprintingrecords;
stringvar test
The problem is that the group footer is displaying that which I define in the group header, I have confirmed this by setting the header formula to stringvar test:= “testing”. @Test in the details area is the same as @Results (as expected), but does not repeat for the whole group, another complication is that all of the formula fields and the Comments field (Blob\Memo) can have multiple results for a group.
2. I am using most of the fields for parameter searches below is the formula thanks to Tek-Tips forums and members, however if I search by ?Time Period the result is only that one field displaying in the group and none of the other information, as opposed to searching by ?HRN or ?Site which are basic {table.fields} and not using an if statement in the formula.
3. If I search by ?Date Period I get an ODBC database error.
Report>Record Formula
{EP_VisitTestSet.VISTS_TestSet_DR} = "B350"and
(
if {?Site} <> "ALL" then
{EP_VisitNumber.EPVIS_VisitNumber} startswith {?Site} else
if {?Site} = "ALL" then
true
) and
(
if {?HRN} <> "ALL" then
{EP_VisitNumber.EPVIS_DebtorNumber_DR} = {?HRN} else
if {?HRN} = "ALL" then
true
) and
(
if minimum({?Date Period}) <> date(9999,09,09) then
{@Date} = {?Date Period} else
if minimum({?Date Period}) = date(9999,09,09) then
true
) and
(
if minimum({?Time Period}) <> time(11,11,11) then
{@Time} = {?Time Period} else
if minimum({?Time Period}) = time(11,11,11) then
true
)
I am using the below formulae extract data my client wants from a patient episode. I am extracting the result (VISTD_TestData) based on the contents of another field in the table (TestCode_DR). I separated into separate Formula Fields for troubleshooting purposes.
@ProdImpCheck
{EP_VisitTestSetData.VISTD_TestCode_DR} in "B0056"
@Product
If {@ProdImpCheck} THEN (EP_VisitTestSetData.VISTD_TestData}
@ResCheck
{EP_VisitTestSetData.VISTD_TestCode_DR} in "B3500"
@Result
If {@ResCheck} THEN {EP_VisitTestSetData.VISTD_TestData}
@TimeCheck
{EP_VisitTestSetData.VISTD_TestCode_DR} in "B3516"
@HTime
If {@TimeCheck} Then {EP_VisitTestSetData.VISTD_TestData}
@Time
local stringvar tim2txt:=totext({@HTime});
local stringvar tim2num:= if istime(tim2txt) then tim2txt else "";
if tim2num <> "" then ctime(tim2num)
@DateCheck
{EP_VisitTestSetData.VISTD_TestCode_DR} in "B3517"
@Hdate
If {@DateCheck} THEN {EP_VisitTestSetData.VISTD_TestData}
@Date
//Converts date from horlog to date format
local stringvar hor2txt:=totext({@HDate});
local datevar horstart:=date(1840,12,31);
local numbervar hor2num:=if isnumeric(hor2txt) then tonumber(hor2txt) else 0;
if hor2num>0 then horstart+hor2num
I have 3 problems:
1.The results are displayed on separate rows for the group, grouped by Episode
Episode____Time____Date___Product___Result___Comment
Epis1
_____________________________________Res1____Blob or Memo
__________________________Prod1
__________________21/12/2006
__________15:00PM
I have tried the solution posted by synapsevampire as a response to “Repeating Rows” and modifying it for my report.
Group header (used to reset it)
whileprintingrecords;
stringvar test:=””
@test
whileprintingrecords;
stringvar test:
If {@ResCheck} THEN {EP_VisitTestSetData.VISTD_TestData}
Now in the group footer use:
whileprintingrecords;
stringvar test
The problem is that the group footer is displaying that which I define in the group header, I have confirmed this by setting the header formula to stringvar test:= “testing”. @Test in the details area is the same as @Results (as expected), but does not repeat for the whole group, another complication is that all of the formula fields and the Comments field (Blob\Memo) can have multiple results for a group.
2. I am using most of the fields for parameter searches below is the formula thanks to Tek-Tips forums and members, however if I search by ?Time Period the result is only that one field displaying in the group and none of the other information, as opposed to searching by ?HRN or ?Site which are basic {table.fields} and not using an if statement in the formula.
3. If I search by ?Date Period I get an ODBC database error.
Report>Record Formula
{EP_VisitTestSet.VISTS_TestSet_DR} = "B350"and
(
if {?Site} <> "ALL" then
{EP_VisitNumber.EPVIS_VisitNumber} startswith {?Site} else
if {?Site} = "ALL" then
true
) and
(
if {?HRN} <> "ALL" then
{EP_VisitNumber.EPVIS_DebtorNumber_DR} = {?HRN} else
if {?HRN} = "ALL" then
true
) and
(
if minimum({?Date Period}) <> date(9999,09,09) then
{@Date} = {?Date Period} else
if minimum({?Date Period}) = date(9999,09,09) then
true
) and
(
if minimum({?Time Period}) <> time(11,11,11) then
{@Time} = {?Time Period} else
if minimum({?Time Period}) = time(11,11,11) then
true
)