Solved

export dataset

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calculate number of nights between two dates 5 54
edit .asp files 5 31
Passing data between Forms 3 20
Toolbar to format all windows forms controls at design time needed 5 16
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 …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

820 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