Solved

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

Posted on 2004-04-13
8
289 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
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

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

Suggested Solutions

Title # Comments Views Activity
getting Http 404 error in jsp forms 8 84
immutable object concept 5 132
equalIsNot  challenge 43 178
jsp CRUD operations with and without prepared statement also hibernatge 1 27
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

713 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