Change colors of columns on horizonal axis
Hello,I don't work with Excel a lot, usually when I get a request for something a couple times a year.Anything is possible, right? I've automated the creation of a pivot table and then the addition of the pivot chart. The problem I have is, I can't figure out how to change the column colors on the horizontal axis. Simple I know... I've been playing with properties in Excel to see where I'm missing code, but I can't make it work manually.Excel.Shape myChart = detailWS.Shapes.AddChart();
closl
This is the full method. First a chart is created that contains all the series.Then, then a new worksheet is created and the chart on the new worksheet contains only one of the series from the original chart. That is what the picture above displays.My question would be, are there layers of "series"? I tried to do in c# what you did above, but had a problem figuring it out.Excel.Range srcrange = ws.UsedRange;
srcrange.Copy(Type.Missing);
//opening of the second worksheet and pasting
Excel.Range destrange = newSheet.Cells[1, 1];
destrange.Select();
newSheet.Paste(Type.Missing, Type.Missing);
Excel.Shape myChart = newSheet.Shapes.AddChart();
Excel.SeriesCollection seriesCollection = myChart.Chart.SeriesCollection();
int index = 1;
myChart.Chart.SetSourceData(newSheet.UsedRange, Type.Missing);
myChart.Select();
myChart.Height = 450;
myChart.Width = 1500;
//myChart.Name = sheetNumber.ToString();
Excel.Series chartCategory = null;
while(seriesCollection.Count > 1)
chartCategory = seriesCollection.Item(index);
if (chartCategory.Name.Contains(name))
chartCategory.IsFiltered = false;
index = 2;
else
chartCategory.IsFiltered = true;
if (chartCategory != null) Marshal.ReleaseComObject(chartCategory);
closl
Similar Messages
-
How to change color of column in advanced table
Hi Guys
I need to change the color of column in advanced table.
Please help me .
Thanks
SubramanianHi
Can you please give the sample code for this
I created advancedtable
under this advancedtable , I created columngroup
under this columngroup
I created column1 and column2
Here I need change the color for entire column1.
Thanks
Subra -
Changing color of columns in CL_GUI_CHART_ENGINE
Dear Developers,
I am displaying a Columns Graph using class CL_GUI_CHART_ENGINE. My requirement is to change color of selected columns based on their height. For example if height of the column exceepds 10, then the color of that particular color is to be made red. Is that possible using CL_GUI_CHART_ENGINE ??
Thanks and Regards,
kartikHi,
Refer below link:
https://forums.sdn.sap.com/click.jspa?searchID=3958197&messageID=2474585
<b>Reward points</b>
Regards -
How to change colors of columns in a chart view
Hi experts,
I've a chart view which chart type is column. I have put 3 data series and I want to change the colors of them.
By default, the 3 columns are displayed in blue, green and yellow and I wish put them in green, orange, and red. Is it possible?
I've tried to change the color scheme but I have only 3 propositions (Straight, Reverse and Snake) that not correspond to my wish.
Any idea?
Thanks for help
RonanHi Kiran,
no its not possible through Theme editor also ,because these colors are coming from Compiler which u are using.
Regards,
Govindu -
Change color of column background when entire column meets a condition
I'm trying to create a report that visually indicates staffing coverage during certain hours. The report has the hours of the day as column headers, and for each person-row, a column can contain a 0 if that person is not scheduled for that hour, a 1 if one person is scheduled for that hour, or 2 if 2 people are scheduled for that hour, etc.<p>
What I need is to show gaps in coverage, so I need to color red those columns where there are 0's for all rows in that particular column.<p>
thanks!Couldn't you do this in the report SQL itself<BR><BR>The problem I see with this is that based on what she's asking (i.e. all rows in that column must be zero), you will not know if a column should be marked in red until after all of the rows have been retrieved and displayed. To do what you suggest, you'd have to run the report once to find columns that sum to zero, i.e.:<BR><BR>
SELECT SUM(col1), sum(col2)...<BR>
INTO v_sum_col1, v_sum_col2...<BR><BR>
Then for any column with a sum of zero -- add in the code you suggest into the second SELECT to return the data, possibly with a DECODE twist:
DECODE(v_sum_col1, 0, '<span style="background-color:pink">0</span>', col1) -
Change color of measures - Column Combination Dual Axis
Hi,
I have a couple of graphs of the type Column Combination Dual Axis.
I want to change the colors for these measures but that does not seem to be possible when using this type of chart?
I can only change the color of the Axis?
First, I thought it was something wrong with my chart so I tried to create a new application with this chart type and got the same result.
Does anyone know if it should be like this?
Br
MaxHi Max,
how many measures do you want to use for the Chart type "Column Combination Dual Axis"?
Do you have tried to swap the axis in your chart type setting?
In my case it works as expected and I´m able to change the color of the measures ( = the axis)
I think it´s important to add the measures in the rows at the initial view of the data source (or you can change it by swap the axis in the chart).
Hope it helps!
Best regards,
Michael -
Background color change of a column in Advance table
Hi,
We have requirement to change the background color of column in advance table based on some condition. We tried putting code to change background color in Custom.xss using background-color property and setting newly created css dynamically based on condition but it seems it only changes the background color of text not the complete cell. We want to change the color of complete cell in an advance table.
Please let me know if there is any other way I can achieve this requirement. Any help would be highly appreciated.
Thanks<FONT FACE="Arial" size=2 color="2D0000">
Pls look into "Alter Table"section.
LOB_storage_clause
This might help
-SK
</FONT> -
How to change colors of individual column bar in the same data series
in mac numbers, how to change colors of individual column bar in the same data series. The entire column series gets selected in the column bars and cannot select to change colors of specifc bars.
Hi Kiran,
no its not possible through Theme editor also ,because these colors are coming from Compiler which u are using.
Regards,
Govindu -
how do change color of a column in ALV.
Hi
The below abap program shows how to change the colour of individual ALV cells /fields. Only a small number of changes are required from a basic ALV grid which include adding a new field to ALV data declaration table(it_ekko), populating this field with the field name identifier and colour attributes and finally adding an entry to layout control work area. These changes are highlighted in bold below.
REPORT zdemo_alvgrid .
REPORT ZALV_CELLCOLOR.
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
CELLCOLOR TYPE LVC_T_SCOL,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform set_cell_colours.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'.
fieldcatalog-datatype = 'CURR'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_LAYOUT-coltab_fieldname = 'CELLCOLOR'. "CTAB_FNAME
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
is_variant = z_template
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select ebeln ebelp statu aedat matnr menge meins netpr peinh
up to 10 rows
from ekpo
into CORRESPONDING FIELDS OF TABLE it_ekko.
endform. " DATA_RETRIEVAL
Form TOP-OF-PAGE *
ALV Report Header *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = 'EKKO Table Report'.
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform. "top-of-page
*& Form SET_CELL_COLOURS
Set colour of individual ALV cell, field
FORM SET_CELL_COLOURS .
DATA: WA_CELLCOLOR TYPE LVC_S_SCOL.
DATA: ld_index TYPE SY-TABIX.
LOOP AT IT_EKKO into wa_ekko.
LD_INDEX = SY-TABIX.
Set colour of EBELN field to various colors based on sy-tabix value
WA_CELLCOLOR-FNAME = 'EBELN'.
WA_CELLCOLOR-COLOR-COL = sy-tabix. "color code 1-7, if outside rage defaults to 7
WA_CELLCOLOR-COLOR-INT = '1'. "1 = Intensified on, 0 = Intensified off
WA_CELLCOLOR-COLOR-INV = '0'. "1 = text colour, 0 = background colour
APPEND WA_CELLCOLOR TO wa_ekko-CELLCOLOR.
MODIFY it_ekko from wa_ekko INDEX ld_index TRANSPORTING CELLCOLOR.
Set colour of NETPR field to color 4 if gt 0
if wa_ekko-netpr gt 0.
WA_CELLCOLOR-FNAME = 'NETPR'.
WA_CELLCOLOR-COLOR-COL = 4. "color code 1-7, if outside rage defaults to 7
WA_CELLCOLOR-COLOR-INT = '0'. "1 = Intensified on, 0 = Intensified off
WA_CELLCOLOR-COLOR-INV = '0'. "1 = text colour, 0 = background colour
APPEND WA_CELLCOLOR TO wa_ekko-CELLCOLOR.
MODIFY it_ekko from wa_ekko INDEX ld_index TRANSPORTING CELLCOLOR.
endif.
Set colour of AEDAT field text to red(6)
WA_CELLCOLOR-FNAME = 'AEDAT'.
WA_CELLCOLOR-COLOR-COL = 6. "color code 1-7, if outside rage defaults to 7
WA_CELLCOLOR-COLOR-INT = '0'. "1 = Intensified on, 0 = Intensified off
WA_CELLCOLOR-COLOR-INV = '1'. "1 = text colour, 0 = background colour
APPEND WA_CELLCOLOR TO wa_ekko-CELLCOLOR.
MODIFY it_ekko from wa_ekko INDEX ld_index TRANSPORTING CELLCOLOR.
ENDLOOP.
ENDFORM. " SET_CELL_COLOURS -
How to change the particular column background color in jTable?
I am woking with a project, in which I am using a jTable. Then
How to change the particular column background color in jTable?Use a custom Renderer. This is the JTable tutorial:
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html -
Background color for column heading
Hi,
I have 5 columns in my report and I would like to have different background color for column headings. How can I do this in report templates?
I was looking at Column heading section-
<th class="t10ReportHeader"#ALIGNMENT# id="#COLUMN_HEADER_NAME#">#COLUMN_HEADER#</th>
How can I specify backgrund colors for all columns here?
Thanks in advanceG'day Karen,
Thanks for ur reply.
I have seen this note before, its not that the header colors have changed after latest SP was applied in our systems. Also the ABAP and JAVA stacks are in sync.
Scenario is that we are trying to set up a new Portal theme for Enterprise Reporting with some specific color codes (hex codes).
What i have observed is Characterstics Header background color is set up using the element "Background Color of Level 1 Column Heading ".
While the Background color for Key Figures header is using element "Background Color of Level 2 Column Heading ".
But the problem is element "Background Color of Level 2 Column Heading " is also used as the Background color for Standard Characterstics cell, so if we make it same the whole report of the same color, which we dont want.
Requirement is to get the same Background color for Header cells (both Char. and Key Figure headers).
Any further suggestions will be appreciated.
Thanks
CK -
I need help highlighting cells on my Numbers '09 spreadsheet. I want the cell text/fill to change color when the date is 180 days or less from the current date. I already have a cell with the current date in it. I also know how to change the fill/text colors. All the cells have been formatted to show date only. I am having trouble with the formula. I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost. Can anyone help?
Thank you for any assistance.
BSet a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
Regards,
Barry -
Change color of key field in salv_table
Hello,
this is my first post in scn. This community helped me a lot so far.
Now i have a problem with the SALV. I can change the color of normal fields but not of key fields. I changed the attribute like this:
INCLUDE <color>.
lv_col-col = col_negative.
TRY.
lo_column ?= lo_columns->get_column( 'AUFNR' ).
lo_column->set_key( ' ' ).
lo_column->set_visible( 'X' ).
lo_column->set_edit_mask( ' ' ).
lo_column->set_color( lv_col ).
CATCH cx_salv_not_found.
ENDTRY.
TRY.
lo_column ?= lo_columns->get_column( 'RSDAT' ).
lo_column->set_key( ' ' ).
lo_column->set_color( lv_col ).
CATCH cx_salv_not_found.
ENDTRY.
He get the correct column and changes set_key from 'X' to ' ' but the color is still blue. Maybe anyone has an idea what to change on the column object.
Thanks in advanceHi Marco,
Try to change the key field to normal like this :
lo_column->set_key( if_salv_c_bool_sap=>false ).
Regards,
Tanmay -
Change color on Report Painter
Dear gurus.
Pls give idear about Report painter.
Now I am making comparson report between planned data and
actual data on report painter in order to check variance between them.
Column1: Planned data
Column2: Actual data
Column3: Variance between Column1 and 2
Then, I want to change the font color of Column3 only in
case that the variance over the criteria such as 10,000 $.
Do you know how to do it on report painter?
I don't care whether "Change color" or "make font Bold" or "Font blinking".
My purpose is to give warning to report's readers which record
they have to read carefully.
BR
yoshitadaDear Sadashivan
Thanks for your info.
I tried the way you mentioned.
However, the thing I want to do is not to change the font color of specified column.
The thing I want to do is to setup the threshhold such as percentage or amount
and emphasize the data which over the threshhold by changing the color
automatically.
Thanks anyway.
BR
Yoshitada -
Changing number of columns on master page, does not affect pages?
I create a master page. say three columns per spread.
I go to actual pages, flow my type in with the loaded cursor and holding the shift key... it works like a charm... text flows in the three colums, adding pages until the end of the manuscript...
Now I decide I don't like the three columns. I go to the master page and change to 4 columns via "margins and columns..." under LAYOUT menu
I go to the pages assuming that any change in a masterpage will translate to the pages... NOT!
If I go to to my first page, the type is still in three colums...
All other changes I make on the masterpage do translate to the pages... like say a color bar at the top, the size and font of the folios... BUT NOT if I change the number of columns???
Can anyone shed light on this?You MUST tick the Option for "Master Text Frame" when Creating a new document.
OR you MUST include a Text Frame with the number of Columns on the master page.
Copy the text to the clip board
Delete all page except page 1
remove the existing text frame.
Drag the Master A to the page 1
CTRL or CMD (MAC) click shift the text frame to break it from the master.
Now paste your text in here
Insert a new page
And click the Overload (red cross) button and connect it to the page 2 hodling down shift.
From memory - hope I got it right !
Maybe you are looking for
-
URGENT: iframe in a dynamic page. Strange Problem.
Hi all, I have a typical problem. I created a Dynamic Page which brings out the information of a Purchase Order (PO). (PO_REPORT) Now the numer of items in a PO can vary from 1 to anything.... so I made a seperated report based on sql query (ITEM_DET
-
Want to change apple id but keep my email is this poss??
can i change apple id and keep my email, just going round in circles, the mind boggles help , if this poss : }
-
SQL Server 2000\2005 compatibility with Active Directory 2012
Hi All, We are currently using Active Directory 2003 and will be upgrading to AD 2012. I'm trying to determine if there is any known compatibility issues when running older versions of SQL Server (2000 and 2005) when upgrading to AD 2012. I've rea
-
What are skewX and skewY in Motion XML?
In the motion XML, what is skewX and skewY? The spec says "shearing along X" and "shearing along Y". However, according to my research, equal shearing along X and Y does not result in rotation(although that's what the spec says about skewX and skew Y
-
Hi, We recently bought 2 N5K and 4 N2K Fabric extenders, now we are having problem installing the fabric extenders as the FEX just wont go up. switch(config-fex)# sh fex 100 detail FEX: 100 Description: ADM/128-SVF-NS302 state: Offline FEX versio