Crystal Reports 2008升级后出现AccessViolationException [英] AccessViolationException after Crystal Reports 2008 upgrade

查看:69
本文介绍了Crystal Reports 2008升级后出现AccessViolationException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有更好的msdn发布位置,请告诉我,我知道这可能是一个小问题.但是基本上,我只是尝试使用Visual Studio 2008从sp0的Crystal Reports基本版本升级到Crystal Report2008.这是Visual Studio 2008的升级顾问.似乎可以正常工作,并且我的程序仍可以编译.

我有两个使用Crystal reprots的应用程序,一个是C#Windows窗体应用程序,似乎转换得很好,并且可以正常工作,但是我开发的asp.net应用程序因Access | ViolatioNException崩溃,这是我知道的代码以前工作的方法如下:

I know this may be a little off topic, if there is a better msdn place to post let me know. But basically I have just attempted an upgrade from the crystal reports basic version to crystal reports 2008 with sp0 this is using visual studio 2008. The upgrade adviser came up for crystal reports and seemed to work ok and my programs still compile.

I have two applications using crystal reprots one is a C# windows forms app which seems to have converted fine and all works however an asp.net application I have developed crashes with an Access|ViolatioNException, this is code I know previously worked see below:

CrystalRepSource.Report.FileName ́ = report ;
SetupLogonInfo(CrystalRepSource);
//添加参数
AddParam( paramFields,pfItem1,dcItem1,``@ year'',SessionHandler.year);
AddParam(paramFields,pfItem2,dcItem2,``@school'',SessionHandler.school);
AddParam(paramFields,pfItem3,dcItem3,"@division",SessionHandler.division);
AddParam(paramFields,pfItem4,dcItem4,``@progArea'',SessionHandler.progArea);
AddParam(paramFields,pfItem5,dcItem5,"@ type",SessionHandler.record_type);
AddParam(paramFields,pfItem6,dcItem6,"@ filterText","学校 Division => /tr>
以及程序的 > Type == \''"+ SessionHandler.record_type_text +" \');
privatevoid void SetupLogonInfo(CrystalReportSourceCrystalRepSource)
> {
TableLogOnInfo logOnInfo = TableLogOnInfo();
logOnInfo = CrystalRepSource .ReportDocument.Database.Tables [ 0] .LogOnInfo;
ConnectionInfo font style ="color:red"> connectionInfo = "ConnectionInfo();
connectionInfo == logOnInfo .ConnectionInfo;
connectionInfo.DatabaseName == 应用程序 [" db"] .ToString();
connectionInfo.ServerName == 应用程序 [&服务器"] .ToString();
connectionInfo.Password == 应用程序 ["pass" ] .ToString();
connectionInfo.UserID == 应用程序 ['"user"].ToString();
CrystalRepSource. ReportDocument.Database.Tables [0] .ApplyLogOnInfo(logOnInfo);
私有void AddParam(ParameterFields paramFields,ParameterField pfItem,ParameterDiscreteValue dcItem,字符串fieldName和字符串值)
{{
pfItem .ParameterFieldName = fieldName ;
dcItem.Value == ;
pfItem.CurrentValues.Add(dcItem);
paramFields.Add(pfItem);
CrystalRepSource.Report.FileName = report
SetupLogonInfo(CrystalRepSource); 
//add parameters 
AddParam(paramFields, pfItem1, dcItem1, "@year", SessionHandler.year); 
AddParam(paramFields, pfItem2, dcItem2, "@school", SessionHandler.school); 
AddParam(paramFields, pfItem3, dcItem3, "@division", SessionHandler.division); 
AddParam(paramFields, pfItem4, dcItem4, "@progArea", SessionHandler.progArea); 
AddParam(paramFields, pfItem5, dcItem5, "@type", SessionHandler.record_type); 
AddParam(paramFields, pfItem6, dcItem6, "@filterText", "School = \'" + SessionHandler.school + 
                                                        "\' Division = \'" + SessionHandler.division 
                                                        + "\' Programme Area = \'" + SessionHandler.progArea 
                                                        + "\' Record Type = \'" + SessionHandler.record_type_text + "\'"); 
 
 
private void SetupLogonInfo(CrystalReportSource CrystalRepSource) 
    { 
        TableLogOnInfo logOnInfo = new TableLogOnInfo(); 
        logOnInfo = CrystalRepSource.ReportDocument.Database.Tables[0].LogOnInfo; 
 
        ConnectionInfo connectionInfo = new ConnectionInfo(); 
        connectionInfo = logOnInfo.ConnectionInfo; 
        connectionInfo.DatabaseName = Application["db"].ToString(); 
        connectionInfo.ServerName = Application["server"].ToString(); 
        connectionInfo.Password = Application["pass"].ToString(); 
        connectionInfo.UserID = Application["user"].ToString(); 
 
        CrystalRepSource.ReportDocument.Database.Tables[0].ApplyLogOnInfo(logOnInfo); 
    } 
 
    private void AddParam(ParameterFields paramFields, ParameterField pfItem, ParameterDiscreteValue dcItem, string fieldName, string value) 
    { 
        pfItem.ParameterFieldName = fieldName
        dcItem.Value = value
        pfItem.CurrentValues.Add(dcItem); 
        paramFields.Add(pfItem); 
    } 

推荐答案

Hi,

由于您使用的是Crystal Report 2008,请参阅Crystal Report官方网站 网站以获取更多信息.

Since you use the crystal report 2008, please refer to the crystal report official web site to get more information.

http://technicalsupport.businessobjects.com/cs/forums/default.aspx

http://support.businessobjects.com/downloads/runtime.asp <跨度样式=">


这篇关于Crystal Reports 2008升级后出现AccessViolationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆