Create Pivot table

I’m running 2.5 and have managed by automation to export a sdv file from Navision and open it with excel. So now I want to use automation to create a pivottable? Anyone have any help ?? :slight_smile:

Lars, Not knowing if this is possible, I would suggest finding code in something like VBA or Delphi and then trying to replicate in C/AL. You could try searching the following; http://msdn.microsoft.com/newsgroups/default.asp Hope this helps. [:)]

Hi Ulvaer, You can find code for creating pivot table in 3.6 G/L->Analysis by Dimension. you can use this code for creating Pivot table. Regards, Rajesh

Hi Ulvaer, You can find code for creating pivot table in 3.6 G/L->Analysis by Dimension. you can use this code for creating Pivot table. Regards, Rajesh

The easiest way to do this is: 1) Start Excel 2) Start macro recording 3) Create the desired pivot table in Excel 4) Stop recording 5) Examine the recorded VBA code and transform it into C/AL. Unless you have some very special requirements, this is usually the fastest and easiest method to get to know how things can be done in Excel VBA.

Or run the macro from C/AL if the macro will be run exactly the same everytime. Stops having to uncode and recode.