<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Export jQGrid data to Excel - Solution that worked for me</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31312</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31312</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>I have already answer of your question. </p>
<p>Â </p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Thu, 30 Oct 2014 14:31:19 +0200</pubDate>
        </item>
        <item>
        	<title>mcfarland on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31304</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31304</guid>
        	        	<description><![CDATA[<p>hi tony,</p>
<p>Â Â Â Â Â Â Â Â Â Â Â Â  i didn't understood your answer.</p>
<p>We are using filter tool bar on export to excel;the export to excel code was copied from code project (Mikes).The problem is that we are able to get all the records to excel from grid,when we filter with particular name we get some records like 10 records i need those 10 records to excel ,if we do filter also we are getting all the records to excel not filtered records.</p>
<p>$("#list").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: true, defaultSearch: "cn" }).navButtonAdd(</p>
<p>'#pager', {caption:"Export to Excel",</p>
<p>buttonicon:"ui-icon-disk",</p>
<p>onClickButton:function() {ExportDataToExcel("#list");</p>
<p>},</p>
<p>position:"last"</p>
<p>});</p>
<p>Â </p>
<p>function ExportDataToExcel(tableCtrl) {</p>
<p>ExportJQGridDataToExcel(tableCtrl,"sample.xlsx");</p>
<p>}</p>
<p>Â </p>
<p>function ExportJQGridDataToExcel(tableCtrl, excelFilename) {Â Â </p>
<p>var allJQGridData = $(tableCtrl).jqGrid('getGridParam', 'data');</p>
<p>Â // var allJQGridData = $(tableCtrl).jqGrid('getRowData');</p>
<p>Â var jqgridRowIDs = $(tableCtrl).getDataIDs(); // Fetch the RowIDs for this grid</p>
<p>Â var headerData = $(tableCtrl).getRowData(jqgridRowIDs[0]);</p>
<p>If i comment getgrid param and if i use getrowdata i cna get filtered records but not all ...</p>
<p>i want to satisy both the condiitons how can i acheive this..</p>
]]></description>
        	        	<pubDate>Wed, 29 Oct 2014 18:14:58 +0200</pubDate>
        </item>
        <item>
        	<title>Jim P on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31279</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31279</guid>
        	        	<description><![CDATA[<p>Hi Betty,</p>
<p>I created my grids a few years ago and there wasn't away to dump everything to excel.</p>
<p>All of my pages use a Cold Fusion cfc function on the server end.Â  Before I return the data I set a session variable to the value of the query data.</p>
<p>here's and example: I have a function that returns different types of sales orders (phone orders, shipped, not shipped)</p>
<p>Â Â &#60;!--- Save for ExportÂ  ---&#62;<br />
Â Â Â Â  &#60;cfswitch expression="#Arguments.OpenShpd#"&#62;<br />
Â Â Â Â Â Â  &#60;cfcase value="O"&#62;&#60;cfset session.DumpSO = get_so&#62;&#60;/cfcase&#62;<br />
Â Â Â Â Â Â  &#60;cfcase value="N"&#62;&#60;cfset session.DumpSNS = get_so&#62;&#60;/cfcase&#62;<br />
Â Â Â Â Â Â  &#60;cfcase value="S"&#62;&#60;cfset session.DumpSOS = get_so&#62;&#60;/cfcase&#62;<br />
Â Â Â Â  &#60;/cfswitch&#62;</p>
<p>Then on my gridpage above my grid I have linksÂ Â  [To PDF]Â Â  andÂ  [To Excell] options (these icons and words)</p>
<p>When the user clicks one of these links it sends them to a page that recreates the data in the the chosen format.</p>
<p>Because these are links I can passÂ url parameters using jquery to gather filter data.</p>
<p>Jim</p>
<p>Â Â </p>
]]></description>
        	        	<pubDate>Tue, 21 Oct 2014 22:25:35 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31248</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31248</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>It is difficult.</p>
<p>If you use server side sorting and data, this should happen, sincxe the grid has only the needed portion.</p>
<p>If you use local data you can use the grid data parameter to get all the data.</p>
<p>Â </p>
<div class="sfcode">
<pre class="brush-javascript syntax">var allJQGridData = $(tableCtrl).jqGrid('getGridParam','data');</pre></div><p>Regards</p>
]]></description>
        	        	<pubDate>Tue, 21 Oct 2014 15:56:08 +0300</pubDate>
        </item>
        <item>
        	<title>mcfarland on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31216</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p31216</guid>
        	        	<description><![CDATA[<p>Hi betty,</p>
<p>Â Â Â Â Â Â Â Â Â Â Â Â Â  I am wondering like if you find the solution for (</p>
<p>If I like to export all data (e.g. totally 18 records, 10 displayed in current grid and 8 in second grid page), is there a way to capture all 18 records without invoking the backend?)</p>
<p>because mine also the same problem,i am not finding any solution only first page data is capturing in excel ...</p>
<p>I am using</p>
<p>var jqgridRowIDs = $(tableCtrl).getDataIDs(); // Fetch the RowIDs for this grid</p>
<p>Â var allJQGridData = $(tableCtrl).jqGrid('getRowData');</p>
<p>Â var headerData = $(tableCtrl).getRowData(jqgridRowIDs[0]);</p>
<p>Â </p>
<p>Plz help me out.....</p>
]]></description>
        	        	<pubDate>Fri, 10 Oct 2014 02:57:20 +0300</pubDate>
        </item>
        <item>
        	<title>betty on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p9196</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p9196</guid>
        	        	<description><![CDATA[<p>Thanks for sharing the code. It works. But only the data in current grid was captured using the following method</p>
</p>
<p>&#160;&#160;&#160; "mya=jQuery(&#8221;#list2&#8243;).getDataIDs();&#160; // Get All IDs"</p>
</p>
<p>If I like to export all data (e.g. totally 18 records, 10 displayed in current grid and 8 in second grid page), is there a way to capture all 18 records without invoking the backend?</p>
</p>
<p>Thanks.</p>
<p>Betty</p>
]]></description>
        	        	<pubDate>Tue, 01 Sep 2009 16:29:09 +0300</pubDate>
        </item>
        <item>
        	<title>Jim P on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p5192</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p5192</guid>
        	        	<description><![CDATA[<p>When I try the code I get the following error:</p>
<p><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch">document.formstyle is undefined</span></p>
<p><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch">in Firebug.</span></p>
<p><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch">on this line:</span></p>
<p><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch"><span class="sourceRowText">document.formstyle.csvBuffer.value=html;</span></span></p>
<p><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch"><span class="sourceRowText">which is the first one of that type.&#160;&#160; I&#39;m not a php coder and just a beginner with js and jqgrid.&#160; Any help would be appreciated.</span></span></p>
<p><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch"><span class="sourceRowText">TIA</span></span></p>
<p><span class="objectBox objectBox-errorMessage hasTwisty hasBreakSwitch"><span class="sourceRowText">Jim</span></span></p></p>
]]></description>
        	        	<pubDate>Mon, 09 Mar 2009 13:03:08 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p4395</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p4395</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thank you for shering the code with the community.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 05 Feb 2009 02:16:31 +0200</pubDate>
        </item>
        <item>
        	<title>seetharaman on Export jQGrid data to Excel - Solution that worked for me</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p4365</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/export-jqgrid-data-to-excel-solution-that-worked-for-me#p4365</guid>
        	        	<description><![CDATA[</p>
<p>I use the following javascript function from my code to export the jQGrid data. This works for me. I use a JSP to open the excel. Same code can be simulated in PHP also. Hope someone will benefit from this snippet</p>
<p>function export1()<br />{<br />&#160;&#160;&#160; var mya=new Array();<br />&#160;&#160;&#160; mya=jQuery("#list2").getDataIDs();&#160; // Get All IDs<br />&#160;&#160;&#160; var data=jQuery("#list2").getRowData(mya[0]); &#160;&#160;&#160; // Get First row to get the labels<br />&#160;&#160;&#160; var colNames=new Array();&#160; <br />&#160;&#160;&#160; var ii=0;<br />&#160;&#160;&#160; for (var i in data){colNames[ii++]=i;}&#160;&#160;&#160; // capture col names<br />&#160;&#160;&#160; var html="";<br />&#160;&#160;&#160; for(i=0;i&#60;mya.length;i++)<br />&#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; data=jQuery("#list2").getRowData(mya[i]); // get each row<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; for(j=0;j&#60;colNames.length;j++)<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; html=html+data[colNames[j]]+"\\t"; // output each column as tab delimited<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; html=html+"\\n";&#160; // output each row with end of line<br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; html=html+"\\n";&#160; // end of line at the end<br />&#160;&#160;&#160; document.formstyle.csvBuffer.value=html;<br />&#160;&#160;&#160; document.formstyle.method=&#39;POST&#39;;<br />&#160;&#160;&#160; document.formstyle.action=&#39;/template/jsp/csvExport.jsp&#39;;&#160; // send it to server which will open this contents in excel file<br />&#160;&#160;&#160; document.formstyle.target=&#39;_blank&#39;;<br />&#160;&#160;&#160; document.formstyle.submit();</p>
<p>// This is the JSP code to output the file in excel<br />//&#60;%<br />//</p>
<p>//response.setContentType("application/vnd.ms-excel");<br />//String buf=request.getParameter("csvBuffer");<br />//try{response.getWriter().println(buf);}catch(Exception e){}<br />//%&#62;</p>
<p>}</p>
]]></description>
        	        	<pubDate>Wed, 04 Feb 2009 12:51:48 +0200</pubDate>
        </item>
</channel>
</rss>