{"id":2094,"date":"2019-03-25T17:38:01","date_gmt":"2019-03-25T20:38:01","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/kb36292-changing-a-reports-figure-at-run-time\/"},"modified":"2022-01-14T10:22:34","modified_gmt":"2022-01-14T13:22:34","slug":"kb36292-changing-a-reports-figure-at-run-time","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/","title":{"rendered":"KB-36292: Changing a Report&#8217;s figure at run time."},"content":{"rendered":"<div align=\"justify\">\n<p><span style=\"font-weight: bold;\">Question:<\/span><\/p>\n<p>Can I change a Report&#8217;s figure at run time before printing it?<\/p>\n<p><span style=\"font-weight: bold;\">Solution:<\/span><\/p>\n<p>Yes, you can. To do so, follow these procedures:<\/p>\n<p>1. Add a Historic with a field linked to an Internal Tag responsible for receiving the image&#8217;s path, and set it to not record registers anymore (recording time = 0);<br \/>\n2. On the Report, add a Figure object and a Data Field;<br \/>\n3. On the Report&#8217;s Query, write the following script:<\/p>\n<p><span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">SELECT TemperatureTable.E3TimeStamp,TemperatureTable.Temperature1,TemperatureTable.Temperature2 ,(select (LocalImage) from TabLocalImage) as Image<br \/>\nFROM TemperatureTable<br \/>\nWHERE ( TemperatureTable.E3TimeStamp\u00a0 > #<%InitialDate%>#\u00a0 AND\u00a0\u00a0 TemperatureTable.E3TimeStamp < #<%FinalDate%># )<br \/>\nORDER BY TemperatureTable.E3TimeStamp\u00a0 ASC<\/span><\/span><\/p>\n<p>4. On the Data Field&#8217;s <i>DataField <\/i>property, set the Image&#8217;s <i>Visible <\/i>property as False (variable created on the Query&#8217;s SQL tab);<br \/>\n5. On the Report, you must write the following script to pass the image&#8217;s path to the Report&#8217;s Figure object:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">Sub OnFormat<\/span><\/span><span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">Set FigureName = Report.Sections(&#8220;PageHeader&#8221;).Controls(&#8220;Field1&#8221;)<\/span><\/span><br \/>\n<span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">Set Image = Report.Sections(&#8220;PageHeader&#8221;).Controls(&#8220;Image1&#8221;)<\/span><\/span><br \/>\n<span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">Image.Picture = LoadPicture(FigureName)<\/span><\/span><span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">End Sub<\/span><\/span><\/p>\n<\/div>\n<p>6. Before printing the Report, you must pass the image&#8217;s path to the Historic&#8217;s register created on the first step:<\/p>\n<ul>\n<li>Create a Query in the same screen where the button that performs the printing is;<\/li>\n<li>Add a table with only a register of the image&#8217;s path;<\/li>\n<li>Add this register to the Query;<\/li>\n<li>On the SQL tab, enable the option to edit the SQL&#8217;s structure and write the following command:<\/li>\n<\/ul>\n<p><span style=\"font-family: Courier New;\">UPDATE TabLocalImage<\/span><br style=\"font-family: Courier New;\" \/><span style=\"font-family: Courier New;\">SET LocalImage = &#8216;<%ImagePath%>&#8216;<\/span><\/p>\n<ul>\n<li>On the script that prints the Report, add the following script lines to retrieve the image and update the image&#8217;s path on the Historic:<\/li>\n<\/ul>\n<div align=\"left\"><span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">&#8216;Loads the selected image into a tag to be saved on the Historic <\/span><\/span><br \/>\n<span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">Application.ShowFilePicker True, ImagePath<\/span><\/span><br \/>\n<span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">Application.GetObject(&#8220;Data.ImagePath&#8221;).Value = ImagePath<\/span><\/span><span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">&#8216;Records the image&#8217;s path on the Historic <\/span><\/span><br \/>\n<span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">Screen.Item(&#8220;ImageQuery&#8221;).SetVariableValue &#8220;ImagePath&#8221;, ImagePath<\/span><\/span><br \/>\n<span style=\"font-family: Courier New;\"><span style=\"background-color: #ffffff;\">Screen.Item(&#8220;ImageQuery&#8221;).Execute(True)<\/span><\/span><\/div>\n<p>For more details, check the attached example application.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<h3>Attachments:<\/h3>\n<p><a href=\"\/wp-content\/uploads\/2019\/03\/ExReportPhoto.zip\">ExReportPhoto.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: Can I change a Report&#8217;s figure at run time before printing it? Solution: Yes, you can. To do so, follow these procedures: 1. Add a Historic with a field&hellip;<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[761],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>KB-36292: Changing a Report&#039;s figure at run time. - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-36292: Changing a Report&#039;s figure at run time.\" \/>\n<meta property=\"og:description\" content=\"Question: Can I change a Report&#8217;s figure at run time before printing it? Solution: Yes, you can. To do so, follow these procedures: 1. Add a Historic with a field&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:38:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-01-14T13:22:34+00:00\" \/>\n<meta name=\"author\" content=\"Marco Antonio Gomes Silva\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Marco Antonio Gomes Silva\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/\"},\"author\":{\"name\":\"Marco Antonio Gomes Silva\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9\"},\"headline\":\"KB-36292: Changing a Report&#8217;s figure at run time.\",\"datePublished\":\"2019-03-25T20:38:01+00:00\",\"dateModified\":\"2022-01-14T13:22:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/\"},\"wordCount\":647,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Reports\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/\",\"name\":\"[:pt]KB-36292: Changing a Report&#039;s figure at run time.[:en]KB-36292: Changing a Report's figure at run time.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:38:01+00:00\",\"dateModified\":\"2022-01-14T13:22:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-36292: Changing a Report&#8217;s figure at run time.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9\",\"name\":\"Marco Antonio Gomes Silva\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g\",\"caption\":\"Marco Antonio Gomes Silva\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/marco\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-36292: Changing a Report's figure at run time. - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]KB-36292: Changing a Report&#039;s figure at run time.[:en]KB-36292: Changing a Report's figure at run time.[:] - Elipse Knowledgebase","og_description":"Question: Can I change a Report&#8217;s figure at run time before printing it? Solution: Yes, you can. To do so, follow these procedures: 1. Add a Historic with a field&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:38:01+00:00","article_modified_time":"2022-01-14T13:22:34+00:00","author":"Marco Antonio Gomes Silva","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Marco Antonio Gomes Silva","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/"},"author":{"name":"Marco Antonio Gomes Silva","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9"},"headline":"KB-36292: Changing a Report&#8217;s figure at run time.","datePublished":"2019-03-25T20:38:01+00:00","dateModified":"2022-01-14T13:22:34+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/"},"wordCount":647,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Reports"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/","url":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/","name":"[:pt]KB-36292: Changing a Report&#039;s figure at run time.[:en]KB-36292: Changing a Report's figure at run time.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:38:01+00:00","dateModified":"2022-01-14T13:22:34+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/kb36292-changing-a-reports-figure-at-run-time\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-36292: Changing a Report&#8217;s figure at run time."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fa6d0b4f046e3b2c208aaf84a40154e9","name":"Marco Antonio Gomes Silva","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7d19cf85bb457f81816ff5d785e3b9f4?s=96&d=mm&r=g","caption":"Marco Antonio Gomes Silva"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/marco\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2094"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=2094"}],"version-history":[{"count":3,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2094\/revisions"}],"predecessor-version":[{"id":12783,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2094\/revisions\/12783"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=2094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=2094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=2094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}