Home Community Uploads
image

Cireson Partners, Customers and Community members share your customizations and examples here to help benefit the community as a whole to earn Kudos and badges.

DISCLAIMER

All files and projects located here are provided and come "as-is" and without any warranty or support. Use at your own risk. Your use of Community Uploads is subject to our Terms of Use.

Cireson does not and will not support or maintain these enhancements, extensions, and scripts.

For Team Cireson uploads click here.

Excel / PDF Grid View Exports

Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭
edited December 2016 in Community Uploads
I have created a small custom.js file which enables a Excel / PDF Export of Grid Views.

This works for portal 6.0.x and thanks to Tom_Hendricks for finding the PDF workaround - also for 7.x !

In version 7.x of the portal the font file " DejaVuSans.ttf" must be copied to the  /Content/Kendo/2016.1.226/web/Fonts/ Folder for enabling the PDF Export  (the font can be obtained from sourcefrog).

The document.ready function is based on the idea of joivan_hedrick



Comments

  • AJ_WittenbrinkAJ_Wittenbrink Customer Adept IT Monkey ✭✭
    This is awesome.  The export to excel works great
  • Josh_GilliamJosh_Gilliam Customer IT Monkey ✭
    This is huge!  Thanks for sharing.  The only thing I might suggest to add is the total of each group if sorted in the view panel.  Just a thought.  :)


  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Just wondering what browsers this was tested with?
    Works fine in IE but I get an error in Chrome and Firefox.

    Error: Mismatched anonymous define() module: function (){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c.encode=function(a){for(var b,c,e,f,g,h,i,j="",k=0;k<a.length;)b=a.charCodeAt(k++),c=a.charCodeAt(k++),e=a.charCodeAt(k++),f=b>>2,g=(3&b)<<4|c>>4,h=(15&c)<<2|e>>6,i=63&e,isNaN(c)?h=i=64:isNaN(e)&&(i=64),j=j+d.charAt(f)+d.charAt(g)+d.charAt(h)+d.charAt(i);return j},c.decode=function(a){var b,c,e,f,g,h,i,j="",k=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k<a.length;)f=d.indexOf(a.charAt(k++)),g=d.indexOf(a.charAt(k++)),h=d.  

    Currently seeing error on both 7.1 and 7.2 portals. Error causes the tables not to build.
  • Josh_GilliamJosh_Gilliam Customer IT Monkey ✭
    Not sure about the testing, but I know it currently works in Chrome and IE in our environment: v7.2.2012.1.  

    The only thing I would recommend trying is resetting the view if you have any current groupby's setup. We had to do this to get it to work.  
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭
    Reset all my views and browser cache. Still getting the error. Thanks for the suggestion.
  • Magnus_Lundgren1Magnus_Lundgren1 Customer Adept IT Monkey ✭✭
    Is it possible to get the export function to the search grids?
  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭
    Hi Brian, I've just made a quick test with Chrome (Version 55.0.2883.87 m (64-bit)) and Firefox (49.0.2) - with both browser i got no errors (on Portal Version 6.x) - on a Windows based environment.


    Maybe I can create a 7.x dev. environment within the next days - I will check this.
  • Daran_StokesDaran_Stokes Customer IT Monkey ✭

    Just had this request for one of the guys.

    Imported the .js file. Works well.

     Love it!

  • Jerry_VeldhuisJerry_Veldhuis Customer Advanced IT Monkey ✭✭✭
    edited March 2017
    Not sure if anyone else hit this, but the errors below will appear when you navigate to a Request Offering form that contains an options for attachments, which creates a grid view.
    <pre class="CodeBlock"><code><div>Uncaught ReferenceError: require is not defined
    &nbsp; &nbsp; at RK_XLSX_ExportAddButtons (eval at <anonymous> (jquery.min.js?v=799:3), <anonymous>:30:5)
    &nbsp; &nbsp; at MutationObserver.eval (eval at <anonymous> (jquery.min.js?v=799:3), <anonymous>:14:5)
    RK_XLSX_ExportAddButtons @ VM2487:30 (anonymous) @ VM2487:14</div>
    Solution was to add simple check to see if you were on the My Requests, My Work or My Team Work pages and not attempt to add the excel button on other pages.
    <div>if ( window.location.pathname == "/View/c5161e06-2378-4b44-aa89-5600e2d3b9d8" ||
         window.location.pathname == "/View/cca5abda-6803-4833-accd-d59a43e2d2cf" ||
         window.location.pathname == "/View/f94d43eb-eb42-4957-8c48-95b9b903c631" <span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">) {
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">      // configure the observer and start the instance.
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">       var observerConfig = { attributes: true, childList: true, subtree: true, characterData: true };
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">       observer.observe(mainPageNode, observerConfig);
    </span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">}</span></div>
  • Philipp_SchäferPhilipp_Schäfer Member IT Monkey ✭
    edited March 2017
    I am using the community portal Ver. 7.2.2016.1 and i did not see the buttons.
    I have different views with grid inside but they are not appear. Do you know what i can do?

    I have added the js-file as EXCEL_PDF_Export.js to my customspace folder and insert it to the custom.js via 
    loadScript("/CustomSpace/EXCEL_PDF_Export.js");
  • Ken_CurtisKen_Curtis Customer IT Monkey ✭
    Is there a way to get this to work on a search results screen so that closed tickets are easily added and exported?
  • Donna_KennedyDonna_Kennedy Member IT Monkey ✭
    I have installed this in our environment and it works great for most of us, but we have some users that only get the menu bar now and they are getting the error message "MutationObserver is undefined".  It works for them in Chrome, but not in IE.  Do you have any suggestions on what we can try here?
  • Roland_KindRoland_Kind Partner Advanced IT Monkey ✭✭✭
    edited March 2017

    Hi, I have modified the custom.js a little bit and it should work on searches now. I have not fully tested it with every possible combination of browsers and operating systems  - but it runs in my testing environment (with Chrome, Firefox and MS browsers). I found one issue regarding the Excel Export in the search results: it does not work with "all work items including activities" - which I have not further analyzed for the root cause. It was no problem when I have selected "Service Requests, Incidents etc.


  • Chris_StelzerChris_Stelzer Premier Partner IT Monkey ✭
    Has anyone managed to get these functions working on SQL Table Widgets in Dashboards?
Sign In or Register to comment.