❶ 怎么把myeclipse里的web项目包导出
在java包的意思说白了就是文件夹,在workspace里找到该项目根目录,直接拷走就行了。然后,在其他机器上用时,import就行了,____________我是辉仔
❷ web项目中,数据导出如何实现,要求:数据库sql server2005、jsp、
把你需要导出的数据显示在jsp中,比如你可以以table的形式展现。
在jsp中引入
<%@ page contentType="application/msexcel" %>
<%
//让前端浏览器以为接收到一个excel档
response.setHeader("Content-disposition","attachment; filename=msgExcel.xls");
%>
就可以直接将数据导出成excel文件了,当然你若导出word文档则为msword
希望对你有所帮助
❸ 在Eclipse上开发的web项目中如何实现数据的导入、导出 求急! 谢谢!
你搜索一个jar包,叫做jxl.jar里面是专门用来生成、导入、导出excel表格的工具类。直接调用方法就OK了。
❹ 请教java web应用导出文件
修改你后台的数据导出方法,如果有数据的话就直接导出,没数据的话就返回错误信息到前端,提示没数据。
❺ 使用aspnet将word表单导入系统中形成web表单,在系统中完成web表单,然后将web表单再导出到word
web表单要有个东西来接收
用Grid
DataSetOpenFileDialog openFile = new OpenFileDialog();
openFile.Filter = "Excel files(*.xls)|*.xls";ExcelIO excelio = new ExcelIO();if(openFile.ShowDialog()==DialogResult.OK)
{
if(excelio!=null)
excelio.Close(); excelio = new ExcelIO(openFile.FileName);
object[,] range = excelio.GetRange();
excelio.Close();
DataSet ds = new DataSet("xlsRange"); int x = range.GetLength(0);
int y = range.GetLength(1); DataTable dt = new DataTable("xlsTable");
DataRow dr;
DataColumn dc;
ds.Tables.Add(dt); for(int c=1; c<=y; c++)
{
dc = new DataColumn();
dt.Columns.Add(dc);
}
object[] temp = new object[y];
for(int i=1; i<=x; i++)
{
dr = dt.NewRow(); for(int j=1; j<=y; j++)
{
temp[j-1] = range[i,j];
}
dr.ItemArray = temp;
ds.Tables[0].Rows.Add(dr);
} dataGrid1.SetDataBinding(ds,"xlsTable");
if(excelio!=null)
excelio.Close();
}
//导出
private void ExportToWord(DataTable dt, string targetWordFile)
{
object oMissing = System.Reflection.Missing.Value;
//Start Word and create a new document.
Word._Application oWord = null;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = false;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
//Insert a paragraph at the beginning of the document.
Word.Paragraph oPara1;
oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
oPara1.Range.Text = dt.Rows[0]["mname"].ToString(); //会议名称!
oPara1.Range.Font.Bold = 1;
oPara1.Range.Font.Size = 18;
oPara1.Range.Font.Color = Word.WdColor.wdColorRed;
oWord.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;//水平居中
oPara1.Format.SpaceAfter = 24; //24 pt spacing after paragraph.
oPara1.Range.InsertParagraphAfter();
object oMissing2 = System.Reflection.Missing.Value;
//Insert a paragraph at the end of the document.
Word.Paragraph oPara2;
oPara2 = oDoc.Content.Paragraphs.Add(ref oMissing2);
oPara2.Range.Text = dt.Rows[0]["datetime"].ToString(); //会议时间
oPara2.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;
oPara1.Range.Font.Color = Word.WdColor.wdColorBlack;
oPara2.Range.Font.Bold = 1;
oPara2.Range.Font.Size = 14;
oPara2.Format.SpaceAfter = 24;
oPara2.Range.InsertParagraphAfter();
int rowcount = dt.Rows.Count + 1; // 含标题行,及所有用户行 表格总行//Insert a 3 x 4 table, fill it with data, and make the first row
//bold and italic.
//Insert another paragraph.
Word.Paragraph oPara4;
oPara4 = oDoc.Content.Paragraphs.Add(ref oMissing);
oPara4.Format.SpaceAfter = 24;
oPara4.Range.Font.Bold = 0;
oPara4.Range.Font.Size = 12;
oPara4.Range.InsertParagraphAfter();
Word.Table oTable;
Word.Range wrdRng = oPara4.Range;
❻ HTML5的 web sql 中数据,如何批量导入/导出
不能批量导入,可以生成SQL语句的JS文件,判断数据后执行JS进行导入即可。
❼ WEB服务器上mysql数据库中的数据如何移到新数据库中去
理论上是可以实现的。首先要确认两个mysql数据库的版本是否一致,如果不一致,最好转换数据版本。使用专业的数据库备份恢复软件,或者虚拟主机自带的数据备份恢复也可以。如果自己操作不熟练,建议联系服务商,让他帮你备份和恢复。以免数据丢失。
❽ MyEclipse 做好的web project 如何导出,可直接放到Tomcat目录下,启动tomcat执行
你是指web项目使用的包导出去,还是要把项目作为一个包导出?
前者,你可以在工作空间找到WEB-INF文件夹,里面有个lib,它所使用的包就在这里面。
后者你可以直接把class文件夹压缩成压缩包,然后再在其他项目导入进去就OK了
❾ 在web项目中,如何用java代码实现文件、数据,等等的导入、导出求助,菜鸟级。。。 万分感谢!
给你个小例子,你参考下
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Admin {
public static void main(String... args) {
Scanner in = new Scanner(System.in);
System.out.print("请输入:");
List result = new ArrayList();
for (int i = 0; i < 3; i++) {
result.add(in.next());
}
String file = "d:/java.txt";
try {
write(file, result);
read(file);
} catch (IOException e) {
e.printStackTrace();
}
}
private static void write(String file, List result) throws IOException {
FileWriter bw = new FileWriter(new File(file));
for (int i = 0; i < result.size(); i++) {
bw.write(String.valueOf(result.get(i)) + "\r\n");
}
bw.close();
}
private static void read(String fileName) {
File file = new File(fileName);
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));
String tempString = null;
while ((tempString = reader.readLine()) != null) {
System.out.println(tempString);
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
return;
}
}
}
❿ Web页中的数据如何导出为文本文件
这里有一个问题:FSO等控件是需要在用户机器上注册才能使用的;
如果已经注册,可以这么实现:用户点击一个按钮后,你调用FSO生成你要的txt文件(可以是一个临时的文件),然后直接重定向到临时文件,相当于“下载”,用户想怎么处理都行。