Can't export to Excel

I was able to export to excel just fine before I started adding upgrades to my grid and I can’t figure out which one is causing the problem. The error in firebug says that “mygrid is not defined”. Do I have to use the tab name in the submit button? Im confused and lost so any help would be nice. Thanks! BTW- I don’t get any error reports because it doesn’t get far enough to even start generating an excel file. Here is my code. Thanks!

<?php include '/dbc.php'; page_protect(); ?> Supplychex Hospital Dashboard .grid_hover { background-color: #D2E3EA; } .hover { background-color: navy; }
<body onLoad="doInitGrid();" marginwidth="0"; topmargin="0">
Log Out
Export to Excel

Providence Memorial Hospital

<?php $item='product'; $_SESSION['item'] = $item; ?>

Okay I have definitely narrowed it down to the tabbar. When I have one grid alone I can export fine but as soon as I add the tabs then firebug gives me the error “mygrid is undefined”. I assume I’m doing something simple wrong but I can’t find any examples of export to excel with tabbar. Are there any samples out there?

Figured it out. Solution below for whoever needs it. Had to pull the variables out of the function like so:

var mygrid;
var mygrid2;
var mygrid3;
function doInitGrid(){
tabbar = new dhtmlXTabBar(“a_tabbar”, “top”);
tabbar.setSkin(‘silver’);
tabbar.setImagePath(“codebase/imgs/”);
tabbar.addTab(“a1”, “Pending”, “150px”);
tabbar.addTab(“a2”, “Approved”, “150px”);
tabbar.addTab(“a3”, “Denied”, “150px”);
tabbar.setTabActive(“a1”);
tabbar.enableAutoReSize(true);
mygrid = tabbar.cells(“a1”).attachGrid();
mygrid3 = tabbar.cells(“a2”).attachGrid();
mygrid2 = tabbar.cells(“a3”).attachGrid();
var combo=mygrid.getCombo(6);
combo.put(2,‘Pending’);
combo.put(1,‘Approve’);
combo.put(0,‘Deny’);
mygrid.setImagePath(“codebase/imgs/”);…

Hi, good job.