dynamic reports

edited June 2013 in FastReport 4.0
is there a way to optionally hide columns and automatically format the report if certain columns are hidden?

ex.

fields:
field1, field2, field3, field4

FR output:
column1, column2,column3, column4

FR output if field3 has no value (assuming all field3 are empty in table):
colum1,column2,column4

Comments

  • ksihotaksihota Victoria, BC Canada
    edited 3:45PM
    Not sure if you solved this or if you are looking for something different but just in case, have you tried using the OBP of the memo field?
    You should be able to control display of the field and even change the positions of other objects based on the data the field holds.

    here is an example of one of mine that controls the display of the field based on the info:

    procedure MyDataSetMarksOnBeforePrint(Sender: TfrxComponent);
    begin
    MyDataSetMarks.Font.Style:=fsbold;
    MyDataSetMarks.Font.Color:=clBlack;
    if ValidInt(<MyDataSet."Mark">) then
    begin
    MyDataSetMarks.Color:=clNavy;
    MyDataSetMarks.Font.Color:=clWhite;
    end
    else
    begin
    if <MyDataSet."Mark"> = 'A' then MyDataSetMarks.Color:=clYellow;
    if <MyDataSet."Mark"> = 'B' then MyDataSetMarks.Color:=clLime;
    if <MyDataSet."Mark"> = 'C+' then MyDataSetMarks.Color:=clAqua;
    if <MyDataSet."Mark"> = 'C' then MyDataSetMarks.Color:=clFuchsia;
    if <MyDataSet."Mark"> = 'C-' then MyDataSetMarks.Color:=clRed;
    if <MyDataSet."Mark"> = 'I' then
    begin
    MyDataSetMarks.Font.Color:=clYellow;
    MyDataSetMarks.Color:=clRed;
    end;
    if <MyDataSet."Mark"> = 'F' then
    begin
    MyDataSetMarks.Color:=clRed;
    MyDataSetMarks.Font.Color:=clWhite;
    end;
    if <MyDataSet."Mark"> = '' then MyDataSetMarks.Color:=clNone;
    end;

    end;

    Kim
    avatar wrote: »
    is there a way to optionally hide columns and automatically format the report if certain columns are hidden?

    ex.

    fields:
    field1, field2, field3, field4

    FR output:
    column1, column2,column3, column4

    FR output if field3 has no value (assuming all field3 are empty in table):
    colum1,column2,column4

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.