2013年5月29日 星期三

rdlc報表使用方式

1.先建立好rdlc資料來源
2.建立一個.aspx頁面
3.在頁面放入ScriptManager控制項
4.放入ReportViewer控制項
說明:
Session["SearchList"] 型態為Datatable 請自行處理
report.aspx
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server"
     Font-Names="Verdana"
     Font-Size="8pt"
     InteractiveDeviceInfos="(集合)"
     WaitMessageFont-Names="Verdana"
     WaitMessageFont-Size="14pt"
     Height="500px"
     Width="1000px" >
</rsweb:ReportViewer>

protected void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack)
  {
    ReportViewer1.LocalReport.DataSources.Clear();
    ReportViewer1.LocalReport.ReportPath = "D:\\Project\\OrderMReport.rdlc";
    ReportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1",       Session["SearchList"]));
  }
}

Visual Studio JS intellisense 失效解決方式

  試了好久,發現到工具>選項>IntelliCode js項目設定啟用,重新開啟VS就正常了! 後來發現是TypeScript3.2版有問題停用,使用4.3版的TypeScript即可