Solved

Values (html table displayed in excel format) not sorted numerically

Posted on 2004-04-13
8
277 Views
Last Modified: 2008-02-20
Hi

I have this JSP which retrieves data from the database and formats them in html table format. The table contents are then displayed in an excel application in the browser. Users can save the excel file from the browser menu.

Is there any way to define the cell's datatype as "general" or "numeric" so that the values are sorted numerically and not alphabetically?

Thanks!
0
Comment
Question by:zapot
  • 3
  • 3
8 Comments
 
LVL 7

Expert Comment

by:searlas
Comment Utility
Can you add an 'order by' clause to your database query?
0
 

Author Comment

by:zapot
Comment Utility
It is not about the sql query. User can sort any field(s) in an excel file in any order they like.
0
 
LVL 7

Expert Comment

by:searlas
Comment Utility
Can you shows us the HTML you are using to achieve this; to get Excel embedded in the browser?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:zapot
Comment Utility
The html equivalent is
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="application/vnd.ms-excel">

0
 
LVL 7

Accepted Solution

by:
searlas earned 300 total points
Comment Utility
An example:

In the style declaration:
<style>
/* Declare general style */
.style0 {
      mso-number-format:General;
      text-align:general;
      vertical-align:bottom;
      white-space:nowrap;
      mso-rotate:0;
      mso-background-source:auto;
      mso-pattern:auto;
      color:windowtext;
      font-size:11.0pt;
      font-weight:400;
      font-style:normal;
      text-decoration:none;
      font-family:TuiType;
      mso-generic-font-family:auto;
      mso-font-charset:0;
      border:none;
      mso-protection:locked visible;
      mso-style-name:Normal;
      mso-style-id:0;
}

.numeric {
      mso-style-parent:style0; /* referes to style above */
      mso-number-format:Fixed; /* interpret cell as proper Number - c.f. with General above */
}
</style>

On the table cell:
<td class="numeric">12.34</td>


0
 

Author Comment

by:zapot
Comment Utility
ok i know what is e problem. Actually there is no need to specify numeric, the datatype is "text" because the value has a trailing whitespace :)

thanks for all the help
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
jersey maven project error 7 134
nested if has else if 13 87
maven j2ee examles 2 43
struts hibernate integration example 28 113
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

12 Experts available now in Live!

Get 1:1 Help Now