Raven65
Well-known member
- Joined
- Oct 4, 2006
- Messages
- 305
- Programming Experience
- 3-5
Posted this to the MSDN boards but to no avail so far:
I'm using the nifty trick Beth detailed showing how to write XML Excel spreadsheets from LINQ where by I do the following (abreviated):
So, that work's all nice, but I have a problem when I want to build multiple rows per entry. What I want to achive is:
So that each "letter" from my list generates two <Row>'s of data in the exceptions variable, to be injected into the XML below. VB's interpretation of the XML literal seems to be preventing me from doing this however....any thoughts?
I'm using the nifty trick Beth detailed showing how to write XML Excel spreadsheets from LINQ where by I do the following (abreviated):
VB.NET:
Dim exceptions = From letter In allLetters _
Where Not letter.CleanExceptionReason = "" _
Select <Row>
<Cell><Data ss:Type="String"></Data></Cell>
<Cell><Data ss:Type="String"></Data></Cell>
</Row>
Dim exceptionsReport = <?xml version="1.0"?>
[whole bunch of Excel formatting things]
<Worksheet ss:Name="Sheet1">
<Table ss:ExpandedRowCount= x:FullColumns="1" x:FullRows="1">
<Row ss:StyleID="s21">
<Cell><Data ss:Type="String">Var1</Data></Cell>
<Cell><Data ss:Type="String">Var2</Data></Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
So, that work's all nice, but I have a problem when I want to build multiple rows per entry. What I want to achive is:
VB.NET:
Dim exceptions = From letter In allLetters _
Where Not letter.CleanExceptionReason = "" _
Select <Row>
<Cell><Data ss:Type="String"><%= myVar1 %></Data></Cell>
</Row><Row>
<Cell><Data ss:Type="String"><%= myVar2 %></Data></Cell>
</Row>
So that each "letter" from my list generates two <Row>'s of data in the exceptions variable, to be injected into the XML below. VB's interpretation of the XML literal seems to be preventing me from doing this however....any thoughts?