伙计们
我尝试使用实体数据模型在 WPF 窗口中加载水晶报表,但它没有加载,如何加载它?
我使用了这个教程,但我的环境是 VS2012
http://www.c-sharpcorner.com/UploadFile/nipuntomar/crystal-report-viewer-in-wpf-part-1/
这是我的代码:
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
private void crystalReportsViewer1_Loaded(object sender, RoutedEventArgs e)
{
ReportDocument report = new ReportDocument();
report.Load("CrystalReport1.rpt");
using (cvmakerEntities1 db = new cvmakerEntities1())
{
report.SetDataSource(from c in db.cvs
select new {c.Full_Name,c.Address,c.E_Mail,c.Activities,c.Birth_Day,c.Courses,c.Education,c.Experience,c.Gender,c.Mobile,c.Nationality,c.Occuptional_Field,c.Personnal_Website,c.photo,c.Skills,c.Tele});
}
crystalReportsViewer1.ViewerCore.ReportSource = report;
}
这是 xml 设计器中的代码
<Window x:Class="CV_Maker.Report"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clnamespace:SAPBusinessObjects.WPF.Viewer;assembly=SAPBusinessObjects.WPF.Viewer"
Title="Report" Height="800" Width="800">
<Grid>
<my:CrystalReportsViewer HorizontalAlignment="Left" Name="crystalReportsViewer1"
VerticalAlignment="Top" Height="769" Width="792" Loaded="crystalReportsViewer1_Loaded" />
</Grid>
这里有什么问题 ?
谢谢