Friday, November 16, 2012

Avoid auto formatting in Excel for CSV



="11:00"
Add these [="][value]["] ; so it will be considered as an String.   

Share Article : Avoid auto formatting in Excel for CSV
Share/Save/Bookmark

Thursday, September 6, 2012

Excel export With "save as Excel" Prompt from JSP



<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%      
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=\"report.xls\"");

%>
<sql:query var="result" dataSource="jdbcJNDI">
        
        select * FROM 
        X
        WHERE
        X.y = ? and X.z = ?
        
       
        
        <sql:param  value="${param.from}"/>
        <sql:param  value="${param.to}"/>
    </sql:query>
    <table border="1">
        <!-- column headers -->
        <tr>
        <c:forEach var="columnName" items="${result.columnNames}">
            <th><c:out value="${columnName}"/></th>
        </c:forEach>
    </tr>
    <!-- column data -->
    <c:forEach var="row" items="${result.rowsByIndex}">
        <tr>
        <c:forEach var="column" items="${row}">
            <td><c:out value="${column}"/></td>
        </c:forEach>
        </tr>
    </c:forEach>
</table>

Share Article : Excel export With "save as Excel" Prompt from JSP
Share/Save/Bookmark

CSV, how to avoid crappy auto-format in Excel



Output date as a String as following

"=\""+$F{dd/mm/yyyy date}+ "\""   (in jasper)


 "=""01/01/2012"""  (finally following will be generated)

Share Article : CSV, how to avoid crappy auto-format in Excel
Share/Save/Bookmark

Monday, July 30, 2012

Win 7 ODBC


In case drivers are not there in 64 bit ODBC
Control Panel\System and Security\Administrative Tools\Data Sources (ODBC)


try 32 bit
%windir%\SysWOW64\odbcad32.exe


http://support.microsoft.com/kb/2721825/EN-US

Share Article : Win 7 ODBC
Share/Save/Bookmark