❶ 怎麼把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文件(可以是一個臨時的文件),然後直接重定向到臨時文件,相當於「下載」,用戶想怎麼處理都行。