WPF 프로젝트에 참조파일 추가
Microsoft.ReportViewer.Common,
Microsoft.ReportViewer.WinForms,
System.Windows.Forms,
WindowsFormIntegration.
windowsFormsHost를 끌어다 놓는다.
<Grid >
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="#FF373737" Offset="1"/>
<GradientStop Color="#FF878787"/>
</LinearGradientBrush>
</Grid.Background>
<Canvas>
<WindowsFormsHost Canvas.Left="0" Canvas.Top="31" Height="349" Name="windowsFormsHost1" Width="647" />
<Label Canvas.Left="6" Canvas.Top="6" Content="WPF 리포트 생성" Height="28" Name="label1" />
</Canvas>
</Grid>
CS 코드
private void Window_Loaded(object sender, RoutedEventArgs e)
{
Microsoft.Reporting.WinForms.ReportViewer reportViewer = new Microsoft.Reporting.WinForms.ReportViewer();
reportViewer.LocalReport.ReportPath = "Report1.rdlc";
//리포트뷰 추가 데이터 엑세스 등등작업......
this.windowsFormsHost1.Child = reportViewer;
reportViewer.RefreshReport();
}'WPF' 카테고리의 다른 글
| StaticResource 와 DynamicResource 의 차이 (0) | 2010.09.15 |
|---|---|
| [StringFormat] 초간단 날짜 표시방법변경 (0) | 2010.09.01 |
| [NavigationService / PageFunction] 페이지 이동 (2) | 2010.08.23 |
| [Canvas] 캔버스안의 컨트롤을 캔버스 가운데 띄우기 (0) | 2010.08.03 |
| [DataGridHyperlinkColumn , EventSetter ] DataGridHyperlink 이벤트 처리 (0) | 2010.08.03 |
| [WPF Style/FindResource ] 비하인드 코드에서 스타일 먹히기 (0) | 2010.07.30 |
| [WPF FileDialog] Image 저장/불러오기/바인딩하기 (0) | 2010.07.19 |
| [MSDN]WPF/Silverlight데이터 바인딩 방법 항목 (0) | 2010.07.15 |
| [DataGrid/Element Property Binding] 선택한 행 정보받아오기 (0) | 2010.07.09 |
| [OneTime, OneWayToSource, TwoWay]바인딩 속성 (0) | 2010.07.08 |