Cross View (TfrxCrossView) fonts
Hi
I need to change just the first row of data in a cross view. I'm adding the data to the cross view at ..ReportBeforePrint()
procedure TReportDesignerPreviewForm.FastReportBeforePrint(Sender: TfrxReportComponent);
begin
if Sender is TfrxCrossView then
begin
ExpandCrossView(Sender as TfrxCrossView);
end;
... etc ...
How can I modify the font settings of just some cells in the grid? This should be easy so I'm missing something obvious! HELP [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> ACrossView.CellMemos[0].Font.Size := 20; Sets all items to font size 20. Thanks[/img]
I need to change just the first row of data in a cross view. I'm adding the data to the cross view at ..ReportBeforePrint()
procedure TReportDesignerPreviewForm.FastReportBeforePrint(Sender: TfrxReportComponent);
begin
if Sender is TfrxCrossView then
begin
ExpandCrossView(Sender as TfrxCrossView);
end;
... etc ...
How can I modify the font settings of just some cells in the grid? This should be easy so I'm missing something obvious! HELP [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> ACrossView.CellMemos[0].Font.Size := 20; Sets all items to font size 20. Thanks[/img]
Comments
procedure TForm1.Button4Click(Sender: TObject);
var
mycross: tfrxcrossview;
cm: tfrxcustommemoview;
begin
frxreport2.LoadFromFile(wpath + '60.fr3');
mycross :=frxreport2.findobject('cross1')as tfrxcrossview;
mycross.CellFunctions[0]:= cfsum;
cm:= mycross.CellMemos[0];
cm.Font.Size := 18;
cm.DisplayFormat.Kind := fknumeric;
cm.DisplayFormat.FormatStr :='%2.2m';
frxreport2.ShowReport;
end;
I'm already doing that but when I do it changes the entire table contents to font size 20.
Any ideas?
Thanks
What I need to do is change the formatting (font, bold, style) of some 'cells' in a cross view. For example:
Col 1 | Col 2 | Col 3 |
va1 | val | val |
va1 | val | val |
I want "Col 1", "Col 2" and "Col 3" bold while the rest of the table must be normal. Is this possible?
...and also. If I'm using the before print method of a fast report object, how can I assign my own OnPrintCell to a TfrxCrossView or is this only available in script?
procedure TReportDesignerPreviewForm.FastReportBeforePrint(Sender: TfrxReportComponent);
var
CV : TfrxCrossView;
begin
if Sender is TfrxCrossView then
begin
CV := Sender as TfrxCrossView;
CV.OnPrintCell := ????????
mmmm... another major weakness in FastReport I'm afraid... I think a lot of people are using code to create on the fly reports and running into problems. Oh well
I don't know how many cross views will be on the report as the user can select as many as they want. I need to then modify the cross views in script so that some cells fonts are bold or a different colour. Any code snippets on how to do this?
Thanks...
Is there a way in script that I can iterate through (list) all the controls on the report?
procedure FastReportOnStartReport(Sender: TfrxComponent);
var
i, p, c, m : Integer;
AReport : TfrxReport;
APage : TfrxReportPage;
AMasterData : TfrxMasterData;
ACrossView : TfrxCrossView;
Component : TfrxComponent;
begin
if Sender is TfrxReport then
begin
AReport := TfrxReport(Sender);
for p := 0 to AReport.Objects.Count-1 do
begin
if AReport.Objects[p].ClassName='TfrxReportPage' then
begin
APage := TfrxReportPage(AReport.Objects[p]);
for c := 0 to APage.Objects.Count-1 do
begin
Component := TfrxComponent(APage.Objects[c]);
if Component is TfrxMasterData then
begin
AMasterData := TfrxMasterData(Component);
if AMasterData.Objects[0] is TfrxCrossView then
begin
ACrossView := TfrxCrossView(AMasterData.Objects[0]);
ACrossView.OnPrintCell := CrossOnPrintCell;
end;
end;
end;
end;
end;
end;
end;
procedure CrossOnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
begin
end;
However I get the "Not enough actual parameters" error from the "ACrossView.OnPrintCell := CrossOnPrintCell;" assignement.
So near yet so far