<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[API to set Excel template]]></title><description><![CDATA[<p>For a report using an Excel template, is there an API call to set/update the excel template file?</p>
]]></description><link>https://forum.jsreport.net/topic/524/api-to-set-excel-template</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 15:57:54 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/524.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 08 May 2018 07:57:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to API to set Excel template on Invalid Date]]></title><description><![CDATA[<p>For a report using an Excel template, is there an API call to set/update the excel template file?</p>
]]></description><link>https://forum.jsreport.net/post/2605</link><guid isPermaLink="true">https://forum.jsreport.net/post/2605</guid><dc:creator><![CDATA[cesartl]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to API to set Excel template on Invalid Date]]></title><description><![CDATA[<p>yes, you will need to first insert the excel template and then update your main template (that uses xlsx recipe) to use the new created xlsx template.</p>
<p>(assuming that your jsreport server is started on <code>localhost</code> and port <code>5488</code>)</p>
<p>to insert the excel template you can do a POST json request to <code>http://localhost:5488/odata/xlsxTemplates</code> with the following body:</p>
<pre><code class="language-js">{
  &quot;name&quot;:&quot;demo&quot;, // the name of your xlsx template
  &quot;contentRaw&quot;:&quot;UEsDBBQABgAIAAAAIQA7SI5AaQEAAMQE...&quot; // the content of the xlsx file in base64 encoded string
}
</code></pre>
<p>this call will return a <code>shortid</code> property in the reponse, you will need that in order to update your main template.</p>
<p>then to update the template (the one that have the xlsx recipe) you can make a <code>PATCH</code> request to <code>http://localhost:5488/odata/templates(gx4cQ2WOrlStm6hD)</code> (where what is inside the <code>()</code> is the <code>_id</code> of your main template) and include in the body something like this:</p>
<pre><code class="language-js">{
 ...other properties of your main template here...
 xlsxTemplate: {
   shortid: 'put here the shortid that was returned from the first post request'
 }
 ...
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/2608</link><guid isPermaLink="true">https://forum.jsreport.net/post/2608</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to API to set Excel template on Invalid Date]]></title><description><![CDATA[<p>Perfect thanks</p>
]]></description><link>https://forum.jsreport.net/post/2611</link><guid isPermaLink="true">https://forum.jsreport.net/post/2611</guid><dc:creator><![CDATA[cesartl]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>