Report row color change based on condition
I have follow this forum steps Re: Color Row In Report
Column Template 1
<td #ALIGNMENT# class="t1data" style="background-color:#ADD8E6;">#COLUMN_VALUE#</td>
PL/SQL expression condition
'#2#' = 'BOOKED'
Column Template 2
<td #ALIGNMENT# class="t2data" style="background-color:#FFE87C;">#COLUMN_VALUE#</td>
PL/SQL expression condition
'#2#' = 'ENTERED'
http://img29.imageshack.us/img29/2792/apexcolor.png
This does color change but for some rows the colors are highlighted wrong and when i mouse over the rows , it changes to wrong color.
Hi,
t1Data and t2Data sound like standard theme css class names.
In my example, the colouring is done by the style attribute on the TD tag. For "normal" rows:
<td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data">#COLUMN_VALUE#</td>for highlighted rows:
<td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data" style="background-color:red;">#COLUMN_VALUE#</td>Have you defined "t1Data" and "t2Data" in STYLE tags on your page?
Andy
Similar Messages
-
JTable row background change - based on EXTERNAL event
Greetings folks!
I'm hoping for some help with a JTable issue. Here's the scenario:
The app is a point of sale application. The user scans or manually adds an item to the order, which causes a row to appear in the JTable displaying description, price, quantity, etc. The user can then right click a row on the JTable and select an option from the popup menu. If the user selects one of the options, I want to be able to change the background color on that row.
EVERYTHING I've seen online and researching is based on adding a custom renderer to the jtable which changes the background based on the data in the row. In my case there isn't anything in the row which changes... hence the point of changing the color.
What I'm looking for is a method which will let me change the background of row x. I'm guessing there isn't a way. I'm hoping someone has a suggestion.
Thanks in advance,
John E.
PS: I'm fairly new to java and working with inherited code, so please no 'you need to redesign the world' type answers unless there's an easier way. :)In my case there isn't anything in the row which changesThen how is the table going to know what color to paint the row? Remember painting the row is a dynamic process. You can't just paint it once. You need the ability to repaint the row if for example the table is scrolled and the row is now longer present. Then when the table scrolls again and the row is present you need to be able to repaint the row in your specified color. This means you need some way to tell the table what color the row should be. Which means you need to keep that information somewhere.
One way to do this is to store the data in the TableModel that indicates that this row should be painted a "different" color. Then your situation is like the examples you have found. You now have some data you can test. This column does not need to be visible in the table since you can remove the TableColumn from the TableColumnModel so the column is not painted.
Here is a simple posting that shows a better approach to painting row backgrounds withouth using a renderer:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=610474 -
Crystal report 8.5/ changing the format conditionally
Post Author: Amsa
CA Forum: Crystal Reports
Using Cyrstal Report 8.5 I have a letter on the crystal report which get populated from the sql database by the sql procedure..That letter includes the Name and the full address. And if the customer has the apt number it prints that as well.So this is how it goes. Amin Shah91 09 Tample AveApt # 31Elmont NY, 11373 so each line there is accociated with the field from the stored procedure. But what happens is that when the customer doesnt have the Apt # that line prints empty and there comes a blank line. So for that I have to shift that TownState row up. I don't know how to do this. If anyone can help please.Thanks.Post Author: rroberson
CA Forum: Crystal Reports
split up the section the address is in so that Apt # 31 is in its own section (can all still be in details or a single group -- you just break it apart using "insert section below" or by splitting the section with your mouse). Lines below show breaking of sections. __________ Amin Shah91 09 Tample Ave ____________ Apt # 31_____________Elmont NY, 11373_______________ Then choose "suppress blank section" for the Apt #31 section. If you have anything in the section besides database fields you will need to conditionally suppress those as well so that the section really is blank (and therefore will be suppressed by the 'suppress blank section'). -
Hi,
I read somewhere a while ago and I don't remember if it was in JSF using datatables but is a property that will allow me to display a table change the background color for each row for example row 1 will be of gray row 2 on white in another words the even row will be white the odd row will be gray
ThanksJSF<h:dataTable rowClasses="row1, row2" />CSS.row1 {
background-color: #bbb;
.row2 {
background-color: #ddd;
} -
Table Row Color change on Edit.
Hi,
I have a editable table with two columns (one is inputtextbox and other is an LOV). On click of edit button, table will allow user to change the data.
My requirement is, when ever user edits the data, I need to change the column content color.
I tried to set the color on valuechangelistener of each component but failed.
Please let me know whether it is possible to achieve.
Thanks.Any help...
-
Report row highlight based on a page item
Is there a way to highlight a report row based on the value of a page item?
In my case I have a report where the application user requests data in a detail report using a column link in the master report. This loads an id number from my report into a page item (say :P8_ID for example). If this item is null, I want the report rows to all render normally (nothing is selected or the detail report has been closed). If there is an id in that field then I want the row containing the information about that item to highlight (its column link has been clicked selected it to bring up a detail report).
At first glance, this looks similar to Vikas solution (Change the Report row color when clicked but I am trying to make the connection between what has already been done and where I need to be.After looking back, I discovered my value was being set after the report rendered. When I re-organized my calculations and the rest, it worked.
-
Report template auto-changed to Default: HTML
I use the builtin report template "Default: Look 4" for all of my report screens and have a problem when importing the application with a new Application ID.
All reports that use the "Default: Look 4" template get changed to "Default HTML" in the new application and I have to manually change them all back again. This is a real pain because I use the application ID as a form of version control - the old versions of the application are auto-forwarded to the new one - so I end up having to do the change quite often.
Is there a way I can prevent the template from changing?If it's any help to you, I did a bit of 'vanilla' testing ...
- create a new workspace TEST
- Edit Page 1 of the Sample Application
- Note that the region "My Top Orders" is using layout "template: 12. Standard, Alternating Row Colors"
- export the Sample Application
- import the Sample App with Auto-Assign New App ID selected
- Edit Page 1 in the new application and note that the region template for "My Top Orders" is still set to "template: 12. Standard, Alternating Row Colors"
- Change the template for "My Top Orders" to "default: Look 4"
- Export application
- Import application with auto-assigned AppID
- Edit "My Top Orders" and note that template is changed to "default: HTML (standard)"
The template is only changed when the exported application uses one of the "default: Look X" templates, other templates are not changed. Also, importing into the same or different application makes no difference, the template is still changed.
Thanks for your quick reply so far Scott! -
Class Changing Based on Spry:if Complex Dates
I know this can be done in concept, because I've done it
before, I just don't know how to approach in Spry.
I have a dynamic table that shows is sorted by date. I am
trying to have the class of each row dynamically change based on
the difference in days between the date and today.
For instance:
If the date is more than 10 in the past, the rows style is
"redFlag"
If the date is more than 6 days but less than 10, the rows
style is "YellowFlag"
I can do this in PHP, but how would i do this using spry?
ThanksI have found what I was looking to do.
http://labs.adobe.com/technologies/spry/samples/data_region/Function_colon.html
This allows the externalization of logic - EXACTLY what I
need. This is a huge breakthrough for me, as this will help
tremendously -
Color change in webdynpro abap
Hi every one
I want horizontal bar whose color changes according to condition applied.For this I had searched on sdn.For this I found value comparision UI element .To set it values for different colors I found class CL_WD_GRAPHICAL_VALUE_CMP and method of it SET_COLOR_ABOVE_THRESHOLD,SET_COLOR_BELOW_THRESHOLD andSET_COLOR_BETWEEN_THRESHOLDS,but i dont know how to use to in my application.Can anyone Pls let code for using thisclass?
Thanks and regards
Edited by: prashant sharma on Apr 3, 2009 8:13 AM
Edited by: prashant sharma on Apr 3, 2009 8:29 AMhi,
Refer this doc.
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
With this document , you will be able to change color of particular Cell.
I hope you are refering to Cell as a Horizontal bar.
Thanx. -
ALV rows coloring based on condition
Hai ,
I want Color the rows in the list based on some condition ..
Hope to get the helpful suggestion s on this asap
regards,Hi shishupalreddy,
1. Not only the full row color,
we can also manipulate the color in each cell,
based upon conditions.
2.
IMPORTANT THINGS
a. Extra field in internal table
clr TYPE slis_t_specialcol_alv,
(this field will contain the colour codes)
b. assign fieldname to alv layout
alvly-coltab_fieldname = 'CLR'
c. work area for colour
DATA : clrwa TYPE slis_specialcol_alv.
d. Populating the color
Once again
Loop at ITAB.
*********logic
if itab-field < 0 "---negative
clrwa-fieldname = 'FIELDNAME'. "<--- FIELDNAME FOR COLOR
clrwa-color-col = 6. <------- COLOUR 0-9
APPEND clrwa TO itab-clr.
MODIFY ITAB.
endif.
ENDLOOP.
5. just copy paste in new program
6.
REPORT abc .
NECESSARY / MUST
TYPE-POOLS : slis.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : alvly TYPE slis_layout_alv.
ITAB DECLARATION
DATA : prg TYPE sy-repid.
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE t001.
DATA : clname(3) TYPE c,
clr TYPE slis_t_specialcol_alv,
END OF itab.
DATA : clrwa TYPE slis_specialcol_alv.
PARAMETERS : a TYPE c.
DATA : flname TYPE slis_fieldname.
SELECT
START-OF-SELECTION.
SELECT * FROM t001
INTO CORRESPONDING FIELDS OF TABLE itab..
LOOP AT itab..
IF SY-TABIX <= 5.
itab-clname = 'C50'.
ELSE.
itab-clname = 'C30'.
ENDIF.
MODIFY itab.
ENDLOOP.
LOOP AT ITAB.
check itab-bukrs = '1000'
clrwa-fieldname = 'BUTXT'.
clrwa-color-col = 6.
APPEND clrwa TO itab-clr.
MODIFY ITAB.
clrwa-fieldname = 'LAND1'.
clrwa-color-col = 4.
APPEND clrwa TO itab-clr.
MODIFY ITAB.
ENDLOOP.
prg = sy-repid.
flname = 'CLNAME'.
alvly-info_fieldname = 'CLNAME'.
alvly-coltab_fieldname = 'CLR'.
LOOP AT ITAB.
if sy-tabix = 3.
clrwa-fieldname = 'BUTXT'.
clrwa-color-col = 6.
APPEND clrwa TO itab-clr.
MODIFY ITAB.
clrwa-fieldname = 'LAND1'.
clrwa-color-col = 1.
APPEND clrwa TO itab-clr.
MODIFY ITAB.
endif.
ENDLOOP
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = prg
i_internal_tabname = 'ITAB'
i_inclname = prg
CHANGING
ct_fieldcat = alvfc
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
minimum
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2
extra
sy-uname = 'XYZAB'.
prg = sy-repid.
Excluding
DATA : excl TYPE slis_t_extab.
DATA : exclwa TYPE slis_extab.
exclwa = '&OUP'.
APPEND exclwa TO excl.
exclwa = '&ODN'.
APPEND exclwa TO excl.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
it_fieldcat = alvfc
i_callback_program = sy-repid
is_layout = alvly
i_callback_user_command = 'ITAB_USER_COMMAND'
it_excluding =
excl
i_save = 'A'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
*& Form itab_user_command
text
-->WHATCOMM text
-->WHATROW text
FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
BREAK-POINT.
ENDFORM. "itab_user_command
regards,
amit m. -
Having trouble with report total row with expression based condition
Hi,
I have a simple SQL region that has 2 columns (country and pnl). I then had a request to display negative PNL in red. To do this I copied the Standard Alternating Row Colors report Template and changed the condition so that it uses one class (named "t16data") with a PL/SQL Expression condition NVL(#PNL#,0)<0
Then, in the referencing page HTML header I added :
<style>td.t16data{color:red} </style>
For normal data rows it works fine. However, I also have a sum on PNL and the total row always shows red (even when it's a positive number).
Any idea? Do I need to provide more information?
ThanksMy question about this is the other Dynamic VPN that is working has no static route.
I added:
route outside 10.10.10.0 255.255.255.248 xxx.xxx.xxx.xxx (where xxx.xxx.xxx.xxx is the IP of the non working remote IKE Peer)
This had no effect.
Looking at the two tunnels. The working tunnel is using IKE IPSEC and the nonworking tunnel is using IKE IPsecOverNatT. What have I entered that tells the VPN to use IPsecOverNatT? -
Report rows persistent color change
Greetings all,
I created a report and setup conditions so that rows will be either RED for Overdue, Yellow for within a week of being overdue and Green for all good. What is happening is when I run the report it shows the colors perfectly. If I run my mouse over them rows they change back to grey and I have to refresh the page to get them to show up again. Is there a way to make the colors persistent? So when the report is run and a row is red, it stays red and does not change again until the page is required and the criteria changes.
Thanks in advance. I don't have it on apex.oracle.com but if necessary I can put a mock up on the site.
thanks
WallyIf I run my mouse over them rows they change back to grey and I have to refresh the page to get them to show up again. Is there a way to make the colors persistent? This is due to row highlighting settings in the report template. To eliminate this:
<li>Create a copy of the report template used for the report
<li>Remove the <tt>#HIGHLIGHT_ROW#</tt> substitution string from the Before Each Row template
<li>Delete the Background color for checked/current row values from the Row Highlighting template
<li>Set the report to use the copied report template -
Change the row colors based on column values in MOSS 2007.
Hi Team,
I am using MOSS 2007 environment. In that I am having one SharePoint list. In that list based on column values rows colors need to change.
Kindly help me anyone on this.
Thanks,
AshokHi Ashok,
Please follow the below link:
http://www.contentmaster.com/sharepoint-2010/conditional-formatting-of-list-views-for-sharepoint-2010-changing-the-font-colour/
http://sharepoint.stackexchange.com/questions/7478/highlight-row-color-based-on-field-values-in-sharepoint-2010-list-view
Best Regards,
Brij K -
Color report rows based on a value in that row
I would like to Color report rows based on a value in that row.
For examplle with the "EMP" table:
I would like job=MANAGER to be red and job=CLERK to be green etc etc
The other example I found only had the option of one color either the highlight or the default color.
I am looking for a way to do multiple colors.Hi,
In the row template, you can use #1#, #2#, etc to indicate where a field in the report needs to be output. This does not have to be plain text - ie, you can use it within style tags if you like.
So, take a query like:
SELECT EMPNO,
ENAME,
DEPTNO,
DECODE(DEPTNO, 10, 'green', 20, 'red', 30, 'cyan', 'white') BG_COLOUR
FROM EMPYou get columns 1=empno, 2=ename, 3=deptno and 4=bg_colour. In the row template, you can then do:
Before Rows setting (sets up the table):
<table>
<tr><td>ID</td><td>Name</td><td>Dept</td></tr>After Rows setting (closes the table):
</table>Row Template 1 (used for ALL rows):
<tr style="background-color:#4#;"><td>#1#</td><td>#2#</td><td>#3#</td></tr>Then, for every row, the colour that has been calculated using the DECODE function will be used in the style tag to colour the background for the entire row.
How you determine the colours is up to you. I've used DECODE here, but you could use a field on the DEPT table to hold this and use this in your SQL statement.
Andy -
Hi all
I have a nextensio list on a page.
is there a way to change the background color of a whore row based on
a specific field content?
example I have a field containing the values 0 or 1.
If the field content is 1 the row background color should be RED.
ANy suggestion?
TIA in advance.
tonyDataBoundAPI's you can refer to achieve this.
Search for OLD threads also. Here are some links:
Can we colour the rows in the column of a table
Advanced table row font color- result based change.
Thanks
--Anil
http://oracleanil.blogspot.com/
Maybe you are looking for
-
Problem with communication channel on receiver side with file adapter
Hi all, I m doing a scenario of collection of multiple idocs into a file.When i m testing this scenario,i m getting a flag successfully executed in SXMB_MONI.But,my file isn't created in my directory.When i monitor the communication channel in Runtim
-
hi, I am working on the GUI. There are four buttons. I wanted the button's width to be just enough to show the text inside the button and not "...." or bigger than required. How should I edit my code, which is shown below? Thanks in advance regards *
-
S12 Nano locks up and ignores mouse/keyboard
I'm experiencing frequent lockups, where the system ignores mouse clicks and keyboard input. The mouse (external usb or trackpad) will continue to move, but clicks and taps are ignored. The windows key still works, and the system responds to ctrl-a
-
Help needed to a no doubt simple problem
-
How can I erase my hard drive?
I just sold my computer. How can I erase the hard drive? Thanks1