Conditional Formatting - Spreadsheet component & XML

J

Jim

Does anyone know if conditional formatting is supported in
the spreadsheet component of Office XP? I can get it to
work in Excel, but it does not work with the spreadsheet
component. I am passing parameters to a template query,
returning the results as an XML document, transforming it
to a formated spreadsheet using an XSL transformation
(created by saving an Excel spreadsheet as XML and editing
it). I want numbers in a particular column to be red,
green, or blue depending upon their value relative to a
set of threshold values.

I contemplated doing this with jscript, but couldn't find
an appropriate event I could trigger off of.

Any insights would be appreciated!
 
A

Alvin Bruney

try putting the jscript in your onload function
sp.Range("$A$1:$Z$2000").Interior.Color = "DarkGray";
This is for the range object, the cell object also exposes a color property
 
G

Guest

I've actually already handled the "static" formating in
the XSL transformation. Now my problem is using
conditional formating to dynamically set the color of the
number in a cell based on the value of numbers input by
the user.

Here is what I have tried in the XSL transformation sheet:
<x:ConditionalFormatting
xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel">
<x:Range>$G$2:$G$8</x:Range>
<x:Condition>

<x:Qualifier>Less</x:Qualifier>
<x:Value1>C2*.01</x:Value1>
<x:Format
Style="color:red;font-weight:700"/>
</x:Condition>
<x:Condition>

<x:Qualifier>Between</x:Qualifier>
<x:Value1>C2*.01</x:Value1>
<x:Value2>D2*.01</x:Value2>
<x:Format
Style="color:green;font-weight:700"/>
</x:Condition>
<x:Condition>

<x:Qualifier>GreaterOrEqual</x:Qualifier>
<x:Value1>D2*.01</x:Value1>
<x:Format
Style="color:blue;font-weight:700"/>
</x:Condition>
</x:ConditionalFormatting>

The spreadsheet componant seems to ignore this...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top