『壹』 excel表格怎麼導入indesign
1、用像「T」的工具畫一個框先,尺寸自己定,然後「文件-置入」你的excel表格。
2、導入帶著表格線的原樣 」 如果Excel表格做的很復雜 是無法到indesign里的。
3、不想製表可以先把文本在Excel復制黏貼到indesign里以後 在菜單欄「表」下拉菜單中 選將文本轉換為表格,再做細節調整用Excel表格做的還是很復雜,但是還是導入Excel表格後,Indesign CS6還是把表格線自動去掉。
4、不論表格是否復雜都不行可以打開首選項 ctrl+K試試 裡面有個剪貼板處理 選項 在右側「從其他應用程序粘貼文本和表格時」選 所有信息 然後再把excel表格復制進來。
『貳』 求C#(winForm)將數據導出到Execl的實例 要cs文件全部代碼
winForm中導出Execl的方法:
1、方法1:
SqlConnection conn=new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["conn"]);
SqlDataAdapter da=new SqlDataAdapter("select * from tb1",conn);
DataSet ds=new DataSet();
da.Fill(ds,"table1");
DataTable dt=ds.Tables["table1"];
string name=System.Configuration.ConfigurationSettings.AppSettings["downloarl"].ToString()+DateTime.Today.ToString("yyyyMMdd")+new Random(DateTime.Now.Millisecond).Next(10000).ToString()+".csv";//存放到 web.config中downloarl指定的路徑,文件格式為當前日期+4位隨機數
FileStream fs=new FileStream(name,FileMode.Create,FileAccess.Write);
StreamWriter sw=new StreamWriter(fs,System.Text.Encoding.GetEncoding("gb2312"));
sw.WriteLine("自動編號,姓名,年齡");
foreach(DataRow dr in dt.Rows)
{
sw.WriteLine(dr["ID"]+","+dr["vName"]+","+dr["iAge"]);
}
sw.Close();
Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(name));
Response.ContentType = "application/ms-excel";// 指定返回的是一個不能被客戶端讀取的流,必須被下載
Response.WriteFile(name); // 把文件流發送到客戶端
Response.End();
public void Out2Excel(string sTableName,string url)
{
Excel.Application oExcel=new Excel.Application();
Workbooks oBooks;
Workbook oBook;
Sheets oSheets;
Worksheet oSheet;
Range oCells;
string sFile="",sTemplate="";
//
System.Data.DataTable dt=TableOut(sTableName).Tables[0];
sFile=url+"myExcel.xls";
sTemplate=url+"MyTemplate.xls";
//
oExcel.Visible=false;
oExcel.DisplayAlerts=false;
//定義一個新的工作簿
oBooks=oExcel.Workbooks;
oBooks.Open(sTemplate,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing, Type.Missing, Type.Missing);
oBook=oBooks.get_Item(1);
oSheets=oBook.Worksheets;
oSheet=(Worksheet)oSheets.get_Item(1);
//命名該sheet
oSheet.Name="Sheet1";
oCells=oSheet.Cells;
//調用mpdata過程,將數據導入到Excel中去
DumpData(dt,oCells);
//保存
oSheet.SaveAs(sFile,Excel.XlFileFormat.xlTemplate,Type.Missing,Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing);
oBook.Close(false, Type.Missing,Type.Missing);
//退出Excel,並且釋放調用的COM資源
oExcel.Quit();
GC.Collect();
KillProcess("Excel");
}
private void KillProcess(string processName)
{
System.Diagnostics.Process myproc= new System.Diagnostics.Process();
//得到所有打開的進程
try
{
foreach (Process thisproc in Process.GetProcessesByName(processName))
{
if(!thisproc.CloseMainWindow())
{
thisproc.Kill();
}
}
}
catch(Exception Exc)
{
throw new Exception("",Exc);
}
}
『叄』 求用winform導入導出excel的方法!!!另外我在調試時出錯!!!
在這里補充一下,如果你的電腦安裝了microso offices vs中的操作都好了還是出錯的話,你看看你的offices辦公軟體安裝在c盤,還是其他盤下。我當時遇到的問題是這樣,我的是安裝在d:盤了,結果換了c:盤就好了。