I'm trying to create a pivot report based off the example in the help guide. I'm wondering how can I add footer filters for things like date range. Also, how do I make things link when you click on them? Right now when you click on a transaction number it goes to https://system.netsuite.com/app/site/hosting
instead of the actual record. Here is the suitelet
function runOpportunitiesPivot(request, response) { //Instantiate a report definition to work with var reportDefinition = nlapiCreateReportDefinition(); //Define the rows/column hierarchy and the actual column data var lamp = reportDefinition.addRowHierarchy('displayname', 'Lamp', 'TEXT'); var transdate = reportDefinition.addColumn('trandate', false, 'Date', null, 'TEXT', null); var trans = reportDefinition.addColumn('tranid', false, 'Trans', null, 'TEXT', null); var compstat = reportDefinition.addColumnHierarchy('custitemitemsubtype', 'Lamp Type', null, 'TEXT'); var quantitysold = reportDefinition.addColumn('quantity', true, 'Sold', compstat, 'INTEGER', null); var quantityship = reportDefinition.addColumn('quantityshiprecv', true, 'Shipped', compstat, 'INTEGER', null); var transstatus = reportDefinition.addColumn('statusref', false, 'Status', compstat, 'TEXT', null); //var qtysoldper = reportDefinition.addColumn('qtysoldp', false, 'Percent', null, 'PERCENT', 'F(quantity, quantityshiprecv) = (quantity/quantityshiprecv)*100'); //Create the search to feed the report var columns = new Array(); columns[0] = new nlobjSearchColumn('displayname', 'item', 'group'); columns[1] = new nlobjSearchColumn('custitemitemsubtype', 'item', 'group'); columns[2] = new nlobjSearchColumn('quantity', null, 'sum'); columns[3] = new nlobjSearchColumn('quantityshiprecv', null, 'sum'); columns[4] = new nlobjSearchColumn('tranid', null, 'group'); columns[5] = new nlobjSearchColumn('statusref', null, 'group'); columns[6] = new nlobjSearchColumn('trandate', null, 'group'); columns[2].setSort(); columns.push(columns[2]); //Add search to the report and map the search columns to the reports columns var filters = new Array(); filters[0] = new nlobjSearchFilter('upccode', 'item', 'startswith', 'ISNEWVOL'); reportDefinition.addSearchDataSource('salesorder', null, filters, columns, {'displayname':columns[0], 'custitemitemsubtype':columns[1], 'quantity':columns[2], 'quantityshiprecv':columns[3], 'tranid':columns[4], 'statusref':columns[5], 'trandate':columns[6]}); //Create a form to build the report on var form = nlapiCreateReportForm('Pivot Report Suitlet: OEM vs Compatible'); //Build the form from the report definition var pvtTable = reportDefinition.executeReport(form); //Write the form to the browser response.writePage(form); }I would also like to know how to make the groupings appear collapsed by default and not expanded. I would ALSO like to know how to sort the results based off the total column that gets generated