DBCrossRow1 Colour Alternate Rows

How i colour alternate rows in DBCrossRow1?

72310c1d97da43f682f78e355626b699.png

Comments

  • edited 12:52AM
    Good morning wcardosomg,

    could u explain ur Problem more exactly? U want to Color 2 Rows alternately?

    Row1
    Row2
    Row3
    Row4
    Row5
    Row6
    Row7
    Row8

    ?

    Greetz
  • edited December 2016
    Good morning wcardosomg,

    could u explain ur Problem more exactly? U want to Color 2 Rows alternately?

    Row1
    Row2
    Row3
    Row4
    Row5
    Row6
    Row7
    Row8

    ?

    Greetz

    Good morning Slashmaster, i want to color the background of the first column alternately too, same of the others

    i try set this condition property
    <RowIndex> mod 2 = 1
    

    inside the Highlight property, but dont works.

    thanks for help
  • edited 12:52AM
    Hi,

    u could try something like this:
    var z : boolean;  
      
    procedure DBCross2Row1OnBeforePrint(Sender: TfrxComponent);
    begin
      z := not z;  
      if z then tfrxmemoview(sender).color := clred                                                                            
    end;
    
    begin
    
    end.
    
  • edited 12:52AM
    Hi,

    u could try something like this:
    var z : boolean;  
      
    procedure DBCross2Row1OnBeforePrint(Sender: TfrxComponent);
    begin
      z := not z;  
      if z then tfrxmemoview(sender).color := clred                                                                            
    end;
    
    begin
    
    end.
    

    Hello,

    i try this, but the report colour all collumn cell

    ec594945b9ee41b4b85d5409a41f1dd0.png
  • edited 12:52AM

    var z : boolean; Needs to stand on the top (over the other procedurs)

    U declare a global Variable.
  • edited 12:52AM
    var z : boolean; Needs to stand on the top (over the other procedurs)

    U declare a global Variable.

    >  Dont works too, see138958d299c14907b14491df083238d9.png
  • edited 12:52AM
    if z then tfrxmemoview(sender).color := clred  
          else tfrxmemoview(sender).color := clWhite
    
  • edited December 2016
    pele wrote: »
    if z then tfrxmemoview(sender).color := clred  
          else tfrxmemoview(sender).color := clWhite
    

    tks pele and SlashMaster, work's fine
    z := not z;     
    if z then tfrxmemoview(sender).color := clred  
          else tfrxmemoview(sender).color := clWhite
    
  • edited 12:52AM
    i think the Event calls to often in dependence of columns...

    workarround maybe:
    var ColCount : integer;
      
    procedure DBCross2Row1OnBeforePrint(Sender: TfrxComponent);
    begin
      colCount := colCount + 1;
      if colcount = 4 then begin // play with the 4 as how many columns u have                                                                                                          
           tfrxmemoview(sender).color := clred;
           colcount := 0;
       end                                             
    end;
    
    begin
    
    end.
    
  • edited December 2016
    Oh no!, works fine only on first page of report....

    See the second page..

    cb5cb4330b4d4b73b37cee62428b79c9.png
  • edited 12:52AM
    :lol:" border="0" alt="laugh.gif" />" alt=">" />:lol:" border="0" alt="laugh.gif" />" alt=">" />:lol:" border="0" alt="laugh.gif" />" alt=">" />:lol:" border="0" alt="laugh.gif" />" alt=">" />[img]style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /> is this the same dbcross???[/img]
  • edited 12:52AM
    :lol:" border="0" alt="laugh.gif" />" alt=">" />:lol:" border="0" alt="laugh.gif" />" alt=">" />:lol:" border="0" alt="laugh.gif" />" alt=">" />:lol:" border="0" alt="laugh.gif" />" alt=">" />[img]style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /> is this the same dbcross???[/img]

    Yes
  • edited 12:52AM
    well.. why it starts with Number 1 at the new page?
    NCG is White and receita is Grey --> seems correct?
  • edited 12:52AM
    well.. why it starts with Number 1 at the new page?
    NCG is White and receita is Grey --> seems correct?

    Correct, in another collumns i use the condition
    <RowIndex> mod 2 = 1
    

    in highligth condition
  • edited 12:52AM
    hmm. u could try to add an Pageheader. In the pageheader onbeforeprint u set Z = False (or true, just try)
  • edited December 2016
    I Solved this whith code
    procedure DBCross1Row1OnBeforePrint(Sender: TfrxComponent);
        
    begin
                                                                            
    
    if Trim(TfrxMemoView(Sender).Text) = 'RECEITA BRUTA DE VENDAS' then //name of my first row of column
    begin
    z:=TRUE;                                 
    end;
    
    z := not z;
      
    if z then
    begin            
    z:=true;                
    tfrxmemoview(sender).color := clbtnface;
    end else
    begin
    z:=false;                  
    tfrxmemoview(sender).color := clWhite;
    end;
    

    How i find the number of the current row number of dbcross?

    type

    if DBCross1Row1.RowNumber = 1 then //dont works

    to replace
    if Trim(TfrxMemoView(Sender).Text) = 'RECEITA BRUTA DE VENDAS' then
    
  • edited 12:52AM
    Good Morning,

    i dont work with the dbcross. It seems a bit hard to handle.

    I tried this, too
    dbcross2.DataSet.RecNo
    
    but no success.. [img]style_emoticons/<#EMO_DIR#>/huh.gif" style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /> I would manage the Report with "normal" Bands[/img][img]style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> Maybe some1else got a good idea.. i am interested in this Problem and ill still try to solve it.[/img]>
  • gordkgordk St.Catherines On. Canada.
    edited 12:52AM
    look at the main demo fcrosstab reports aly row colors
    use row index prop for rows columnindex prop for columns

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.