• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Help with Export to Excel

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with Export to Excel

    We are using Valence 3, and I've used the extjs4 scripts.
    Code:
    <script type="text/javascript" src="/extjs4/ext-all.js"></script>
    <script type="text/javascript" src="/vvresources/valence-extjs4.js"></script>
    I'm trying to use the standard fnExportToCSV function as seen here...

    Code:
    function fnExportToCSV(){
    		var tb = Ext.getCmp('mainIVLCCYGrid').getDockedItems();
    		if (!dsMainIVLCCYGrid.sortInfo) {
    			//var sortFld = '';
    			//var sortDir = '';
    		}
    		else {
    			sortFld = dsmainIVLCCYGrid.sortInfo.field;
    			sortDir = dsmainIVLCCYGrid.sortInfo.direction;
    		}
    		Ext.DomHelper.append(document.body, {
    			tag: 'iframe',
    			frameBorder: 0,
    			width: 0,
    			height: 0,
    			css: 'display:none;visibility:hidden;height:1px;',
    			src: 'vvcall.pgm?sid=' + sid + '&app=' + app + '&pgm=IVLCCY&action=getCSV&limit=' + tb.pageSize + '&start=' + tb.cursor +
    			'&sort=' +
    			sortFld +
    			'&dir=' +
    			sortDir
    		});
    		
    	}
    In my console on chrome, I'm getting the error: Uncaught ReferenceError: sid is not defined.

    Any advice to get this working properly? If I remove the sid part of the URL, the next error I get says that app is undefined.

    Thanks,
    Chris

  • #2
    This should work:


    Code:
    src: 'vvcall.pgm?sid=' + sessionStorage.sid + '&app=' + Ext.getUrlParam('app') + '&pgm=IVLCCY&action=getCSV&limit=' + tb.pageSize + '&start=' + tb.cursor +
    			'&sort=' +
    			sortFld +
    			'&dir=' +
    			sortDir
    Note: the next maintenance update of 3.0 includes a much easier method:

    Code:
    Valence.util.download({
        pgm : 'IVLCCY',
        action : 'getCSV',
        etc.....
    });

    Comment


    • #3
      Thanks for the Response

      Now I'm getting the error:

      Uncaught TypeError: Cannot call method 'append' of undefined

      I definitely look forward to the upcoming release.

      Comment


      • #4
        Code:
        Ext.DomHelper.append
        has been changed to....

        Code:
        Ext.core.DomHelper.append
        for Ext4.

        Comment


        • #5
          Thanks!

          That did the trick!

          Comment

          Working...
          X