Changing font-size in manually filled cross-tab
Hi,
the layout of each report is fixed, but each customer can change the font-size (and the content) of the MemoFields and the (manually filled) cells of the CrossView.
"MemoField.StretchMode = smActualHeight" solves the problem for the MemoFields, but if the font-size of the crosstab is changed (enlarged) the cells need to stretch horizontally, which they only do if this is done in the designer, but not within the Delphi programm frxReportBeforePrint method.
I have played around a bit and did not find any way (except to "show the content" of the cells of the crosstab) to "grab" the cells and change their properties after they have been filled manually (before that ther are no cells, right?).
I have tried to attach methods / functions within the form, but (for similar reasons as above, I guess) no success either.
Is there any way (except opening the designer) to adjust the width of the columns of the crosstab -after the crosstab has been filled manually- to account for the new width of the content of the cells (because of the bigger font-size).
The report has a PageHeader (with two Memos),
a ColumnHeader (holding one Memo),
a ReportSummary (containing a CrossView), and
a PageFooter (with nine MemoFields).
The CrossTab is manually filled with RX.AddValue( [X], [Y], [String] ).
Only frxReportBeforePrint is used, printing is done from the preview.
Versions: Delphi 6 Enterprise and FastReport 4.1.37
Thank you in advance for your help (and thank you for fastreport, by the way)
Matt
the layout of each report is fixed, but each customer can change the font-size (and the content) of the MemoFields and the (manually filled) cells of the CrossView.
"MemoField.StretchMode = smActualHeight" solves the problem for the MemoFields, but if the font-size of the crosstab is changed (enlarged) the cells need to stretch horizontally, which they only do if this is done in the designer, but not within the Delphi programm frxReportBeforePrint method.
I have played around a bit and did not find any way (except to "show the content" of the cells of the crosstab) to "grab" the cells and change their properties after they have been filled manually (before that ther are no cells, right?).
I have tried to attach methods / functions within the form, but (for similar reasons as above, I guess) no success either.
Is there any way (except opening the designer) to adjust the width of the columns of the crosstab -after the crosstab has been filled manually- to account for the new width of the content of the cells (because of the bigger font-size).
The report has a PageHeader (with two Memos),
a ColumnHeader (holding one Memo),
a ReportSummary (containing a CrossView), and
a PageFooter (with nine MemoFields).
The CrossTab is manually filled with RX.AddValue( [X], [Y], [String] ).
Only frxReportBeforePrint is used, printing is done from the preview.
Versions: Delphi 6 Enterprise and FastReport 4.1.37
Thank you in advance for your help (and thank you for fastreport, by the way)
Matt
Comments
you can modify the design properties of the matrix when you first load the report.
from delph ie:
procedure TForm1.Button4Click(Sender: TObject);
var // declare var of correct type
mycross: tfrxcrossview;
cm: tfrxcustommemoview;
begin
frxreport2.LoadFromFile(wpath + '60.fr3');
// find component and cast
mycross :=frxreport2.findobject('cross1')as tfrxcrossview;
// you can now work with the props of the tfrxcrossview
// set variable cm to correct memo and change its font size
cm:= mycross.CellMemos[0];
cm.Font.Size := 18;
frxreport2.ShowReport;
end;
I have played with minwidth/maxwidth actually, but -as you know- it sets all cells to the same width.
But, your second answer is exactly what I have been looking for. The important things -which I overlooked- are:
1. The CrossView needs to be grabbed, not the memo. The memo is the crossviews property.
2. It needs to be TfrxCUSTOMmemoview, not just Tfrxmemoview
Your three lines of code fix my biggest problem, thank you!
matt