Crystal report 輸出Excel
ReportDocument1.ExportOptions.ExportFormatType = ExportFormatType.Excel;
※若只要輸出 Data only
ReportDocument1.ExportOptions.ExportFormatType = ExportFormatType.ExcelRecord;
--
待事以直 是為君子
<param name="background" value="Transparent" />
<param name="windowless" value="true" />
void SetWindowless(bool iswlmode)--
{
StringBuilder sb = new StringBuilder();
string wlmode = (iswlmode) ? "true" : "false";
sb.AppendFormat("<param name=\"windowless\" value=\"{0}\" />",wlmode);
Lit_windowless.Text = sb.ToString();
}
<object data="data:application/x-silverlight-2," height="99%" type="application/x-silverlight-2"利用完了再一腳踢開 ccc
width="350px" style="z-index:99999;">
<param name="source" value="/Service/xxx.xap" />
<param name="onError" value="onSilverlightError" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<%--<param name="background" value="Transparent" />
<param name="windowless" value="true" /> --%>
<asp:Literal ID="Lit_windowless" runat="server" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration: none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
style="border-style: none" />
</a>
</object>
在Script裡這麼用:ToString("yyyy/MM/dd")
在Gridview裡這麼用DataFormatString="{0:yyyy/MM/dd}
在Bind或Eval裡這麼用:Bind("xxx","{0:yyyy/MM/dd}")
--
EXECUTE @RC = [dbo].[ZGetFPR]
@tp='MarketingPOShip'
,@d= @s output
select @s
SELECT
*,(select [ChName]+',' from user_data where [id] <> '' FOR XML PATH('')) as EXp2
FROM [TABLE]
<%@ Import Namespace=" iTextSharp.text" %>程式:
<%@ Import Namespace=" iTextSharp.text.pdf" %>
<%@ Import Namespace="iTextSharp.text.html.simpleparser" %>
//--輸出PDF後來中文問題~將GridView轉成PDFPTable來解決。
Response.ContentType = "application/pdf";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AddHeader("content-disposition", "attachment;filename=CusInvNo.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
System.IO.StringWriter stringWrite = new StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
GridView1.DataBind();
StringReader reader = new StringReader(stringWrite.ToString());
Document doc = new Document(PageSize.A4);
PdfWriter.GetInstance(doc, Response.OutputStream);
/*若要將檔案放在Server上
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(HttpContext.Current.Server.MapPath("TEST.pdf"), FileMode.Create));
*/
//0.處理中文~設定中文字型
string fontPath = Environment.GetFolderPath(Environment.SpecialFolder.System) +@"\..\Fonts\kaiu.ttf";
BaseFont BaseF = BaseFont.CreateFont(fontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font fontCh = new Font(BaseF, 12);
doc.Open();
//1.將GridView轉為PdfPTable
PdfPTable ptb = new PdfPTable(GridView1.Columns.Count);
//表格標題
for (int h = 0; h < GridView1.Columns.Count; h++)
{
ptb.AddCell(new Phrase(GridView1.HeaderRow.Cells[h].Text, fontCh));
}
ptb.HeaderRows = 1;
//表格內文
for (int i = 0; i < GridView1.Rows.Count; i++)
{
for (int j = 0; j < GridView1.Columns.Count; j++)
{
ptb.AddCell(new Phrase(GridView1.Rows[i].Cells[j].Text, fontCh));
}
}
//2.輸出
doc.Add(ptb);
doc.Close();
在Web.config的<system.web>中加入
<customErrors defaultRedirect="GenericErrorPage.aspx" mode="On" />
<%@ Page Language="C#" %>三、利用在跟目錄下放一個叫"IsRD的檔案"來區別是否要攔截訊息∼
<%@ Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (Server.GetLastError() != null)
{
//使用asp.net 傳送MAIL
//MailMessage mm = new MailMessage("admin@asp.net","signally@yutian.com.tw","DCM網站錯誤訊息",Server.GetLastError().GetBaseException().Message);
string s = "",ShowMsg="",mm;
mm = (Server.GetLastError().GetBaseException().Message).Trim().Replace("'", "#");
//將錯誤清除
Server.ClearError();
//傳送紀錄錯誤的訊息給管理員。
try
{
//針對已經的錯誤(如:Send Mail)做處理
//SmtpClient sc = new SmtpClient("localhost");
//sc.Send(mm);
//改用DB mail
if (File.Exists(Server.MapPath("~/IsRD")))
{
Response.Write(mm);
}
else
{
ShowMsg = "系統忙碌中、或程式暫時無法執行,已通知系統管理員處理,請稍後再試。";
s = "Exec ZSendErrMsg @tp = 1,@em= '',@mm = '" + mm + "'";
Class1.ExecSQL(s);
Response.Write(ShowMsg);
//Server.Transfer("~/ErrorPage.aspx");
}
}
catch (Exception ex)
{
Response.Write(ex.Message );
}
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>伺服器忙碌</title>
</head>
<body>
</body>
</html>
sp_fulltext_service 'load_os_resources',1.
This command tells the Microsoft Search Service to load OS specific wordbreakers, stemmers, and such.
sp_fulltext_service 'verify_signature', 0.
Do not verify that the binaries are signed.
幸好當初規劃文件管理系統時是把檔案存在DB的image欄位裡面
建立Fulltext目錄
[資料庫]→儲存體…如下

選擇要被檢索的欄位,並指定該欄位的檔案類型。
q = facesContext.getExternalContext().getRequest().getQueryString();
k="UXID";
v=0;
if (q.indexOf(k+"=")>-1) {
v = q.substring(q.indexOf(k+"=")+k.length()+1, q.length());
v = (v.indexOf("&")>-1?v.substring(0,v.indexOf("&")):v2);
}
if (v == "insert") return '1';
引用:暗黑執行緒的這篇
http://blog.darkthread.net/blogs/darkthreadtw/archive/2007/09/04/code-javascript-time-picker.aspx
以及所使用的Timepicker模組。
<script type="text/javascript">afa_ExtendTimePicker("AwayTime");</script>並選取文字~透過HTML即可。

facesContext.getExternalContext().getRequest().getRemoteAddr());
從前Notes Web的檔案上傳真是一場惡夢!
現在Xpage來救你了!