title: SAPUI5/ OPENUI5 javascript view HTML element render
body: <p>I am new to SAPUI5/ OPENUI5 I have created a javascript view which basically imports several graphs and chart library and like a utility, it creates multiple charts and graphs and tables with icons</p>
  
  <p>below is the code for the same
  below is Js (sap ui JS view which creates graph)</p>
  
  <pre><code>jQuery.sap.require("some.graph.lib");
  jQuery.sap.require("some.util.lib");
  jQuery.sap.require("some.other.imports");
  (function(){
  
      sas.hc.ui.core.mvc.JSView.extend(" reports.dashboard.BaseDashboard.prototype.addCrossTab", {
  
          metadata : {
              properties : {
                  chartRequired:false,
                  tableDataRequired:false
              },
          },
  
          rb: sap.ui.getCore().getLibraryResourceBundle("sas.csb.common"),
  
    reports.dashboard.BaseDashboard.prototype.createGraphics = function (data) {
      //This Function creates barchart, line charts and cross tab tables
          return this.mainContentPane;
      };
  
      //Some other code to create and render graph
  })();
  </code></pre>
  
  <p>I am creating another view in which I am importing above view and making ajax call so that I can create graphs and tables and send it as base64 encoded string to REST API to save into a PDF at the server side.</p>
  
  <pre><code>jQuery.sap.require("sas.cscommon.util.JSONUtil");
  jQuery.sap.require({modName: "reports.dashboard.MeasureDashboard", type: "view"});
  
  (function(){
  
      var rb = sap.ui.getCore().getLibraryResourceBundle("sas.csb.backtesting");
  
      //some other method
  
       sas.csb.backtesting.ModelList.prototype.downloadModelReport = function(event) { 
          var id = "sample";
              var oView = new reports.dashboard.MeasureDashboard(id, {
                              viewName: "reports.dashboard.MeasureDashboard",
                              chartrequired: true
                          } );
  
  
          //Calling REST API to get data
          oView.createGraphics(data);
  }
  </code></pre>
  
  <p>How to convert this javascript sapui5 oView Object without displaying it to the user into the HTML element so that I can have the canvas and other graphics to convert into a base 64 encoded string and pass it to REST API to save at server end  ?</p>
  
  <p>I want to access the canvas html element from the view object without rendering the view on screen.</p>
  
  <p>I know there is a renderer attached with sapui5 control and RenderManager in sapui5 but its not helping.</p>