[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Add button to grid that generates a PDF

  • Thread starter Thread starter Ricardo Perdigao
  • Start date Start date
Status
Not open for further replies.
R

Ricardo Perdigao

Guest
Hi Richard, I've got the sample I was writing for you to get this far: - Query the row where you clicked the button - Place the content of that Row in a variable/object called data - Open a new Browser Window using the "CustNum" field from that row - Open a PDF file with the name >.pdf from my TOMCAT (webapps\ROOT\static) Here is the updated Onshow Logic: onShow($scope) { console.log('Show'); this.scope = $scope; global.showDetails = function showDetails(e) { e.preventDefault(); var tr = $(e.target).closest("tr"); // get the current table row (tr) var data = this.dataItem(tr); window.open('http://localhost:8810/static/' + data.CustNum + '.pdf', 'PDF Window', 'toolbar=no'); }; var newCommand = {command: { text: "View Details", click: showDetails }, title: " ", width: "180px" }; this.$model.options.columns.push(newCommand); } I am not an expert on Angular/JavaScript and this is based on my limited knowledge on that language ... But it worked on my environment. The only missing piece is that all PDF files would have to already be stored on the WebServer/Tomcat for this to work. An alternative would be to write something more complex to read the PDF from a Database BLOB field. Or only write the PDF to the WebServer once the customer Clicks on the button (I would use a single PDF that I would override over and over again). Hope this gets you started or on the correct direction ...

Continue reading...
 
Status
Not open for further replies.
Back
Top