Copy data from Excel to data entry form

I have made a feature that allows direct copy from Excel sheet and past to data entry form

If anyone are interest, you can refer the doc below

Here is some screenshots on how it works

https://dl.dropboxusercontent.com/u/63702128/HuongDanImport.docx

Nguyễn Ngọc Thành

Hi Paul,

It is only available on Vietnam branch, not in main trunk. There are 2 ways. I can send the code snippet and you paste onto your current data-entry module. The other way is to make a petition to global to include this into trunk.

Actually code is so simple, they all are client sides and very easy to adapt

//COPY AND PASTE THIS SNIPPET TO ANY VM FILE OF THE DATAENTRY MODULE

<a href='javascript:importExcel();' style='color:white;'>Import Excel...</a>
Step 1. Open Excel sheet, select area and press Ctrl+C <br/>

Step 2. Press Ctr+V to paste to this box: <textarea id='excel_data' onblur='createSourceTable();' onfocus="$(this).val('');"></textarea> <br/>

Step 3. Press this button to transfer data <input type='button' value='Copy' onclick='copyTable();' cols='20' />

<hr/>

<div id='excel_table'></div>
$( "#pasteTableDialog" ).dialog({ width: 850, height: 750, autoOpen: false, modal:true, title:"COPY FROM EXCEL" }); function importExcel() { $( "#pasteTableDialog" ).dialog('open'); } function createSourceTable() { var data = $('#excel_data').val(); var rows = data.split("\n"); var table = $(''); for(var y in rows) { var cells = rows[y].split("\t"); var row = $(''); for(var x in cells) { row.append(''); } table.append(row); } // build the table from clipboard data $('#excel_table').html(table); } function copyTable() { var oSource = $("#excel_table"); var oDest = $("#contentDiv"); //contentDiv is a dhis div var arrSourceInputs = oSource.find("td"); $('.entryfield').each(function(i){ td = arrSourceInputs[i]; $(this).val(td.innerText); //trigger change to call saveValue $(this).change(); }); } //END OF THE SNIPPET
··· ![](https://dl.dropboxusercontent.com/u/63702128/thanhavatar.png) **Nguyễn Ngọc Thành** On Wed, Sep 25, 2013 at 9:13 PM, Paul Amendola wrote: > Hi Ngoc > > This feature is great and exactly what we need. How can I download the feature? Any chance you have an English version of the guidelines? > > Thanks > Paul > > > **Paul R. Amendola | Technical Advisor for Health Information Systems > **International Rescue Committee > 122 E 42nd Street, New York, NY 10168-1289 | **Rescue.org** > > T +1 212 551 0995 | Skype paul.amendola > > > > > **From:** Dhis2-devs [mailto:dhis2-devs-bounces+paul.amendola=theirc.org@lists.launchpad.net] **On Behalf Of** Ngoc Thanh Nguyen > > **Sent:** Wednesday, September 25, 2013 6:29 AM > > **To:** dhis2-devs; Thuy Nguyen > > > **Subject:** [Dhis2-devs] Copy data from Excel to data entry form > > I have made a feature that allows direct copy from Excel sheet and past to data entry form > > If anyone are interest, you can refer the doc below > > Here is some screenshots on how it works > > [https://dl.dropboxusercontent.com/u/63702128/HuongDanImport.docx](https://dl.dropboxusercontent.com/u/63702128/HuongDanImport.docx) > > > **Nguyễn Ngọc Thành** >
'+cells[x]+'