水晶报表发布到服务器上遇到的问题?

lqhly 2008-11-19 04:35:55
系统vs2005,数据库sqlserver2000,程序中有一水晶报表,在本地的vs2005上运行调试都成功后,放到后台服务器上提示错误为:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'Shared' does not exist in the namespace 'CrystalDecisions' (are you missing an assembly reference?)

Source Error:

Line 11: using System.Data.SqlClient;
Line 12: using System.IO;
Line 13: using CrystalDecisions.Shared;
Line 14: using CrystalDecisions.CrystalReports.Engine;
Line 15:

Source File: d:\Inetpub\wshtgl\CrystalReports_Zbcgqd.aspx.cs Line: 13

我已经在服务器上运行了这两个文件“CRRedist2005_x86.msi”,“CRREdist2005_x86_chs.msi”
求助各位大侠如何解决?
...全文
700 24 打赏 收藏 转发到动态 举报
写回复
用AI写文章
24 条回复
切换为时间正序
请发表友善的回复…
发表回复
阿泰 2008-11-21
  • 打赏
  • 举报
回复
烦请重新起个帖子,谢谢。
lqhly 2008-11-21
  • 打赏
  • 举报
回复
产品类别Cplb是用于分组的
lqhly 2008-11-21
  • 打赏
  • 举报
回复
版主啊,登录的问题是解决了,但是我的报表里有三个参数,它又管我要参数的信息,这三个参数为:产品类别Cplb,起始日期QsDate和截至日期JzDate
参数登录提示为:
参数字段
Cplb: 产品类别
值 从... 到... 添加
参数
QsDate: 起始日期
值 ....
JzDate: 截至日期
值 ....

参数的前台代码为:
<asp:DropDownList ID="Cplb" runat="server" DataTextField="Xmname"
DataValueField="Xmname" Width="150px">
</asp:DropDownList>
<asp:TextBox ID="QsDate" runat="server" Width="78px"></asp:TextBox>
<asp:TextBox ID="JzDate" runat="server" Width="78px"></asp:TextBox>
请问:如何把这三个参数传递到程序中?具体放在以上后台源程序的什么位置?
另外我还有一个疑问:我在本地时这些参数是通过水晶报表和其前台设置好的,怎么发布到服务器后这些都不起作用了,这不是相当于又重新设计报表了吗?真郁闷啊!也真难啊!






阿泰 2008-11-21
  • 打赏
  • 举报
回复
请根据18楼修正

19楼只是说明错误信息
阿泰 2008-11-21
  • 打赏
  • 举报
回复
private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
{
Tables tables = reportDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogonInfo = Table.LogOnInfo;
TableLogOnInfo.ConnecitonInfo = ConnectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);
}

c#是区分大小写的
阿泰 2008-11-21
  • 打赏
  • 举报
回复
。。。




TableLogOnInfo.connecitonInfo = ConnectionInfo;
==>
tableLogonInfo.ConnectionInfo = connectionInfo;

像这种大小写的错误,编译前IDE不就已经提出来了吗?
lqhly 2008-11-21
  • 打赏
  • 举报
回复
还有错误:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'CrystalDecisions.Shared.TableLogOnInfo' does not contain a definition for 'connecitonInfo'
Source Error:

Line 53: {
Line 54: TableLogOnInfo tableLogonInfo = table.LogOnInfo;
Line 55: TableLogOnInfo.connecitonInfo = ConnectionInfo;
Line 56: table.ApplyLogOnInfo(tableLogOnInfo);
Line 57: }
Source File: d:\Inetpub\wshtgl\CrystalReports_Htqd.aspx.cs Line: 55

阿泰 2008-11-21
  • 打赏
  • 举报
回复
TableLogOnInfo tableLogonInfo = Table.LogOnInfo;

==>


TableLogOnInfo tableLogonInfo = table.LogOnInfo;

table 小写
lqhly 2008-11-21
  • 打赏
  • 举报
回复
有如下错误提示:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0104: 'Table' is an ambiguous reference between 'System.Web.UI.WebControls.Table' and 'CrystalDecisions.CrystalReports.Engine.Table'
Source Error:
Line 52: foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
Line 53: {
Line 54: TableLogOnInfo tableLogonInfo = Table.LogOnInfo;
Line 55: TableLogOnInfo.ConnecitonInfo = ConnectionInfo;
Line 56: table.ApplyLogOnInfo(tableLogOnInfo);
Source File: d:\Inetpub\wshtgl\CrystalReports_Htqd.aspx.cs Line: 54
阿泰 2008-11-21
  • 打赏
  • 举报
回复
SetDBLogonForReport(connectionInfo, WsfcdbCustomersReport);
WsfcdbCustomersReport = new ReportDocument();
string reportPath = Server.MapPath("CrystalReport_Htqd.rpt ");
WsfcdbCustomersReport.Load(reportPath);

顺序错了
("CrystalReport_Htqd.rpt ") 这里面多了个空格
==>

WsfcdbCustomersReport = new ReportDocument();
string reportPath = Server.MapPath("CrystalReport_Htqd.rpt");
WsfcdbCustomersReport.Load(reportPath);
SetDBLogonForReport(connectionInfo, WsfcdbCustomersReport);
lqhly 2008-11-21
  • 打赏
  • 举报
回复
版主babyt,我按你的方法做了,但还是不行,仍然是数据库登录的提示,源程序如下:
protected void Page_Load(object sender,EventArgs e)
{
if(!Page.IsPostBack)
{
ConfigrationReports();
}
}
private ReportDocument WsfcdbCustomersReport;
private void ConfigrationReports()
{
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "Wsfcdb";
connectionInfo.UserID = "wsfc";
connectionInfo.Password = "88a ";
connectionInfo.ServerName = "(local)";
SetDBLogonForReport(connectionInfo, WsfcdbCustomersReport);
WsfcdbCustomersReport = new ReportDocument();
string reportPath = Server.MapPath("CrystalReport_Htqd.rpt ");
WsfcdbCustomersReport.Load(reportPath);
CrystalReportViewer1.ReportSource = WsfcdbCustomersReport;
}
private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
{
Tables tables = reportDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
{
TableLogOnInfo tableLogonInfo = Table.LogOnInfo;
TableLogOnInfo.ConnecitonInfo = ConnectionInfo;
table.ApplyLogOnInfo(tableLogOnInfo);
}
}
-------------------
错误在那里呢?
lqhly 2008-11-21
  • 打赏
  • 举报
回复
多谢版主,我先把这个帖结了,还烦请你多帮忙。
阿泰 2008-11-20
  • 打赏
  • 举报
回复
我打了个辅助安装包,你安装下看看。23.8M。

我是https://forum.csdn.net/SList/DotNETReport版主,请放心使用,但是不一定对你的项目有效,请及时沟通。

http://www.feelcode.net/files/VS2005CRInstallv1.rar

lqhly 2008-11-20
  • 打赏
  • 举报
回复
我把C:\Program Files\Common Files\Business Objects\2.7\Managed 下的文件拷贝到网站的bin内,以上的问题是解决了,但又出现了新问题,错误提示为:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50} failed due to the following error: 800736b1.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50} failed due to the following error: 800736b1.

Source Error:


Line 78: <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
Line 79: Height="1129px" ReportSourceID="CrystalReportSource" Width="904px" />
Line 80: <CR:CrystalReportSource ID="CrystalReportSource" runat="server">
Line 81: <Report FileName="CrystalReport_Gysmd.rpt">
Line 82: <Parameters>


Source File: d:\Inetpub\wshtgl\CrystalReports_Gysmd.aspx Line: 80

Stack Trace:


[COMException (0x800736b1): Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50} failed due to the following error: 800736b1.]
CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +182

[TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.]
CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +0
CrystalDecisions.ReportSource.CachedReport.get_ReportDocument() +36
CrystalDecisions.Web.CrystalReportSource.set_Report(Report value) +255
ASP.crystalreports_gysmd_aspx.__BuildControlCrystalReportSource() in d:\Inetpub\wshtgl\CrystalReports_Gysmd.aspx:80
ASP.crystalreports_gysmd_aspx.__BuildControlMyForm() in d:\Inetpub\wshtgl\CrystalReports_Gysmd.aspx:43
ASP.crystalreports_gysmd_aspx.__BuildControlTree(crystalreports_gysmd_aspx __ctrl) in d:\Inetpub\wshtgl\CrystalReports_Gysmd.aspx:1
ASP.crystalreports_gysmd_aspx.FrameworkInitialize() in d:\Inetpub\wshtgl\CrystalReports_Gysmd.aspx.cs:912307
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +40
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.crystalreports_gysmd_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\81a30cc1\917e269c\App_Web_zxo2ldsd.12.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
那位高手再帮我看看是什么原因?唉水晶报表真头痛啊!
阿泰 2008-11-20
  • 打赏
  • 举报
回复
主要水晶报表组件位置:

C:\Program Files\Common Files\Business Objects\2.7\Managed

目前情况下,建议你将
C:\Program Files\Common Files\Business Objects

这个目录复制到服务器上相同位置,然后再看看
阿泰 2008-11-20
  • 打赏
  • 举报
回复
你的配置信息水晶报表自己取不到,你要自己主动做的。

请参考
http://topic.csdn.net/u/20070315/11/15530f10-e56f-4a21-9a52-38587346d946.html?402950673

7楼和8楼

另外可参考
http://www.cnblogs.com/babyt/archive/2008/10/09/1307346.html
这是 VB.Net语法的,转换起来也很容易
qinhl99 2008-11-20
  • 打赏
  • 举报
回复
cr.SetDatabaseLogon( "sa ", "******* ", "(local) ", "database ", true);
lqhly 2008-11-20
  • 打赏
  • 举报
回复
不好意思,我把水晶报表重新配置了数据源后,出现的登录提示已为服务器上的数据库提示了。
即提示为:
192.168.1.2
服务器名:192.168.1.2
数据库名:wsfcdb
用户名: wsfc
密码:
使用集成安全性
登录
如何才能不要数据库登录提示?
lqhly 2008-11-20
  • 打赏
  • 举报
回复
谢谢版主babyt,安装完你的辅助安装包后,以上的问题没有了,但是又出现如下提示:
192.168.1.2
服务器名:192.168.1.2
数据库名:wsfcdb
用户名: wsfc
密码:
使用集成安全性
登录
这些但是我原来本机的数据库信息。我的web.config内容如下:
<?xml version="1.0"?>

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="conStr" value="Server=(local);database=wsfcdb;Uid=wsfc;Pwd=88a"/>
<add key="CrystalImageCleaner-AutoStart" value="true" />
<add key="CrystalImageCleaner-Sleep" value="60000" />
<add key="CrystalImageCleaner-Age" value="120000" />
</appSettings>
<connectionStrings>
<add name="SQLCONNECTIONSTRING" connectionString="data Source=(local);database=wsfcDB;
user id=wsfc;pwd=88a"
providerName="System.Data.SqlClient" />
<add name="wsfcdbConnectionString" connectionString="Data Source=(local);Initial Catalog=wsfcdb;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true"/>
<authentication mode="Windows"/>
<customErrors mode="Off"/>
<sessionState mode="InProc" timeout="600"/>
<httpHandlers><add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></httpHandlers></system.web>

</configuration>

是不是配置那里还要改?水晶报表真是麻烦?

zcl26 2008-11-19
  • 打赏
  • 举报
回复
水晶报表,研究了两天没搞明白
加载更多回复(3)

111,131

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧