Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET VB.NET
<pre lang="xml">&lt;pre lang=&quot;xml&quot;&gt;&amp;lt;pre lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;amp;lt;pre lang=&amp;amp;quot;xml&amp;amp;quot;&amp;amp;gt;&amp;amp;amp;lt;pre lang=&amp;amp;amp;quot;xml&amp;amp;amp;quot;&amp;amp;amp;gt;I need dataset data to be exported to excel.
The show stopper is : i need to transpose the data present in the dataset while presenting it in the excel.eg:
RollNo     Name       Age        Phone number
101        ABC        18         9821982121
102        PQR        17
103        XYZ        20         9819981919
104        LMN        18         9898989898
105        STU
105        STU        19
 
And the result should be like this.
 
RollNo         | 102        | 103        | 104        | 105         | 105
Name           | PQR        | XYZ        | LMN        | STU         | STU
Age            | 17         | 20         | 18         |             | 19
Phone number   |            | 9819981919 | 9898989898 |             |
 
The values will be dynamic, and the number of data present may be not equal in every records.
Also, there may be multiple entries of the same record(Roll number 101 repeated twice) with variable data present( )&amp;amp;amp;lt;/pre&amp;amp;amp;gt;&amp;amp;lt;/pre&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;/pre&gt;</pre>
Posted 18-Feb-13 19:39pm
Edited 18-Feb-13 20:24pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
Vinay iGATE at 19-Feb-13 2:25am
   
Thanks for the solution. It would be more helpful, if you can provide me with the way as how to work around with the dataset data so that i can transpose the records as explained in the example in my query
Asim Mahmood at 19-Feb-13 2:27am
   
then please view these links
 
http://www.codeproject.com/Articles/32370/Import-Excel-File-to-DataSet
http://stackoverflow.com/questions/7244971/how-do-i-import-from-excel-to-a-dataset-using-microsoft-office-interop-excel
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
Vinay iGATE at 19-Feb-13 2:25am
   
Thanks for the solution. It would be more helpful, if you can provide me with the way as how to work around with the dataset data so that i can transpose the records as explained in the example in my query
Avik Ghosh22 at 19-Feb-13 2:31am
   
http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx
http://asp.net-informations.com/dataset/howto-asp-dataset.htm
 
https://www.google.co.in/#hl=en&tbo=d&sclient=psy-ab&q=how+to+use+dataset+in+asp.net+with+c%23&oq=HOW+TO+USE+dataset+IN+ASP.NET&gs_l=hp.1.1.0l2j0i7i30j0i30.65022.68890.3.71284.11.11.0.0.0.2.332.2274.0j6j3j2.11.0.les%3B..0.0...1c.1.3.psy-ab.wZSVv7oBjbs&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&bvm=bv.42553238,d.bmk&fp=81d14d7c7e348b8c&biw=1280&bih=629

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 398
1 CPallini 333
2 George Jonsson 270
3 OriginalGriff 159
4 Prasad Khandekar 135
0 OriginalGriff 4,613
1 CPallini 3,340
2 Sergey Alexandrovich Kryukov 2,771
3 George Jonsson 2,254
4 Gihan Liyanage 2,020


Advertise | Privacy | Mobile
Web02 | 2.8.140905.1 | Last Updated 19 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100