Export DOORS attribute font color to Excel font color - export-to-excel

I've seen the discussion in https://www.ibm.com/developerworks/community/forums/html/topic?id=7981c520-ee1b-4a5f-b1f7-510172d2a3bd&ps=25 and have a copy of the GalacticSolutions Excel export script. That script takes the color of the font in a module cell and maps it to the Excel cell-fill color. What isn't clear to me is how to take that same source color and map it instead to the Excel cell's text color.
My source attribute is an enumeration with the assigned colors setting the font color as in . Perhaps the simplest answer that would help me is if someone familiar with the GalacticSolutions script , , could identify the code which passes the color to the cell fill-color and provide the equivalent command to handle the font color.
thanks
Carl

I received an answer on an IBM forum and am copying it here.
dowhich = "Interior" //to shade the cell
dowhich = "Font" //to color the font
void excelSetRangeColorOLE( OleAutoObj objExcelRange, int iRGBValue ) { OleAutoObj objExcelInterior = null oleResult( oleGet( objExcelRange, dowhich, objExcelInterior ) ) oleResult( olePut( objExcelInterior, "Color", iRGBValue ) ) }

Related

styling tooltips in AmCharts (V4)

currently im trying to style a tooltip which appears when you hover over an map image with dynamic content (title of the company).
My aim is to style the background to a specific color, give the font a color and also apply a CSS property "box-shadow".
For the first aim I tried to use the "fill" property like so:
mapImageSeries is of type am4maps.MapImageSeries.
this.mapImageSeries.tooltip.fill = am4core.color('#ffff00');
Which does not work however using
this.mapImageSeries.tooltip.background.cornerRadius = 0; // will change the "border-radius" of the tooltip.
this.mapImageSeries.tooltip.background.fill = am4core.color('#ffff00'); // does also not work.
For my second goal setting up a color property for the font I didn't find a property, same with the box-shadow css property.
Is it possible to attach a css class for the tooltip so I can easily style it via CSS? And how do I style the tooltip with the
requirements im facing?
By default, tooltips pull colors from their relevant object, so to manipulate their styles you'll first have to turn that off, e.g.:
this.mapImageSeries.tooltip.getFillFromObject = false;
You can then do:
this.mapImageSeries.tooltip.background.cornerRadius = 0;
this.mapImageSeries.tooltip.background.fill = am4core.color("#ffff00");
Instead of modifying CSS box-shadow, you can apply the DropShadow SVG filter. Tooltips have a single filter, actually a DropShadow filter out the box, which we can modify:
var dropShadow = this.mapImageSeries.tooltip.filters.getIndex(0);
dropShadow.dx = 3;
dropShadow.dy = 3;
dropShadow.blur = 5;
dropShadow.opacity = 0.7;
To modify Tooltip text styles, they actually have their own Label child via their label property. There are two ways you can modify color, first is like the method above, e.g. if you want to set a default color for tooltip text:
this.mapImageSeries.tooltip.label.fill = am4core.color("#e97f02"); // color from lolcolors: https://www.webdesignrankings.com/resources/lolcolors/#palette_18
Another way to color the text, as well as apply other CSS styles, is to use Visual formatting in your tooltipText string, e.g.:
this.mapImageSeries.tooltipText = "[font-size: 20px; #bd1550]{companyTitle}:[/]\n{locationTitle} branch";
One style that won't work via visual formatting is text-align, you'll need to do that through via SVG properties, e.g.
this.mapImageSeries.tooltip.label.textAlign = "middle";
I've made a demo for you here:
https://codepen.io/team/amcharts/pen/f6d4167ea7ccd5dd47054d2430443c0a/
Hope this helps, let me know if it's all making sense.
If you're still looking to use literally CSS for your own needs, let me know and I'll try to sort that out with you.

How do I change the color of already drawn InkStrokes in windows universal

I have drawn some ink strokes on an InkCanvas and am now wanting to change the pen colour. I can change the colour of any additional strokes I draw using CopyDefaultDrawingAttributes and UpdateDefaultDrawingAttributes and that works fine. But how do I alter the color of the strokes that are already present StrokeContainer? I've tried:
foreach (InkStroke stroke in inkCanvas.InkPresenter.StrokeContainer.GetStrokes())
{
stroke.DrawingAttributes.Color = strokeColour;
};
This code executes with no exceptions, but stroke.DrawingAttributes.Color still shows the previous colour.
Any ideas?
Thanks...
Robert
You cannot set the DrawingAttributes property of the stroke directly. You must create a copy of the InkDrawingAttributes of the stroke, set the desired values for that InkDrawingAttributes object, and then assign the new InkDrawingAttributes to the DrawingAttributes of the stroke.
So you can code for example like this:
foreach (InkStroke stroke in inkCanvas.InkPresenter.StrokeContainer.GetStrokes())
{
//stroke.DrawingAttributes.Color = Windows.UI.Colors.Yellow;
InkDrawingAttributes drawingAttributes = new InkDrawingAttributes();
drawingAttributes.Color = Windows.UI.Colors.Yellow;
stroke.DrawingAttributes = drawingAttributes;
}
For more information, you can refer to InkStroke.DrawingAttributes | drawingAttributes property.

Fonts created in Hiero can't set the color with new Color(r,g,b,a); - LIBGDX

I generated some fonts in Hiero. If I set the font color with :
fontFPS.setColor(Color.YELLOW);
the text color it is drawn correctly.
But if I set it with
Color fpsColor = new Color(74f, 112f, 139f, 160f);
fontFPS.setColor(fpsColor);
then I only get white color with no alpha. What is the problem?
First of all float values inside that method should be from 0f to 1f. So your color should be (values I put in constructor are calculated by dividing your original values with 255)
Color fpsColor = new Color(0.29f, 0.43f, 0.54f, 0.66f);
Also you should enable blending like this (I'm not sure if you already did that)
Gdx.gl.glEnable(GL10.GL_BLEND);
Gdx.gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA)

JAVA/JXL- Different colors for the text in a cell

I would like to set part of the text in a cell to one color(font color) and other part to another color. Is this possible with jxl api ? or it is a limitation?
example:
i have 'name*' in cell, now i want the color of 'name' in blue and '*' in red.
Thanks in advance.
Yes you can do that. please check the following code.
WritableFont TableFormat = new WritableFont(WritableFont.ARIAL, 8, WritableFont.BOLD,false, UnderlineStyle.NO_UNDERLINE, Colour.WHITE);
WritableCellFormat tableFormatBackground = new WritableCellFormat(); //table cell format
tableFormatBackground.setBackground(Colour.DARK_BLUE) ; //Table background
tableFormatBackground.setBorder(Border.ALL, BorderLineStyle.THIN,Colour.BLACK); //table border style
tableFormatBackground.setFont(TableFormat); //set the font
tableFormatBackground.setAlignment(Alignment.CENTRE);// set alignment left
Unfortunately, I don't think it's possible.
Same as you I was looking for this solution as well as how to use regular and bold fonts in the same cell (like: "version: 1.2.3.4"), but as much as I saw, jxl doesn't support different format in the same cell... :(

Dojox.charting.themes define number of colors

I’m using MiamiNice theme in my “pie’s” graphics, but doesn’t provide enough colors, and repeat colors in some sectors, is there any way to define a number of colors?
Thanks!!!
You can simply create your own Theme and put there all the colors that you want.
e.g.
var myTheme = new dojox.charting.Theme({
colors: [
"#A4CE67",
"#739363",
"#6B824A",
"#343434",
"#636563"
]
});
Then you should use "myTheme" as your theme in your chart.

Resources