Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. To read HTML records to excel in ASP.Net

To read HTML records to excel in ASP.Net

Scheduled Pinned Locked Moved ASP.NET
questioncsharpjavajavascripthtml
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Biju Sam
    wrote on last edited by
    #1

    I have a requirement in ASP.Net, where is there is a HTML page which will be around 1200 pages with records fetched from a Database using some reports. The records shown in HTML is in a Listed View some thing like Name : BS Age : 66 Work : Personal : xyz : Buisines : xyz Name : AA Age : 66 Work : Offial : abc : Buisines : abc I need this format replicated to an excel sheet in the following way(column wise) Name Age Work.Personal Work.Buisiness Work.Official BS 66 xyz xyz NULL AA 66 NULL abc abc Remember the HTML page has around 1200 pages ie may be around 50,000 rows. And some times the column heirarchy for eg: work can be more like work-official-buisiness-abc-abc----. So taking data from each td is making the task that much difficult. How can i meet this requirement? And also since it is HTML page there is no runat = server for table. in this case how can i get the TD,TR,TABLE etc inside my server side code if i want to loop thorugh each TD and TR. Please give me a solution which can meet this requirement. Or with any other languages this can be met? i mean by Javascript or Java or etc??? Please help. Thanks in advance. Biju Sam

    C 1 Reply Last reply
    0
    • B Biju Sam

      I have a requirement in ASP.Net, where is there is a HTML page which will be around 1200 pages with records fetched from a Database using some reports. The records shown in HTML is in a Listed View some thing like Name : BS Age : 66 Work : Personal : xyz : Buisines : xyz Name : AA Age : 66 Work : Offial : abc : Buisines : abc I need this format replicated to an excel sheet in the following way(column wise) Name Age Work.Personal Work.Buisiness Work.Official BS 66 xyz xyz NULL AA 66 NULL abc abc Remember the HTML page has around 1200 pages ie may be around 50,000 rows. And some times the column heirarchy for eg: work can be more like work-official-buisiness-abc-abc----. So taking data from each td is making the task that much difficult. How can i meet this requirement? And also since it is HTML page there is no runat = server for table. in this case how can i get the TD,TR,TABLE etc inside my server side code if i want to loop thorugh each TD and TR. Please give me a solution which can meet this requirement. Or with any other languages this can be met? i mean by Javascript or Java or etc??? Please help. Thanks in advance. Biju Sam

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Biju Sam wrote:

      And also since it is HTML page there is no runat = server for table. in this case how can i get the TD,TR,TABLE etc inside my server side code if i want to loop thorugh each TD and TR.

      Did you generate this table ? If so, who cares how it's run ? If not, how would a runat=server help you? I guess you need to use a regex or something to parse the pages and get the data you need

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      B 1 Reply Last reply
      0
      • C Christian Graus

        Biju Sam wrote:

        And also since it is HTML page there is no runat = server for table. in this case how can i get the TD,TR,TABLE etc inside my server side code if i want to loop thorugh each TD and TR.

        Did you generate this table ? If so, who cares how it's run ? If not, how would a runat=server help you? I guess you need to use a regex or something to parse the pages and get the data you need

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        B Offline
        B Offline
        Biju Sam
        wrote on last edited by
        #3

        Thanks for the reply Graus. No i did not generate this report. I was just trying to give a sample layout of the report. 1)Without runat=server how can i read the value in my .cs code? 2)How can i read through so many records inside HTML? I did a lot of google search, but all the results just show a direct export from HTML to Excel. It will copy exactly the same structure as it is there in HTML. But in my case the requirement is to convert from a List view to some what like Column like View(or like a Grid View) Please Help

        C 1 Reply Last reply
        0
        • B Biju Sam

          Thanks for the reply Graus. No i did not generate this report. I was just trying to give a sample layout of the report. 1)Without runat=server how can i read the value in my .cs code? 2)How can i read through so many records inside HTML? I did a lot of google search, but all the results just show a direct export from HTML to Excel. It will copy exactly the same structure as it is there in HTML. But in my case the requirement is to convert from a List view to some what like Column like View(or like a Grid View) Please Help

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Biju Sam wrote:

          No i did not generate this report. I was just trying to give a sample layout of the report.

          If it's not in your pages, how will runat=server help at all ? ( I asked this already )

          Biju Sam wrote:

          How can i read through so many records inside HTML?

          Like I said, if all you have is HTML, some sort of regex seems the best bet.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups