방법: LightSwitch에서 SQL Server Reporting Services 보고서 보기
LightSwitch하지 않는 기본 제공 보고 기능을 제공 하지만 SQL Server Reporting Services를 사용 하 여 보고서를 만들고에서 볼 수 있는 LightSwitch 응용 프로그램.보고서를 인쇄 하 여 여러 파일 형식으로 내보낼 수 있는 브라우저 창에 표시 됩니다.
작성, 배포 및 SQL Server Reporting Services를 사용 하 여 조직에 대 한 보고서를 관리 하 고 확장 하 고 다양 한 프로그래밍 기능을 사용 하 여 보고 기능을 사용자 지정할 수 있습니다.SQL Server 전체 버전에 없는 경우에에서는 여전히 보고서를 사용 하 여 만들 수 있습니다 Reporting Services에서 SQL Server Express 하 고급 서비스와에서 무료로 다운로드할 수 있습니다.
보고서를 보려면
솔루션 탐색기, 선택 파일 보기 의 목록 도구 모음에서.
바로 가기 메뉴를 열고를 클라이언트 프로젝트 노드 및 다음 선택 참조 추가.
에 참조 추가 대화 상자에서 확장의 어셈블리 노드를 선택의 프레임 워크 노드를 선택의 System.Windows.Browser 확인란을 선택한 다음 선택의 확인 단추.
솔루션 탐색기, 선택 논리적 보기 의 목록 도구 모음에서.
화면에 대 한 바로 가기 메뉴를 열고 선택 열기.
화면 디자이너에서 확장의 화면 명령 모음 노드를 선택 된 추가 노드를 다음 선택 새 단추.
에 추가 단추 대화 상자에서 선택의 새 메서드 옵션 단추, 이름을 작성 하 고 선택 단추를 확인 단추.
화면 디자이너에서 새 단추에 대 한 바로 가기 메뉴를 열고 선택 실행 코드 편집.
에 코드 편집기, 다음 추가 가져오기 또는 를 사용 하 여 문:
Imports Microsoft.LightSwitch.Threading Imports System.Runtime.InteropServices.Automation
using Microsoft.LightSwitch.Threading; using System.Runtime.InteropServices.Automation;
보고서를 열고 다음 코드를 추가 교체는 Uri 보고서 URL로 바꾸고 ViewReport 단추의 이름을 가진:
Private Sub ViewReport_Execute() Dispatchers.Main.BeginInvoke( Sub() ' Provide the URL for the report that you want to view Dim uri As New Uri("https://www.contoso.com/ReportServer/Pages/ReportViewer.aspx?%2fReportName&rs:Command=Render") If (AutomationFactory.IsAvailable) Then ' This is a desktop app, so shell to the default browser Dim shell = AutomationFactory.CreateObject("Shell.Application") shell.ShellExecute(uri.ToString) ElseIf (Not System.Windows.Application.Current.IsRunningOutOfBrowser) Then ' This is a web app, so navigate to the page System.Windows.Browser.HtmlPage.Window.Navigate(uri, "_blank") End If End Sub) End Sub
private void ViewReport_Execute() { Dispatchers.Main.BeginInvoke(() => { // Provide the URL for the report that you want to view Uri uri = new Uri("https://www.contoso.com/ReportServer/Pages/ReportViewer.aspx?%2fReportName&rs:Command=Render"); if ((AutomationFactory.IsAvailable)) { // This is a desktop app, so shell to the default browser dynamic shell = AutomationFactory.CreateObject("Shell.Application"); shell.ShellExecute(uri.ToString()); } else if ((!System.Windows.Application.Current.IsRunningOutOfBrowser)) { // This is a web app, so navigate to the page System.Windows.Browser.HtmlPage.Window.Navigate(uri, "_blank"); } }); }
새 브라우저 창에서 보고서를 표시 합니다.
팁
보고서 매개 변수, 암호, 렌더링 형식 및 자세한 포함 된 보고서에 대 한 URL을 생성할 수 있습니다.자세한 내용은 URL 액세스.