Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create Drill-down in excel from Visual basic

Status
Not open for further replies.

Elsje

Programmer
Feb 20, 2004
44
BE
Hi everyone,

I need to create an excel with drill-down on 2 levels. But I have to do this from VB.Net 2008. I have to export data from this program to an excel file.
I give an example.

This is what I need to become when i open my excel.
+ header 1
+ header 2

If you click on + bij header 1 I want to get the following
- header 1
+ detail 1
+ detail 2
+ header 2

If you go deeper I want the following
- header 1
- detail 1
row 1
row 2
+ detail 2
+ header 2
and so on....

When i use an rdlc and I export it from there it makes the drill-down in excel. But I need to do this now directly to excel.
I hope someone can tell me how I need to do this.

Thanks in advance

Greetings
Elsje
 



Hi,

How about a PivotTable? It is native Excel, no or very little code required. Just point to the external data source and query.

When you say that, "I have to export data from this program," is the data really in a program or is it a file or database that the program creates? Please explain this in more detail.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hello,

In my program I have to get the data out different tables and I need to do some actions with it. When I have everything i create the tappage. I put everything in the correct cells and give it the correct lay-out. That works all fine.
But now they want the drill-down function on the group headers with totals of the details in the group.
So they see the headers with the totals and when the need to they can click and see the details.

Greetings
Els
 


That works all fine.
Using that fine result as the source data, create a PivotTable. You can collapse the 'heading' values.

Or you could use Data > Group & Outline.

Once you have performed the manual steps, you could turn on your macro recorder and do it, if you need code to recreate.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thank you for the tip with the macro recorder.
Now it works.

Thanks.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top