<script custom-tag="" type="application/ld+json">{"@context":"https://schema.org","@type":"TechArticle","headline":"Generate and embed a report is not working in UI page","image":"http://support.servicenow.com/29f1d2661baf6010cafa53d8624bcb43.iix","author":{"name":"ServiceNow Support","url":"http://support.servicenow.com/now"},"keywords":"ServiceNow, NowSupport public Knowledge Base articles, Support and Troubleshooting,KB0819321,Embed report, Generate and embed a report\r\nGenerate and embed a report is not working in UI page\r\n","wordcount":"190","publisher":"ServiceNow","url":"https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0819321","datePublished":"2020-03-27","dateCreated":"2020-03-27","dateModified":"2024-04-08","description":"<h2>Generate and embed a report is not working in UI page</h2><br/><div style=\"overflow-x:auto\"><article><div ><h3 >Issue </h3><section><p>The reports can be generated and embed (list report) from UI ","articleBody":"<h2>Generate and embed a report is not working in UI page</h2><br/><div style=\"overflow-x:auto\"><article><div ><h3 >Issue </h3><section><p>The reports can be generated and embed (list report) from UI page as per below documentation</p>\r\n<p><a href=\"https://docs.servicenow.com/csh?topicname=c_EmbeddingReportsInJelly.html&version=latest\" rel=\"nofollow\">https://docs.servicenow.com/csh?topicname=c_EmbeddingReportsInJelly.html&version=latest</a></p>\r\n<p>It is observed that the generate and embed report works fine in the Madrid version but does not work in Newyork or Orlando version.</p>\r\n<p>The UI page generate and embed script works fine for 'bar' chart type but throws the above error for 'list' in NY and Orlando versions</p>\r\n<p><span style=\"font-size: 18pt;\">Steps to Reproduce</span></p>\r\n<p>1. Copy the code from the below documentation link and click on the Try it on UI page<br /><a href=\"https://docs.servicenow.com/csh?topicname=c_EmbeddingReportsInJelly.html&version=latest\" rel=\"nofollow\">https://docs.servicenow.com/csh?topicname=c_EmbeddingReportsInJelly.html&version=latest</a></p>\r\n<p>2. Observe that it works fine for Bar chart but it throws NPE error for list report.</p></section></div><div ><h3 >Release</h3><section><p>Newyork and Orlando</p></section></div><div ><h3 >Resolution</h3><section><p>1. Please modify the script as below and the issue would be resolved<br />Modifications:<br />Existing filed: sysparm_field<br />Replace with : sysparm_field_list<br /><br /><br /></p>\r\n<pre><code><?xml version="1.0" encoding="utf-8"?><br /><j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"><br /><g:inline template="reporting_includes.xml" /><br /><g:requires name="scripts/GlideV2ChartingIncludes.js" includes="true"/><br /><div id="gr1" style="height:300px;width:300px;" /><br /><script><br />var params = {sysparm_title: "Dashboards", sysparm_field_list: "owner", sysparm_type: "list", sysparm_table: "pa_dashboards"};<br />var div = $j("#gr1");<br />embedReportByParams(div, params);<br /></script><br /></j:jelly><br /></code></pre>\r\n<p><br /><br /><br /></p></section></div></article></div>"}</script>