Solved

export dataset

Posted on 2008-06-13
5
223 Views
Last Modified: 2010-04-23
i have a dataset that has two tables with a relationship defined between the two. Is there a way to export this to excel keeping the relationship so it would display in a subtotal format

This is for a web app

Thank you
0
Comment
Question by:jimseiwert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 27

Expert Comment

by:VBRocks
ID: 21780823
DataSet.WriteXML()

0
 
LVL 2

Author Comment

by:jimseiwert
ID: 21780883
so how does that work with excel?
0
 
LVL 27

Accepted Solution

by:
VBRocks earned 500 total points
ID: 21781016
I'm so sorry.  I totally spaced it and stopped reading after "export", and didn't event catch "excel".  ;)

I don't know the answer to that.

What are you looking for as far as a "subtotal format"?

You can loop through each row of the parent DataTable, and call the row's GetChildRows(relationName)
method to retrieve all of the related rows, then write the Parent row, and each child row to Excel.

So it would (basically) be something like this in Excel:

parent row 1
     child row 1
     child row 2
     child row 3

parent row 2
     child row 1
     child row 2
     child row 3

etc...

Is that what you are referring to, or did you have something else in mind?

0
 
LVL 2

Author Comment

by:jimseiwert
ID: 21781054
no that is the format i was looking for, just need to do the code now, i will let you know how it works. If you have any examples that would be great
0
 
LVL 27

Assisted Solution

by:VBRocks
VBRocks earned 500 total points
ID: 21781361
Take a look at the following link.  I think it will be of help to you:

    http://p2p.wrox.com/topic.asp?TOPIC_ID=31161

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question