Edit C:\Users\Administrator\Desktop\Back\galaxie - Copy\marketing\event\export.jsp
<% /****************************************************************************** * Copyright (c) 2000-2005 e-Deal * * e-Deal S.A. * 55 rue Brillat Savarin * 75013 Paris * France * * T: +33 (0)1 53 80 80 30 * F: +33 (0)1 73 01 69 77 * http://www.e-deal.com * * La diffusion de ce code source sous quelque forme que ce soit sans * l'autorisation de E-DEAL est interdite. * * Vous êtes autorisés à modifier ce code source uniquement pour votre usage * propre et sous réserve que les mentions de copyright demeurent intactes. * * Ce code est fourni en l'état. Aucune garantie d'aucune sorte, explicite ou * implicite n'est donnée. En aucun cas E-DEAL ne pourra être tenu pour * responsable des dommages pouvant résulter de l'utilisation de ce code * source. ******************************************************************************/ %><%@page session="true" import="com.edeal.frontline.*,java.util.*,java.sql.*"%> <%@ page import="com.edeal.frontline.navigation.FlRequest" %> <%@ page import="com.edeal.frontline.FlContext" %> <%@ page import="java.io.File" %> <%@taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %><% final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory.getLog(getClass()); FlRequest flRequest = new FlRequest(request); FlContext context = flRequest.getContext(); DataDictionary dico = context.getDataDictionary(); String id = flRequest.getParameter("id"); response.setHeader("Content-Disposition", "attachment;filename=EventStatistics.csv"); EventBean event = new EventBean(id, context); Hashtable statusNames = new Hashtable(); try {statusNames.put("0", event.getEvtStatus0());} catch (FieldNotInitializedException e) {statusNames.put("0", "");} try {statusNames.put("1", event.getEvtStatus1());} catch (FieldNotInitializedException e) {statusNames.put("1", "");} try {statusNames.put("2", event.getEvtStatus2());} catch (FieldNotInitializedException e) {statusNames.put("2", "");} try {statusNames.put("3", event.getEvtStatus3());} catch (FieldNotInitializedException e) {statusNames.put("3", "");} try {statusNames.put("4", event.getEvtStatus4());} catch (FieldNotInitializedException e) {statusNames.put("4", "");} try {statusNames.put("5", event.getEvtStatus5());} catch (FieldNotInitializedException e) {statusNames.put("5", "");} try {statusNames.put("6", event.getEvtStatus6());} catch (FieldNotInitializedException e) {statusNames.put("6", "");} try {statusNames.put("7", event.getEvtStatus7());} catch (FieldNotInitializedException e) {statusNames.put("7", "");} try {statusNames.put("8", event.getEvtStatus8());} catch (FieldNotInitializedException e) {statusNames.put("8", "");} try {statusNames.put("9", event.getEvtStatus9());} catch (FieldNotInitializedException e) {statusNames.put("9", "");} String strSeparator = ";"; String strDelimiter = "\""; //GET STATS ABOUT THIS EVENT //run stats query String query3 = "SELECT PvtStatus, PvtTMK, COUNT(*) AS Count FROM PersonEvent \n" + "WHERE PvtEventID = " + Utils.formatToSQL(context, id) + " \n" + "GROUP BY PvtStatus, PvtTMK \n" + "ORDER BY PvtStatus"; //THIS QUERY RETURNS A TABLE OF THIS SHAPE: //PvtStatus PvtTMK Count //0 NULL 3 //0 00000100000b7ede 12 //1 00000100000b7eef 24 //4 00000100000b7eee 21 //etc. Connection con = null; Statement stmt = null; ResultSet rs = null; try { con = context.getConnection(); stmt = con.createStatement(); rs = stmt.executeQuery(query3); //FOR EACH RESULT FOUND while(rs.next()) { Vector line = new Vector(); Integer status = new Integer(rs.getInt("PvtStatus")); String tmkID = rs.getString("PvtTMK"); String tmkDisp = ""; if (tmkID != null) tmkDisp = (String)dico.getRefDisp(session, "PvtTMK", tmkID); Integer count = new Integer(rs.getInt("Count")); line.addElement(status); line.addElement(statusNames.get(status.toString())); line.addElement(tmkDisp); line.addElement(count); %><%= Utils.implodeList(line, strSeparator, strDelimiter) + "\r\n" %><% } } catch (SQLException ex) { logger.error("marketing/event/read_body.jsp : " + ex.getClass().getName() + " : " + ex.getMessage()); throw new FrontlineException("marketing/event/read_body.jsp : " + ex.getClass().getName() + " : " + ex.getMessage()); } finally { try { rs.close(); } catch (Exception ex) {} try { stmt.close(); } catch (Exception ex) {} try { con.close(); } catch (Exception ex) {} } %>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de