DB-Cross - How to change text print in a cell
Hi!
I don't know if it is possible, but I would like to change the memo text and color in a cell under specific condition.
In few words I have a cross table where the cells contain a string data. I would like to "reduce" the width of the cells showing only a single letter of this string (I don't want to change the database's value, but only what is print).
To change the color I used this procedure:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer;
RowValues, ColumnValues, Value: String);
begin
if Value = '1-Low' then
Memo.Color := clGreen;
if Value = '2-Middle' then
Memo.Color := clYellow;
if Value = '3-High' then
Memo.Color := clRed;
end;<!--fontc--></span><!--/fontc-->
and it works great.
To change the text visualized I don't know what to do.
In another report where I used a simple memo, I used this function:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->Copy(<myvariable>,3,1)<!--fontc--></span><!--/fontc-->
and it works.
But in the case of a DBCross's cell I can't use this solution.
Anyone know what to do?
Sorry for my english.
Thanks
I don't know if it is possible, but I would like to change the memo text and color in a cell under specific condition.
In few words I have a cross table where the cells contain a string data. I would like to "reduce" the width of the cells showing only a single letter of this string (I don't want to change the database's value, but only what is print).
To change the color I used this procedure:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer;
RowValues, ColumnValues, Value: String);
begin
if Value = '1-Low' then
Memo.Color := clGreen;
if Value = '2-Middle' then
Memo.Color := clYellow;
if Value = '3-High' then
Memo.Color := clRed;
end;<!--fontc--></span><!--/fontc-->
and it works great.
To change the text visualized I don't know what to do.
In another report where I used a simple memo, I used this function:
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->Copy(<myvariable>,3,1)<!--fontc--></span><!--/fontc-->
and it works.
But in the case of a DBCross's cell I can't use this solution.
Anyone know what to do?
Sorry for my english.
Thanks
Comments