Solved

export dataset

Posted on 2008-06-13
5
220 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now