-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I'm retrieving a resultset from a database that fits the Table element fine. I get a table with correct data as is, but I'd like to tweak the table a bit I'd like to : * set table borders * make every other row have green background * have the last row in bold, green or not so I added if Cnt mod 2 = 0 then Row.Background_Color("green"); end if; as seen below. so I have procedure On_Click_Run_Query (Object : in out Gnoga.Gui.Base.Base_Type'Class) is View : Bot_Gui.View.Default_View_Access := Bot_Gui.View.Default_View_Access (Object.Parent); T : Sql.Transaction_Type; Eos : Boolean := True; Betname : String (Bet_Name_Type'range) := (others => ' '); Sumprofit : Float_8 := 0.0; Count : Integer_4 := 0; use Gnoga.Gui.Element.Table; Layout_Table : Table_Access := new Table_Type; Cnt : Integer_4 := 0; begin Layout_Table.Dynamic; Layout_Table.Create (View.Main_View); Layout_Table.Add_Caption("Today's result"); View.Label_Text.Put_Line ("Will run query"); T.Start; Select_Profit.Prepare( "select " & "BETNAME, " & "sum(PROFIT) as SUMPROFIT, " & "count('a') as CNT " & .... Select_Profit.Open_Cursor; loop Select_Profit.Fetch(Eos); exit when Eos; Select_Profit.Get("BETNAME", Betname); Select_Profit.Get("SUMPROFIT", Sumprofit); Select_Profit.Get("CNT", Count); declare Row : Table_Row_Access := new Table_Row_Type; Col1 : Table_Column_Access := new Table_Column_Type; Col2 : Table_Column_Access := new Table_Column_Type; Col3 : Table_Column_Access := new Table_Column_Type; begin Cnt := Cnt +1; Row.Dynamic; Col1.Dynamic; Col2.Dynamic; if Cnt mod 2 = 0 then Row.Background_Color("green"); end if; Row.Create (Layout_Table.all); Col1.Create (Row.all, Utils.Trim(Betname)); Col2.Create (Row.all, Utils.F8_Image(Sumprofit)); Col3.Create (Row.all, Count'Img); end; end loop; Select_Profit.Close_Cursor; Dispatch Error GNOGA.GUI.BASE.OBJECT_WAS_NOT_CREATED - gnoga-gui-base.adb:2094 [./bot_gui] 0x00000000006CC763 gnoga.gui.base.jquery at gnoga-gui-base.adb:2094 0x00000000006CCBE1 gnoga.gui.base.jquery_execute at gnoga-gui-base.adb:2107 0x0000000000685905 gnoga.gui.element.style at gnoga-gui-element.adb:142 0x000000000068CBFE gnoga.gui.element.background_color at gnoga-gui-element.adb:1131 0x00000000005C1B24 bot_gui.controller.on_click_run_query at bot_gui-controller.adb:112 0x00000000006C7B3F gnoga.gui.base.fire_on_click at gnoga-gui-base.adb:939 0x00000000006CAA46 gnoga.gui.base.on_message at gnoga-gui-base.adb:1870 0x000000000063B0C5 gnoga.server.connection.dispatch_task_typeT at gnoga-server-connection.adb:933 0x00000000008B92D7 at ??? [/lib/x86_64-linux-gnu/libpthread.so.0] [/lib/x86_64-linux-gnu/libc.so.6] [./bot_gui] Obviously, I'm doing something wrong here ... How to use method Background ? - -- Björn -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUcNUBAAoJEGaQZvZiZLyCtJoH/3gVbFFB2So2sgU8OtHAMN/T OGlnZRPy2lpYPCP/+jkL9zGZrltKihHA6CSXDR+8iksoupW7NBuK3GbCF1DMhuT/ qFN+Bugd0bMauL+bVQichxuuQC/ZZnWn8drzqMSvp9NVs6tttaCzxlXeBhoDDQnR BLxTrIdHZdDA7ERUFHQJGJx7j+CxEWgZ+6RIfwVcZAxQt+B+slA6SOjqNfQqsneT fRMbv920uRVHAe2KXmNHNfibu5ftL8qSYm5KRjx7HqdWBYPEpcBhC6cP4UGbI04s RG1pxg8KSRotO2ewxFLsZw+68TcVo07K6j9Qld2OUFuFwHu8pz1MYIXqAPyFTXo= =lxvj -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list