WPF Crystal Report Viewer [英] WPF Crystal Report Viewer
问题描述
HI,
$
我正在设计一个应用程序来显示在Crystal Report中设计的报表,该应用程序是一个WPF Web应用程序XBAP ,它在托管它的机器上运行良好如下:
$
\\192.168.0.9 \ WPFApplication \ WpfCrystalReportCall .xbap
$
但是当我尝试从其他机器访问该页面时,它会出错:
System.Runtime.Serialization.SerializationException:在程序集'CrystalDecisions.Shared中输入'CrystalDecisions.Shared.CrystalReportsException', Version = 13.0.2000.0,Culture = neutral,PublicKeyToken = 692fbea5521e1304'未标记为可序列化。
我连接到SQL Server使用DSN的数据库和使用的代码是:
       
          ReportDocument oRpt = new ReportDocument();
          oRpt.Load("C:\\Inetpub \\\\root \\WPFApplication\\Chart.rpt",OpenReportMethod.OpenReportByDefault);
          oRpt.SetDatabaseLogon("sa","abc123","ACP","账户");
$
$
  ;           CRViewer.ViewerCore.ReportSource = oRpt;
$
其中"ACP"是DSN名称,"帐户"是是服务器上的数据库名称。
$
解决此问题的任何帮助?
$
$
$
Mukki
I am designing an application to show reports designed in Crystal Report, the application is a WPF web application XBAP, it runs fine on the machine where it is hosted like:
\\192.168.0.9\WPFApplication\WpfCrystalReportCall.xbap
But when i try to access the page from other machine, it gives an error:
System.Runtime.Serialization.SerializationException: Type 'CrystalDecisions.Shared.CrystalReportsException' in Assembly 'CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' is not marked as serializable.
I am connecting to SQL Server database using DSN and the code used is:
ReportDocument oRpt = new ReportDocument();
oRpt.Load("C:\\Inetpub\\wwwroot\\WPFApplication\\Chart.rpt", OpenReportMethod.OpenReportByDefault);
oRpt.SetDatabaseLogon("sa", "abc123", "ACP", "Accounts");
CRViewer.ViewerCore.ReportSource = oRpt;
Where "ACP" is the DSN name, and "Accounts" is a database name on server.
Any help to resolve this issue?
Mukki
推荐答案
点击此链接。
http://code.msdn.microsoft.com/Crystal-Report-in-WPF-with-168f2b6a
http://code.msdn.microsoft.com/Crystal-Report-in-WPF-with-168f2b6a
这篇关于WPF Crystal Report Viewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!