This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. package org.jpa; | |
2. import java.io.Serializable; | |
3. import javax.persistence.Column; | |
4. import javax.persistence.Entity; | |
5. import javax.persistence.Id; | |
6. import javax.persistence.Table; | |
7. @Entity | |
8. @Table(schema="sistema", name = "estudiante") | |
9. public class Estudiante implements Serializable { | |
10. @Id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. package org.jpa; | |
2. import java.io.Serializable; | |
3. import javax.persistence.Column; | |
4. import javax.persistence.Entity; | |
5. import javax.persistence.Id; | |
6. import javax.persistence.Table; | |
7. @Entity | |
8. @Table(schema="sistema", name = "estudiante") | |
9. public class Estudiante implements Serializable { | |
10. @Id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import javax.swing.*; | |
import jxl.write.*; | |
import jxl.*; | |
public class ExcelTableExporter { | |
private File file; | |
private JTable table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import javax.swing.*; | |
import jxl.write.*; | |
import jxl.*; | |
public class ExcelTableExporter { | |
private File file; | |
private JTable table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean export(){ | |
try | |
{ | |
//Nuestro flujo de salida para apuntar a donde vamos a escribir | |
DataOutputStream out=new DataOutputStream(new FileOutputStream(file)); | |
//Representa nuestro archivo en excel y necesita un OutputStream para saber donde va locoar los datos | |
WritableWorkbook w = Workbook.createWorkbook(out); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i=0;i< table.getColumnCount();i++){ | |
for(int j=0;j<table.getRowCount();j++){ | |
Object objeto=table.getValueAt(j,i); | |
s.addCell(new Label(j, i, String.valueOf(objeto))); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w.write(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BusinessExpandableListAdapter<T> extends BaseExpandableListAdapter{ | |
private Context contexto; | |
protected HashMap<String, List<T>> mapList; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomExpandableListAdapter<T> extends BaseExpandableListAdapter{ | |
private Context contexto; | |
protected HashMap<String, List<T>> mapList; | |
public CustomExpandableListAdapter(Context contexto,HashMap<String, List<T>> mapList) { | |
this.mapList=mapList; | |
this.contexto=contexto; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public T getChild(int groupPosition, int childPosition) { | |
T value=mapList.get(getMapGroup(groupPosition)).get(childPosition); | |
return value; | |
} | |
@Override | |
public long getChildId(int groupPosition, int childPosition) { | |
return childPosition; | |
} |
OlderNewer