Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3752844
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:18:01+00:00 2026-05-19T09:18:01+00:00

I produce a complex HTML summary report from data in a database which could

  • 0

I produce a complex HTML summary report from data in a database which could be a summary of maybe 200,000 rows in the database. The user can click a link to request an Excel version.

When they do a JS script extracts the key components of the report and stuffs them into a form in a hidden iframe. This form submits to a server-side script which generates the Excel version of the report (without the graphics etc).

As the calculations for the report are complex and “costly” it makes sense not to run them again to create the Excel version as all the data is on the page already. Also the user may have customised the report once it is loaded and I can use JS to pass those preferences to the form as well so the Excel doc reflects them too.

The way I am doing this is to include the following for each component of the report that transfers to a row in the Excel version. I’ve hijacked an HTML tag that isn’t otherwise used.

   <code id="xl_row_211865_2_x" class="rowlabel">Musicals}{40%}{28.6%}{6</code>

The code element above is a summary of the row below in the HTML report which becomes one row in the Excel doc and includes the label and various data elements. There may be a thousand or more such elements in one report.

alt text

As the data contains text I’ve had to use something like }{ as a field separator as this is unlikely to occur in any real text in the report. I have code set to display:none in the CSS.

When the user wants an Excel version of their report the JS code searches the HTML for any <code> elements and puts their className and innerHTML in the form. The className indicates how to format the row in Excel and the data is then put into adjacent cells on the Excel row.

alt text

The HTML report shows one percentage base (they can toggle between them) but the user preference when requesting an Excel version was to include both.

Is there a better way of doing this?

(As this is a part of a complex web app no user is going to turn CSS off or lack javascript or they wouldn’t get this far)
ADDED: I can’t use HTML5 as the users are corporates often on older browsers like IE6

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T09:18:02+00:00Added an answer on May 19, 2026 at 9:18 am

    Use the new data- attributes

    http://www.javascriptkit.com/dhtmltutors/customattributes.shtml

    <div data-row="[[&quot;Musicals&quot;,40,28.6,6], ...]">
    

    The div could be the TD tag or TR tag or any other relevant tag already related to the row and the &quot; is the escaped ".

    That makes the data hidden from view and also ensures that there will come standard solutions to process the data.

    Also for encoding data I would suggest using JSON as that is also a standard that is easy to use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting a set of data from the database where the query produces
I produce a report as an CSV file. When I try to open the
I need to produce a calculation trace file containing tabular data showing intermediate results.
I'm trying to produce a report that has multiple grouping but does not just
I would like to produce an executable that could make an update verification before
I've got a complex table which actually produces a very simple layout. For many
I'm working with an asp.net application that produces large PDF documents from HTML. The
This code: string[] files = {test.txt, test2.txt, notes.txt, notes.doc, data.xml, test.xml, test.html, notes.txt, test.as};
I produce server software and have been fine with all Linux environments so far,
I'm trying to produce sheets of photographs with captions arranged in a grid using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.