Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-04-13
8
Medium Priority
?
312 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
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
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!

 

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 1200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Take a look at these 6 Outlook Email management tools which can augment the working and performance of Microsoft Outlook to give you a more rewarding emailing experience.
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

971 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