Hi friends,

i want to query from excel data(sheet1) and create pivot table in sheet2 and copy that pivot table into .net data table. Is it possible? if yes, plz tell me how to do this?

For example my query is
"select productname, cost from sheet1"

then from query output i need to create pivot table which will have two columns; productname and sum(cost); in the sheet2 after that i want to copy that pivot table into .net data table.

plz reply soon it is urgent...

Advance thank you...

Recommended Answers

All 3 Replies

Using

plz reply soon it is urgent...

does not help you get answers faster. Avoid it the next time.

You can import the data into SQL server database table easily. You can pivot the table using PIVOT in SQL query. Then subsequently read the data to datatable.
You can get the procedures to do so from previous threads of this forum or try googling. If you encounter any other problems doing so ask further.:)

commented: using Urgent; +9

first thing is,
i dont want to use data base. we are calculating all in the excel only Second thing is,
i want to display grand total at end of each row and column.

and more value field may be sum(cost) or count(product)....
Here i have given example for cound(product)

ProdName >10$ >20$ >50$ >100$ Grand Total
Product1 3 4 2 5 14
Product2 3 7 1 6 17
GrandTot 6 11 3 11 52

i hope now it is very clear

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.