Template to export ALL avaible fields into Excel
#2
Hi, 

I have been able to do some advences to export all the fields to excel.  Right now, I have a template to export basically all information for "movies", but I always get an error when introducing some field from "Mediafile" and I don't know how to export both "movies" and "mediafile" variables to an excel file.

Here is my template:

Code:

<?xml version="1.0" encoding="UTF-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urnConfusedchemas-microsoft-com:officeConfusedpreadsheet"
xmlns:o="urnConfusedchemas-microsoft-com:office:office"
xmlns:x="urnConfusedchemas-microsoft-com:office:excel"
xmlnsConfuseds="urnConfusedchemas-microsoft-com:officeConfusedpreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">

<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s22">
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
</Style>
<Style ss:ID="s23">
<Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
<NumberFormat ss:Format="Short Date"/>
</Style>
</Styles>

<Worksheet ss:Name="movielist">
<Table x:FullColumns="1" x:FullRows="1" ssBig GrinefaultColumnWidth="60">

<Column ss:Width="200.00"/>
<Column ss:Width="200.00"/>
<Column ss:Width="200.00"/>
<Column ss:Width="200.00"/>
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="70.00" ss:StyleID="s23" />
<Column ss:Width="70.00" ss:StyleID="s23" />
<Column ss:Width="70.00" ss:StyleID="s23" />
<Column ss:Width="300.00"/>
<Column ss:Width="300.00"/>
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="200.00"/>
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="200.00"/>
<Column ss:Width="200.00"/>
<Column ss:Width="200.00"/>
<Column ss:Width="200.00"/>
<Column ss:Width="200.00"/>
<Column ss:Width="200.00"/>
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="33.00" ss:StyleID="s22" />
<Column ss:Width="200.00"/>

${foreach movies movie}
<Row>
<Cell><Data ss:Type="String">${movie.title}</Data></Cell>
<Cell><Data ss:Type="String">${movie.originalTitle}</Data></Cell>
<Cell><Data ss:Type="String">${movie.tagline}</Data></Cell>
<Cell><Data ss:Type="String">${movie.plot}</Data></Cell>
<Cell><Data ss:Type="Number">${movie.year}</Data></Cell>
<Cell><Data ss:Type="String">${movie.imdbId}</Data></Cell>
<Cell><Data ss:Type="DateTime">${movie.dateAdded;date(yyyy-MM-dd)}T00:00:00.000</Data></Cell>
<Cell><Data ss:Type="String">${movie.path}</Data></Cell>
<Cell><Data ss:Type="String">${movie.releaseDateAsString}</Data></Cell>
<Cell><Data ss:Type="String">${movie.movieSet}</Data></Cell>
<Cell><Data ss:Type="String">${movie.movieSetTitle}</Data></Cell>
<Cell><Data ss:Type="String">${movie.certification}</Data></Cell>
<Cell><Data ss:Type="String">${movie.country}</Data></Cell>
<Cell><Data ss:Type="String">${movie.genresAsString}</Data></Cell>
<Cell><Data ss:Type="String">${movie.rating}</Data></Cell>
<Cell><Data ss:Type="String">${movie.tmdbId}</Data></Cell>
<Cell><Data ss:Type="String">${movie.spokenLanguages}</Data></Cell>
<Cell><Data ss:Type="String">${movie.tagsAsString}</Data></Cell>
<Cell><Data ss:Type="String">${movie.mediaInfoAudioCodecAndChannels}</Data></Cell>
<Cell><Data ss:Type="String">${movie.mediaInfoVideoCodec}</Data></Cell>
<Cell><Data ss:Type="String">${movie.mediaInfoVideoFormat}</Data></Cell>
<Cell><Data ss:Type="String">${movie.mediaInfoVideoResolution}</Data></Cell>
<Cell><Data ss:Type="String">${movie.mediaInfoVideoBitrate}</Data></Cell>
<Cell><Data ss:Type="String">${movie.hasMetadata}</Data></Cell>
<Cell><Data ss:Type="String">${movie.duplicate}</Data></Cell>
<Cell><Data ss:Type="String">${movie.hasImages}</Data></Cell>
<Cell><Data ss:Type="String">${movie.hasNfoFile}</Data></Cell>
<Cell><Data ss:Type="String">${movie.disc}</Data></Cell>
<Cell><Data ss:Type="String">${movie.hasRating}</Data></Cell>
<Cell><Data ss:Type="String">${movie.hasTrailer}</Data></Cell>
<Cell><Data ss:Type="String">${movie.runtimeFromMediaFiles}</Data></Cell>
<Cell><Data ss:Type="String">${movie.runtimeFromMediaFilesInMinutes}</Data></Cell>
<Cell><Data ss:Type="String">${movie.runtime}</Data></Cell>

</Row>
${end}

</Table>
</Worksheet>
</Workbook>
 

What do I have to write in order to export, let's say... Filename or extensión?
Do I have to do another "foreach..."? Or I can add another line below "movie.runtime" in order to get the filename? In this last case... how? I get an error if I just write this sentence bellow...

    <Cell><Data ss:Type="String">${movie.filename}</Data></Cell>

Thanks in advanced.


Messages In This Thread
RE: Template to export ALL avaible fields into Excel - by jhoyos - 2019-05-27, 10:24
Logout Mark Read Team Forum Stats Members Help
Template to export ALL avaible fields into Excel1