Solved

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

Posted on 2004-04-13
8
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
8 Comments
 
LVL 7

Expert Comment

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

Author Comment

by:zapot
ID: 10813460
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
ID: 10813933
Can you shows us the HTML you are using to achieve this; to get Excel embedded in the browser?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:zapot
ID: 10820347
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
ID: 10821526
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
ID: 10830985
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A look at what happened in the Verizon cloud breach.
Part One of the two-part Q&A series with MalwareTech.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

624 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