Thursday, February 27, 2014

Employer E-Sewa PF India Annexure ii upload tool

This is an unofficial tool to help ease the process of uploading Annexure ii to the e-sewa portal.
The official instructions i.e the format for upload is specified here http://www.epfindia.com/ECR/AnnexureII_ErrorCodesList_10042013.pdf

Its a lot complicated for non tech people. So to simplify things I have created an excel sheet where you need to enter the employee details and then just click on a button which will generate the file to be uploaded in the specified format by EPF India.

You should be able to do it in 5 simple steps,  let me take you step by step

Step 1: Download the excel sheet Click Here

Step 2:
These are the columns you ll need to enter into the excel sheet

Open the excel sheet you will find the same columns 

So start filling your employees details, I shall fill the employee Anil Singh on my sheet

Step 3: 
Click on the generate file button.
Step 4:
Enter the path for the file to be stored along with the filename with the extension .txt
ex: d:\FileToBeUploaded.txt and click on Ok


Step 5:
Go to the destination folder/ drive whatever you gave in the above step and open it

Check if all the records are there and then just upload it in the portal.

Important: Every time you plan on using this sheet, use a fresh one, don't use previously entered sheets.
                Before uploading the text file you need to make sure there are no extra lines in the file.

If any doubts or clarifications mention them in the comments, I shall respond. If any errors in upload, epf provides the error codes etc,  post them too in the comments.

Later I shall cover the code of the Macro.

Add new row data to gridview from textbox Asp.net C#

Requirement was to add new row data to gridview from textbox. The data populated in the gridview was from a datatable and not in a DB.
Problem occurred when the datatable was static the following error appeared "A column named 'columnname' already belongs to this DataTable." This was because after a record is saved the pageLoad event is triggered and under pageLoad we had created ColumnNames. So, the error popped up when we tried to add the same column name over and over again.

Solution was to declare the datatable as static so that the old rows are saved and not overwritten and also to check if the no. of columns in the table is not zero which will indicate that the datatable is already created.



static DataTable dt = new DataTable();

protected void Page_Load(object sender, EventArgs e)
{
if (dt.Columns.Count==0)
{
dt.Columns.Add("name", typeof(string));
dt.Columns.Add("age", typeof(int));
}
}

protected void Button1_Click(object sender, EventArgs e)
{
dt.Rows.Add(TextBox1.Text, Convert.ToInt32(TextBox2.Text));
GridView1.DataSource = dt;
GridView1.DataBind();
}