{"id":153,"date":"2020-02-24T09:02:32","date_gmt":"2020-02-24T14:02:32","guid":{"rendered":"http:\/\/gabrielguzman.com\/blog\/?p=153"},"modified":"2020-02-24T11:38:46","modified_gmt":"2020-02-24T16:38:46","slug":"apex-office-print-101-oracle-apex-document-printing","status":"publish","type":"post","link":"https:\/\/gabrielguzman.com\/blog\/en\/apex-office-print-101-oracle-apex-document-printing\/","title":{"rendered":"APEX Office Print 101: Oracle APEX Document Printing"},"content":{"rendered":"<p><em><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">This is the beginning of a series of entries that revolve around<\/span><\/span> <a href=\"http:\/\/gabrielguzman.com\/blog\/en\/category\/oracle-en\/oracle-apex-en\/aop-en\/\">APEX Office Print<\/a> <span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">and its integration with<\/span><\/span> <a href=\"http:\/\/gabrielguzman.com\/blog\/en\/category\/oracle-en\/oracle-apex-en\/\">Oracle APEX<\/a>.<\/em><\/p>\n<hr \/>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">A usual requirement from the clients with whom I have worked, and that have applications in Oracle APEX, is to be able to print their data, reports, and forms quickly, with options for multiple formats and types of documents.<\/span> <span class=\"\" title=\"\">Every Oracle APEX consultant has faced this issue at least once in his career, which can cause headaches since there are not many ways to do this out of the box, and the customization options are quite limited.<\/span><\/span><\/p>\n<p>The decision to create Printer Friendly pages (an option that many of us considered when we were working with previous APEX versions like 3.x and 4.x) causes a huge technological debt, leaving the application at the mercy of each browser particularities and any change that the theme and templates assigned to the application may suffer in the future.<\/p>\n<p>Several external solutions can help solve this problem, including BI Publisher, PL \/ PDF, and AOP, the latter being the one we will be checking in this post.<!--more--><\/p>\n<h3><strong>Presenting, APEX Office Print <\/strong><\/h3>\n<p><a href=\"https:\/\/www.apexofficeprint.com\/\" rel=\"noopener noreferrer\">AOP<\/a> <span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">allows you to generate documents and reports with a highly customized format, based on templates that are sent along with the information to be included in the final document in JSON format. Such templates can be intended for Word, Excel, PDF, PowerPoint, or HTML.<\/span><\/span><\/p>\n<p><span class=\"\" title=\"\">Its architecture is based on a web server with the ability to scale itself depending on the number of available cores, waiting for requests that come with a JSON payload.<\/span> <span class=\"\" title=\"\">This server can be used for both local deployments and the Cloud, and it has REST and PL \/ SQL APIs, as well as an Oracle APEX plugin that allows for a quick integration of the app reports with the tool.<\/span><\/p>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><a href=\"http:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/aop_architecture.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-143 size-large\" title=\"AOP Architecture\" src=\"http:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/aop_architecture-1024x546.png\" alt=\"AOP Architecture\" width=\"604\" height=\"322\" srcset=\"https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/aop_architecture-1024x546.png 1024w, https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/aop_architecture-300x160.png 300w, https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/aop_architecture-768x410.png 768w, https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/aop_architecture-1536x820.png 1536w, https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/aop_architecture-2048x1093.png 2048w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><figcaption><em>APEX Office Print Architecture (Source: http:\/\/apexofficeprint.com\/docs\/)<\/em><\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">AOP is a template-based tool, and those templates can be created in any editor and uploaded to the application files to be invoked by the plugin.<\/span> <span class=\"\" title=\"\">The tool supports templates for multiple formats and handles different tags to define the location and manipulation of the data that is being sent to the server.<\/span><\/span><\/p>\n<p><span title=\"\">Thanks to the integration with APEX that I mentioned previously, we find several use cases:<\/span><\/p>\n<ul>\n<li><strong><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">Direct printing of reports and interactive grids from APEX<\/span><\/span><\/strong>, <span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">by simply indicating in the plugin the ID assigned to each one of them. Those are also referenced in the template with the corresponding tags, to be formatted and printed accordingly.<\/span><\/span><\/li>\n<li><strong>Document printing with a query from APEX, <\/strong><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">which is supported by the plugin itself.<\/span> <span class=\"\" title=\"\">In its options, you can define a query that will be executed to extract the information to be sent to the server.<\/span> <span class=\"\" title=\"\">This query requires a certain format so it can be interpreted and converted to JSON, but its content can be adapted to what we require in order to fill our template.<\/span><\/span><\/li>\n<li><strong>Document printing from the database, <\/strong>which can be used when<span class=\"tlid-translation translation\" lang=\"en\"><span title=\"\"> more complex logic and processing is required before or in tandem with the tool.<\/span> <span title=\"\">This is a more advanced option that gives total control over server calls using the PL \/ SQL API.<\/span><\/span><\/li>\n<\/ul>\n<h3><strong>APEX Office Print Costs<br \/>\n<\/strong><\/h3>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">You can often hear that if something is good and pretty, it cannot be cheap.<\/span> <span class=\"\" title=\"\">Fortunately, the AOP team offers a free cloud plan for those who want to experiment with the tool.<\/span> <span class=\"\" title=\"\">Of course, this plan has its limitations, but it serves as a perfect start for those who are evaluating how to update and improve the printing options of their applications.<\/span> <span title=\"\">The cloud plans available as of February 24th, 2020 are:<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<figure class=\"wp-block-image\"><a href=\"http:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/apex-office-print-cloud-plan.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-148 size-large\" title=\"AOP Cloud Plans\" src=\"http:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/apex-office-print-cloud-plan-1024x598.png\" alt=\"AOP Cloud Plans\" width=\"604\" height=\"353\" srcset=\"https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/apex-office-print-cloud-plan-1024x598.png 1024w, https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/apex-office-print-cloud-plan-300x175.png 300w, https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/apex-office-print-cloud-plan-768x448.png 768w, https:\/\/gabrielguzman.com\/blog\/wp-content\/uploads\/2020\/02\/apex-office-print-cloud-plan.png 1095w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><figcaption><em>APEX Office Print Cloud plans (Source: http:\/\/apexofficeprint.com\/)<\/em><\/figcaption><\/figure>\n<p><span class=\"tlid-translation translation\" lang=\"en\"><span class=\"\" title=\"\">You can see that for each plan they provide a monthly quota for the regular reports, with an unlimited number of reports in developer mode, which is included since AOP 19.1 and allows calls to be made to the Cloud server without the main credits being affected. This<\/span><span class=\"\" title=\"\"> is perfect for testing new developments.<\/span> <span class=\"\" title=\"\">Please note that the documents created in developer mode will include a watermark at the time of being generated, which is a common practice when dealing with these test modes.<\/span><\/span><\/p>\n<p>To close this introductory post to the world of AOP, I&#8217;ll leave some links that may be helpful if you&#8217;re planning to do an initial approach to the tool:<\/p>\n<ul>\n<li>In <a href=\"https:\/\/www.apexofficeprint.com\/ords\/f?p=504\" rel=\"noopener noreferrer\">this application<\/a>, you will be able to create a free Cloud account for your tests.<\/li>\n<li>You can also check the <a href=\"https:\/\/www.apexofficeprint.com\/ords\/f?p=AOP_SAMPLE_APP_WEB:LOGIN_DESKTOP\" rel=\"noopener noreferrer\">example application<\/a> available on the site.<\/li>\n<li>If you have any technical questions, you can always check the <a href=\"http:\/\/apexofficeprint.com\/docs\/\" rel=\"noopener noreferrer\">official documentation<\/a>.<\/li>\n<\/ul>\n<hr \/>\n<p><em>In future entries, we will be checking some of the options that AOP provides and its use with specific cases. <\/em><\/p>\n<p><em>See you next time!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the beginning of a series of entries that revolve around APEX Office Print and its integration with Oracle APEX. A usual requirement from the clients with whom I have worked, and that have applications in Oracle APEX, is to be able to print their data, reports, and forms quickly, with options for multiple &hellip; <a href=\"https:\/\/gabrielguzman.com\/blog\/en\/apex-office-print-101-oracle-apex-document-printing\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">APEX Office Print 101: Oracle APEX Document Printing<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":144,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[130,124],"tags":[139,141,97],"class_list":["post-153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aop-en","category-oracle-apex-en","tag-aop-en","tag-apex-en","tag-oracle"],"_links":{"self":[{"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":7,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/posts\/153\/revisions\/163"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/media\/144"}],"wp:attachment":[{"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gabrielguzman.com\/blog\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}