Answer the question
In order to leave comments, you need to log in
How to make a line break during a loop when generating an XML file in a cell?
I generate an XML file like this:
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="Sheet1">
<Table>
<Row>
<Cell><Data ss:Type="String">№</Data></Cell>
<Cell><Data ss:Type="String">Фамилия</Data></Cell>
<Cell><Data ss:Type="String">Имя</Data></Cell>
<Cell><Data ss:Type="String">Адрес</Data></Cell>
<Cell><Data ss:Type="String">Примечание</Data></Cell>
<Cell><Data ss:Type="String">Телефон</Data></Cell>
<Cell><Data ss:Type="String">Газеты</Data></Cell>
</Row>
<% @subscribers.each.with_index 1 do |subscriber, index| %>
<Row>
<Cell><Data ss:Type="Number"><%= index %></Data></Cell>
<Cell><Data ss:Type="String"><%= subscriber.surname %></Data></Cell>
<Cell><Data ss:Type="String"><%= subscriber.name %></Data></Cell>
<Cell><Data ss:Type="String"><%= subscriber.address.name %></Data></Cell>
<Cell><Data ss:Type="String"><%= subscriber.address.description %></Data></Cell>
<Cell><Data ss:Type="String"><%= subscriber.main_phone %></Data></Cell>
<Cell><Data ss:Type="Text">
<% subscriber.subscriptions.each do |subscription| %>
<%= Newspaper.find(subscription.newspaper_id).name %><br />
<% end %>
</Data></Cell>
</Row>
<% end %>
</Table>
</Worksheet>
</Workbook>
<br />
, but it does not wrap the line in the cell. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question