XLSX XML cell formatting works in LibreOffice but not MS Excel - excel

I modified data tables xlsx export to generate tables with my custom styles. Primarily for the background colors. Mine is a mess, but it works. It generates the xlsx file and in LibreOffice it looks exactly like it should. But in Excel, the cells with Style #3 (FFAAAA) are not filled with solid yellow background but with a dotted gray background.
The ones with red or white background just work fine everywhere.
The whole xml was reverse engineered from other exports.
Any idea what Excel expects to be different?
<?xml version="1.0" encoding="UTF-8"?>
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
<numFmts count="7">
<numFmt numFmtId="0" formatCode=""/>
<numFmt numFmtId="1" formatCode="#,##0.00_-\ [$$-45C]"/>
<numFmt numFmtId="2" formatCode=""£"#,##0.00"/>
<numFmt numFmtId="3" formatCode="[$€-2]\ #,##0.00"/>
<numFmt numFmtId="4" formatCode="0.0%"/>
<numFmt numFmtId="5" formatCode="#,##0;(#,##0)"/>
<numFmt numFmtId="6" formatCode="#,##0.00;(#,##0.00)"/>
</numFmts>
<fonts count="2" x14ac:knownFonts="1">
<font>
<sz val="11" />
<name val="undefined" />
<color rgb="FF000000" />
</font>
<font>
<sz val="11" />
<name val="Calibri" />
<color rgb="FF000000" />
<b />
</font>
</fonts>
<fills count="4">
<fill>
<patternFill patternType="none" />
</fill>
<fill>
<patternFill patternType="solid">
<fgColor rgb="FFffeeaa" />
<bgColor indexed="64" />
</patternFill>
</fill>
<fill>
<patternFill patternType="solid">
<fgColor rgb="FFffaaaa" />
<bgColor indexed="65" />
</patternFill>
</fill>
<fill>
<patternFill patternType="solid">
<fgColor rgb="FFffffff" />
<bgColor indexed="66" />
</patternFill>
</fill>
</fills>
<borders count="2">
<border> <left /> <right /> <top /> <bottom /> <diagonal /> </border>
<border diagonalUp="false" diagonalDown="false"> <left style="thin"> <color auto="1" /> </left> <right style="thin"> <color auto="1" /> </right> <top style="thin"> <color auto="1" /> </top> <bottom style="thin"> <color auto="1" /> </bottom> <diagonal /> </border>
</borders>
<cellStyleXfs count="1">
<xf numFmtId="0" fontId="0" fillId="0" borderId="0" />
</cellStyleXfs>
<cellXfs count="5">
<xf numFmtId="0" fontId="0" fillId="0" borderId="0" applyFont="1" applyFill="1" applyBorder="1"/>
<xf numFmtId="0" fontId="1" fillId="0" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/>
<xf numFmtId="0" fontId="1" fillId="1" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/>
<xf numFmtId="0" fontId="1" fillId="2" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/>
<xf numFmtId="0" fontId="1" fillId="3" borderId="1" applyFont="1" applyFill="1" applyBorder="1"/>
</cellXfs>
<cellStyles count="1">
<cellStyle name="Normal" xfId="0" builtinId="0" />
</cellStyles>
<dxfs count="0" />
<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4" />
</styleSheet>

It seems excel always overwrites the second with patternType="gray125".
I just keep
<fill>
<patternFill patternType="gray125">
<fgColor rgb="FFffffff" />
<bgColor rgb="FFffffff" />
</patternFill>
</fill>
as second , regardless if i actually use it in any style and add the i need after this. Now it works in Libre Office Calc and MS Excel.
I hope that helps others aswell.

Related

Blue Prism : Turn name into an email adress?

I'm building an automation that reads an excel file with two columns (name and date), stores this to a collection and then sends out calendar invites based on those same parameters.
Extracting the data and sending the invites are both working fine individually but what I need to do now is convert the column that contains the names into email address format e.g. 'Person One' into 'Person.One#emailaddress.com'.
Added to this some of the 'name' rows contain two people in the following format - 'Person One & Person Two' so I'd need to split them into two seperate email addresses so they can both receieve the calendar invite for the appropriate date.
I'm guessing that I should be looking to do this using something in the 'Utility - Strings' function? Can anyone point me in the right direction? Much appreciated, thanks
Rota Example
needs to become
New Collection
There are two major components you'll need to accomplish this conversion of a name to an email address:
Split the initial list of recipients on the & (space-ampersand-space) sequence.
For each of the recipients, calculate the e-mail address by replacing whitespaces with full stop (.) characters and appending the #email.com domain.
As such, your process would look similar to the following:
You can use this in your Blue Prism 6.9 environment by saving the following XML as a .bpprocess or .xml file and importing it using the File > Import > Process / Object menu option in the Blue Prism Interactive Client:
<process name="Test Process" version="1.0" bpversion="6.9.0.26970" narrative="" byrefcollection="true" preferredid="f848bd78-240d-4b87-82b4-ade6ea8e40d8">
<view>
<camerax>0</camerax>
<cameray>-21</cameray>
<zoom version="2">1.25</zoom>
</view>
<preconditions />
<endpoint narrative="" />
<stage stageid="81bc6e0a-2151-4fae-80d7-3ad8d2d9826a" name="Start" type="Start">
<display x="15" y="-105" />
<onsuccess>69469193-4784-4519-bd10-974fb3d7e1da</onsuccess>
</stage>
<stage stageid="b527e78b-915b-4498-bf59-5f662104bb9d" name="End" type="End">
<display x="15" y="165" />
</stage>
<stage stageid="92f4087e-5cdf-41a1-a889-088d7ef7c469" name="Stage1" type="ProcessInfo">
<display x="-195" y="-105" w="150" h="90" />
</stage>
<stage stageid="f9d08d9a-ac87-4c6b-8aa9-2dc864ce8d8d" name="Input" type="Block">
<loginhibit onsuccess="true" />
<display x="-270" y="-45" w="150" h="60" />
<font family="Segoe UI" size="10" style="Regular" color="7FB2E5" />
</stage>
<stage stageid="9fd57578-1b94-43f5-989e-f0fac142744f" name="Recipients" type="Data">
<loginhibit onsuccess="true" />
<display x="-195" y="-15" w="150" h="30" />
<datatype>text</datatype>
<initialvalue xml:space="preserve">Person One</initialvalue>
<private />
<alwaysinit />
</stage>
<stage stageid="5ea9beac-25e7-4560-9253-28706cf4f247" name="Output" type="Block">
<loginhibit onsuccess="true" />
<display x="-270" y="30" w="150" h="90" />
<font family="Segoe UI" size="10" style="Regular" color="7FB2E5" />
</stage>
<stage stageid="71130d29-3d68-4809-809f-11429da8ca1d" name="Recipient Contacts" type="Collection">
<display x="-195" y="75" w="150" h="60" />
<datatype>collection</datatype>
<private />
<alwaysinit />
<collectioninfo>
<field name="Name" type="text" />
<field name="Email" type="text" />
</collectioninfo>
</stage>
<stage stageid="69469193-4784-4519-bd10-974fb3d7e1da" name="Utility - Strings::Split Text" type="Action">
<loginhibit onsuccess="true" />
<display x="15" y="-60" w="120" h="30" />
<inputs>
<input type="text" name="Text to Split" friendlyname="Text to Split" narrative="The text to split" expr="[Recipients]" />
<input type="text" name="Split Char" friendlyname="Split Char" narrative="The split delimiter" expr="" & "" />
<input type="text" name="Collection Field Name" friendlyname="Collection Field Name" narrative="The name of the field for the resulting collection" expr=""Name"" />
</inputs>
<outputs>
<output type="collection" name="Split Values" friendlyname="Split Values" narrative="The resulting collection containing the split values" stage="Split Values" />
</outputs>
<onsuccess>fe157559-e2e0-4a5d-95b7-4681fc9089ce</onsuccess>
<resource object="Utility - Strings" action="Split Text" />
</stage>
<stage stageid="54353e0c-0125-4a3f-9870-8adc655e82a1" name="Split Values" type="Collection">
<display x="165" y="-60" w="90" h="60" />
<datatype>collection</datatype>
<private />
<alwaysinit />
</stage>
<stage stageid="fe157559-e2e0-4a5d-95b7-4681fc9089ce" name="Loop Split Values" type="LoopStart">
<loginhibit onsuccess="true" />
<display x="15" y="-15" w="150" h="30" />
<onsuccess>1f522616-2dbf-4355-97f1-082fa9a00406</onsuccess>
<groupid>31b533a9-c80b-49d2-bba7-2fa7f270cd72</groupid>
<looptype>ForEach</looptype>
<loopdata>Split Values</loopdata>
</stage>
<stage stageid="174f331c-b597-4053-aba2-e65f3f054f7c" name="Loop Split Values" type="LoopEnd">
<loginhibit onsuccess="true" />
<display x="15" y="120" w="150" h="30" />
<onsuccess>b527e78b-915b-4498-bf59-5f662104bb9d</onsuccess>
<groupid>31b533a9-c80b-49d2-bba7-2fa7f270cd72</groupid>
</stage>
<stage stageid="1f522616-2dbf-4355-97f1-082fa9a00406" name="Add Row to Output Collection" type="Action">
<loginhibit onsuccess="true" />
<display x="15" y="30" w="120" h="30" />
<inputs>
<input type="text" name="Collection Name" friendlyname="Collection Name" narrative="The name of the collection to act upon" expr=""Recipient Contacts"" />
</inputs>
<onsuccess>6547bfb9-ae7e-4735-96b4-07fbca2678f0</onsuccess>
<resource object="Blueprism.AutomateProcessCore.clsCollectionActions" action="Add Row" />
</stage>
<stage stageid="6547bfb9-ae7e-4735-96b4-07fbca2678f0" name="Store Name and Calculated Email for Recipient" type="MultipleCalculation">
<loginhibit onsuccess="true" />
<display x="15" y="75" w="120" h="30" />
<onsuccess>174f331c-b597-4053-aba2-e65f3f054f7c</onsuccess>
<steps>
<calculation expression="[Split Values.Name]" stage="Recipient Contacts.Name" />
<calculation expression="Replace([Split Values.Name], " ", ".") & "#email.com"" stage="Recipient Contacts.Email" />
</steps>
</stage>
</process>

Excel ignors border in Excel Open XML style sheet

I create simple xlsx files for excel by manual coding. I create the minimal required parts put it to a zip file names it as xlsx and evering works fine.
Except of the borders!!
Excel ignores all of my borders-advices and I don't know why.
Here is my styles.xml:
<?xml version="1.0" encoding="UTF-8"?>
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<fonts count="4">
<font>
<name val="Calibri"/>
<sz val="14"/>
<b/>
<color rgb="FF000000"/>
</font>
<font>
<name val="Calibri"/>
<sz val="10"/>
<color rgb="FF000000"/>
</font>
<font>
<name val="Calibri"/>
<sz val="10"/>
<b/>
<color rgb="FF000000"/>
</font>
<font>
<name val="Calibri"/>
<sz val="6"/>
<b/>
<color rgb="FF000000"/>
</font>
</fonts>
<fills count="2">
<fill>
<patternFill patternType="none"/>
</fill>
<fill>
<patternFill patternType="gray125"/>
</fill>
</fills>
<borders count="2">
<border>
<left/>
<right/>
<top/>
<bottom/>
<diagonal/>
</border>
<border>
<left/>
<right/>
<top style="thin">
<color rgb="FF000000"/>
</top>
<bottom/>
<diagonal/>
</border>
</borders>
<cellXfs count="11">
<xf numFmtId="0" fontId="0" fillId="0" borderID="0">
<alignment horizontal="left"/>
</xf>
<xf numFmtId="0" fontId="1" fillId="0" borderID="0">
<alignment horizontal="left"/>
</xf>
<xf numFmtId="0" fontId="1" fillId="0" borderID="0">
<alignment horizontal="right"/>
</xf>
<xf numFmtId="0" fontId="2" fillId="0" borderID="0">
<alignment horizontal="left"/>
</xf>
<xf numFmtId="0" fontId="2" fillId="0" borderID="0">
<alignment horizontal="right"/>
</xf>
<xf numFmtId="49" fontId="1" fillId="0" borderID="0">
<alignment horizontal="right"/>
</xf>
<xf numFmtId="3" fontId="1" fillId="0" borderID="0">
<alignment horizontal="right"/>
</xf>
<xf numFmtId="4" fontId="1" fillId="0" borderID="0">
<alignment horizontal="right"/>
</xf>
<xf numFmtId="3" fontId="2" fillId="0" borderID="1" applyBorder="1">
<alignment horizontal="right"/>
</xf>
<xf numFmtId="4" fontId="2" fillId="0" borderID="1" applyBorder="1">
<alignment horizontal="right"/>
</xf>
<xf numFmtId="0" fontId="3" fillId="0" borderID="0">
<alignment horizontal="left"/>
</xf>
</cellXfs>
</styleSheet>
The cells with a border in the sheet1.xml defined as follows:
That one with s="8" and s="9" should have a top border.
<row r="18">
<c r="B18" t="inlineStr" s="4">
<is>
<t>Summe 2018:</t>
</is>
</c>
<c r="C18" t="n" s="8">
<v>5618.85</v>
</c>
<c r="D18" t="n" s="8">
<v>16262.68</v>
</c>
<c r="E18" t="n" s="9">
<v>4896.25</v>
</c>
</row>
Its related to case-sensitivity of borderID="1" attribute in cell format , try to correct it to borderId="1".
<xf numFmtId="3" fontId="2" fillId="0" borderId="1" applyBorder="1">
<alignment horizontal="right"/>
</xf>
<xf numFmtId="4" fontId="2" fillId="0" borderId="1" applyBorder="1">
<alignment horizontal="right"/>
</xf>

Add start and end attribute to node and edge in gexf file

I have a .gexf file that contains nodes and edges with IDs and labels. I generated this .gexffile from a .gml file using networkx. Here's the code for that:
import networkx as nx
G = nx.read_gml('data/gml/test.gml') # read in gml file as Graph
nx.write_gexf(G, "output/test.gexf") # write to gexf format
The next thing I want to do, is to add a startand end attribute to every node and every edge in my file.
So basically, I want this:
<?xml version='1.0' encoding='utf-8'?>
<gexf version="1.1" xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gexf.net/1.1draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema-instance">
<graph defaultedgetype="undirected" mode="static">
<nodes>
<node id="clock" label="clock" />
<node id="beach" label="beach" />
<node id="sun" label="sun" />
<node id="sea" label="sea" />
<node id="sand" label="sand" />
<node id="guitar" label="guitar" />
(...)
</nodes>
<edges>
<edge id="0" source="ice" target="shoe" weight="0.9995600294856769" />
<edge id="1" source="ice" target="toothbrush" weight="0.9992457544219484" />
<edge id="1533" source="snake" target="ant" weight="0.9999144063155566" />
(...)
<edge id="1534" source="mosquito" target="jellyfish" weight="0.9994175606336606" />
<edge id="1535" source="ant" target="star" weight="0.9994226236705537" />
</edges>
</graph>
</gexf>
to look like this (note the dynamicmode and start and end attributes):
<?xml version='1.0' encoding='utf-8'?>
<gexf version="1.1" xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gexf.net/1.1draft/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2001/XMLSchema-instance">
<graph defaultedgetype="undirected" mode="dynamic">
<nodes>
<node id="clock" label="clock" start="2000-02-20" end="2000-02-22" />
<node id="beach" label="beach" start="2000-02-20" end="2000-02-22" />
<node id="sun" label="sun" start="2000-02-20" end="2000-02-22" />
<node id="sea" label="sea" start="2000-02-20" end="2000-02-22" />
<node id="sand" label="sand" start="2000-02-20" end="2000-02-22" />
<node id="guitar" label="guitar" start="2000-02-20" end="2000-02-22" />
(...)
</nodes>
<edges>
<edge id="0" source="ice" target="shoe" weight="0.9995600294856769" start="2000-02-20" end="2000-02-22" />
<edge id="1" source="ice" target="toothbrush" weight="0.9992457544219484" start="2000-02-20" end="2000-02-22" />
<edge id="1533" source="snake" target="ant" weight="0.9999144063155566" start="2000-02-20" end="2000-02-22" />
(...)
<edge id="1534" source="mosquito" target="jellyfish" weight="0.9994175606336606" start="2000-02-20" end="2000-02-22" />
<edge id="1535" source="ant" target="star" weight="0.9994226236705537" start="2000-02-20" end="2000-02-22" />
</edges>
</graph>
</gexf>
Unfortunately I was not able to find any documentation (neither for networkx nor for pygexf) on how to write a dyamic gexf file and add a startand end attribute to every (already existing) node and edge. Can anyone please help me with this?
UPDATE:
When I use
nx.set_edge_attributes(G, 'start', '2000-02-20')
nx.set_edge_attributes(G, 'end', '2000-02-22')
To set the edge attributes, I get the correct output, e.g.:
<edge id="0" source="great" target="wait" weight="0.998675772419067" start="2000-02-20" end="2000-02-22" />
However, when I do:
nx.set_node_attributes(G, 'start','2000-02-20')
nx.set_node_attributes(G, 'end','2000-02-22')
I get:
<node id="blue" label="blue">
<attvalues>
<attvalue for="0" value="2000-02-20" />
<attvalue for="1" value="2000-02-22" />
</attvalues>
How can I set the start and endattribute within the node tag?
Came across that same problem. Networkx 2.1 still does not support that, but there is a workaround:
Write the .gexf file as usual
Download Gephi 0.9.2 and open the .gexf file
Go to Data Laboratory and press 'Merge Columns'. Now select the start and end column and 'Merge Strategy': 'Create time interval'. Now your Interval column is filled with <[start, end]>
Go to File > Export > Graph file... and select File Format:GEXF Files. Your nodes now contain the start and end attribute.

FetchXML View to Include Attributes from Nested Link-Entity

I would like to have a view that show attributes from 3 entities:
Statistics has a lookup to Account and Account has a lookup to Address.
The view is on Statistics and I want attributes from all 3 entities; is this even possible?
The problem is with the GridXML.
I want to include the attribute wl_city in the GridXML.
This is the FetchXML with link-entities:
<fetchxml>
<fetch version="1.0" output-format="xml-platform" mapping="logical">
<entity name="sb_statistics">
<order attribute="sb_amount" descending="false" />
<!-- It is easy to get these into the GridXML -->
<attribute name="sb_debtor" />
<attribute name="sb_date" />
<attribute name="sb_amount" />
<link-entity name="account" from="accountid" to="sb_debtor"
alias="relatedAccount" link-type="outer">
<!-- It is possible to get this into the GridXML
by using the link-entity alias: relatedAccount.wl_towncity -->
<attribute name="wl_towncity" />
<link-entity name="wl_postalcode" from="wl_postalcodeid"
to="wl_postaltowncity" alias="relatedAddress" link-type="outer">
<!-- I have trouble getting this attribute into the GridXML -->
<attribute name="wl_city" />
</link-entity>
</link-entity>
<attribute name="sb_statisticsid" />
</entity>
</fetch>
</fetchxml>
When I change the GridXML as below this error is displayed when the view is opened:
"To use this saved query, you must remove criteria and columns that refer to deleted or non-searchable items"
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAccount.relatedAddress.wl_city" width="100" />
</row>
</grid>
</layoutxml>
The below GridXML shows this error when the view is opened:
"Unexpected Error An error has occured".
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAddress.wl_city" width="100" />
</row>
</grid>
</layoutxml>
The GridXML below results in this error being shown when the view is opened:
"To use this saved view, you must remove criteria and columns that refer to deleted or non-searchable columns".
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="wl_city" width="100" />
</row>
</grid>
</layoutxml>
This saved query works, but it only includes attributes from the primary entity and the first link-entity.
<savedquery>
<IsCustomizable>1</IsCustomizable>
<CanBeDeleted>0</CanBeDeleted>
<isquickfindquery>0</isquickfindquery>
<isprivate>0</isprivate>
<isdefault>0</isdefault>
<returnedtypecode>10008</returnedtypecode>
<savedqueryid>{df101ac4-2e4d-e311-9377-005056bd0001}</savedqueryid>
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAccount.wl_city" width="100" />
</row>
</grid>
</layoutxml>
<querytype>0</querytype>
<fetchxml>
<fetch version="1.0" output-format="xml-platform" mapping="logical">
<entity name="sb_statistics">
<order attribute="sb_amount" descending="false" />
<attribute name="sb_debtor" />
<attribute name="sb_date" />
<attribute name="sb_amount" />
<link-entity name="account" from="accountid" to="sb_debtor"
alias="relatedAccount" link-type="outer">
<attribute name="wl_towncity" />
<link-entity name="wl_postalcode" from="wl_postalcodeid"
to="wl_postaltowncity" alias="relatedAddress" link-type="outer">
<attribute name="wl_city" />
</link-entity>
</link-entity>
<attribute name="sb_statisticsid" />
</entity>
</fetch>
</fetchxml>
<LocalizedNames>
<LocalizedName description="Statistics and Address" languagecode="1033" />
</LocalizedNames>
</savedquery>
Is GridXML limited to showing only attributes from the primary entity and the first link-entity?
This is not possible, according to the best of my knowledge, but please someone prove me wrong.
A limitation of GridXML appears to be that attributes can only be included that are from the first link-entity, not any nested link-entities.
It should work when using link-type="inner" for nested link.
<entity name="sb_statistics">
...
<link-entity name="account" from="accountid" to="sb_debtor"
alias="relatedAccount" link-type="outer">
<attribute name="wl_towncity" />
<link-entity name="wl_postalcode" from="wl_postalcodeid"
to="wl_postaltowncity" alias="relatedAddress" link-type="inner"> //link-type="inner"
<attribute name="wl_city" />
</link-entity>
</link-entity>
<attribute name="sb_statisticsid" />
</entity>
I have found no evidence that it can be done. With or without link-type='inner' the designer (in 2013) says, "The relatedAddress.wl_city column is no longer a valid column because it has been deleted as a column option. You need to remove this column and, if you want, add a different one."
It does NOT need multiple dereferrences, nor does that work. If you dump the keyValuePairs of the AttributeCollection returned by the fetch, you will see the key is relatedAddress.w1_city -- not its parent nor the combination.
Like the UI, it just appears the layout is limited to only root and children, no grandchildren nor further descendants.
I think it's a little late to answer this question, but maybe someone come to this post and find it helpful.
first thing you should know is that, fetchxml will return only column that are not null, so if you are querying a column that there is no data in that, then fetchxml automatically remove it from result set.
second thing is, if you have different table with different relationship, then alias name will be added to the column name, so in your case relatedAccount.wl_towncity and relatedAddress.wl_city is correct and not relatedAccount.relatedAddress.wl_city. in your example, you put alias name after each other that is not correct.
third thing that you should know is that when a nested result will return, the type is object, but original type AliasedValue , so first you have to cast the object to AliasedValue. then it become ready to cast it to OptionSetValue. after that you have to look for .Value that has the result of what you want
I made it work like this: I still have an issue with unresolved columnheaders.
<fetch distinct='true'>
<entity name='rdiac_riskobject'>
<attribute name='rdiac_riskobjectid' />
<attribute name='rdiac_name' />
<attribute name='rdiac_riskobjectproduct' />
<link-entity name='rdiac_riskobject_rdiac_propertydetail' from='rdiac_riskobjectid' to='rdiac_riskobjectid' intersect='true'>
<link-entity name='rdiac_propertydetail' alias='pd1' from='rdiac_propertydetailid' to='rdiac_propertydetailid'>
<attribute name='rdiac_valuestring' />
<link-entity name='rdiac_propertysvconfig' from='rdiac_property' to='rdiac_propertyid'>
<filter>
<condition attribute='rdiac_svfield' operator='eq' value='100000000'/>
</filter>
</link-entity>
</link-entity>
</link-entity>
<link-entity name='rdiac_riskobject_rdiac_propertydetail' from='rdiac_riskobjectid' to='rdiac_riskobjectid' intersect='true'>
<link-entity name='rdiac_propertydetail' alias='pd2' from='rdiac_propertydetailid' to='rdiac_propertydetailid'>
<attribute name='rdiac_valuestring' />
<link-entity name='rdiac_propertysvconfig' from='rdiac_property' to='rdiac_propertyid'>
<filter>
<condition attribute='rdiac_svfield' operator='eq' value='100000001'/>
</filter>
</link-entity>
</link-entity>
</link-entity>
</entity>
</fetch>
<grid name='resultset' object='10139' jump='rdiac_riskobjectproduct' select='1' preview='0' icon='1' >
<row name='result' id='rdiac_riskobjectid' >
<cell name='rdiac_riskobjectproduct' width='100' />
<cell name='pd1.rdiac_valuestring' width='200' />
<cell name='pd2.rdiac_valuestring' width='200' />
</row>
</grid>

set the width for boundfield in spgridview

I tried different ways to set the width for my gridview clumns but nothing worked out for me. Can some one guide me about how o achieve ths. i am including my code below...
Thanks.
<SharePoint:SPGridView ID="gvSearchResults" EnableViewState="true" runat="server"
AlternatingRowStyle-BackColor="#f4f8fd" AllowSorting="true" DataKeyNames="ID"
AutoGenerateColumns="false" OnSorting="gvxxxResults_Sorting" OnPageIndexChanging="gvxxxResults_PageIndexChanging">
<Columns>
<asp:HyperLinkField HeaderText="Name" DataTextField="FileLeafRef"
DataNavigateUrlFields="FileLeafRef" Target="_parent" DataNavigateUrlFormatString="/pp/ll/lp/llDocs/{0}"
ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Wrap="false"
SortExpression="Name" ItemStyle-Width="50px" />
<asp:BoundField DataField="Home_x0020_Number" HeaderText="Home Number" NullDisplayText=" " SortExpression="Home_x0020_Number">
<HeaderStyle Width="150px" Wrap="false" HorizontalAlign="Left" />
<ItemStyle Width="150px" Wrap="false" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Phone_x0020_Number" HeaderText="Phone Number" NullDisplayText=" " SortExpression="Phone_x0020_Number">
<HeaderStyle Width="150px" Wrap="false" HorizontalAlign="Left" />
<ItemStyle Width="150px" Wrap="false" HorizontalAlign="Left" />
</asp:BoundField>
</Columns>
</SharePoint:SPGridView>
Have you tried using the SPBoundField control instead? Try setting the SPBoundField.ControlStyle.Width property.

Resources