Baljeet Singh

Your Technical Guide

Excel Pivot Table using VBA

clock January 30, 2012 11:59 by author Administrator

This code explains how tocreate a pivot table using vba code in excel macros, use the following function to create the pivot

sub CreatePivot()

Dim pcache As PivotCache
Dim ptable As PivotTable
Dim ws As Worksheet
Set ws = ActiveSheet

Set pcache = ActiveWorkbook.PivotCaches.Create(xlDatabase, ws.UsedRange)
Set ptable = pcache.CreatePivotTable(ws.[d20], "Demo Pivot", True)

Call ptable.AddFields(ptable.PivotFields("Customer").Name, ptable.PivotFields("Item").Name)
Call ptable.AddDataField(ptable.PivotFields("Qty"), "Quantity", xlSum)

End Sub

Considering the following Excel Data

 

Customer  Item Qty
Ravi Apple 10
Rajesh Pears 20
Ravi Pears 5

 



Defining Key Value in Model for MVC

clock January 19, 2012 09:49 by author Administrator

if you have created the Model without the key attribute you will probably ends with the following error:

public class StudentsModel
{

        public int Studentid{get;set;}
        [Required]
        public string Name{get;set;}
        public int Age{get;set;}

}

Error would be :

 

 

The solution to this issue is :

public class StudentsModel
{

        [Key]
        public int Studentid{get;set;}
        [Required]
        public string Name{get;set;}
        public int Age{get;set;}

}

 



Turning off SSL in Sigsiu.NET Component

clock January 15, 2012 00:46 by author Administrator

Change the registery entry as per the following details

Config key: "use_mos_conf_livesite"
Value : 1

This is under compact section




Calendar

<<  May 2013  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

Sign in