cancel
Showing results for 
Search instead for 
Did you mean: 

Compatibility of CR in VS2008 and VS2003

Former Member
0 Kudos

Hi,

Urgently require advise on how to rectify the following issue.

I've deployed a new application developed using VS2008, complied in .NET

Framework 2.0, into a web server whose applications were developed with

VS2003.

My new application developed from VS2008 does not have any crystal report components. Its only a simple Webform and connecting to DB for retreivals & updates.

however its the deployment of this application is affecting the those application developed with VS2003 with crystal report components.

After my deployment, older applications that used .NET Crystal Report

component developed with VS2003 were affected. Is there any advise on what

can i do to the web server?

Web server is already with .NET Framework 2.0.

This is the error I've got is as below

Logon failed.

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: CrystalDecisions.CrystalReports.Engine.LogOnException:

Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web

request. Information regarding the origin and location of the exception can

be identified using the exception stack trace below.

Stack Trace:

[LogOnException: Logon failed.]

. I(String , EngineExceptionErrorID ) +506

. D(Int16 , Int32 ) +537

CrystalDecisions.CrystalReports.Engine.FormatEngine.GetLastPageNumber(ReportPageRequestContext reqContext) +182

CrystalDecisions.ReportSource.LocalReportSourceBase.GetLastPageNumber(ReportPageRequestContext reqContext) +174

CrystalDecisions.Web.ReportAgent.get_LastPageNumber() +34

CrystalDecisions.Web.ReportAgent.u(Boolean n) +104

CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +108

System.Web.UI.Control.PreRenderRecursiveInternal() +62

System.Web.UI.Control.PreRenderRecursiveInternal() +125

System.Web.UI.Control.PreRenderRecursiveInternal() +125

System.Web.UI.Page.ProcessRequestMain() +1499

Regards

YL

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Most likely possibility

A .NET 2003 application will use framework 1.1. As soon as you installed an app that uses .NET 2008, you'd have to install framework 2.0 or 3 in order for that app to work. Now, the 2003 .NET app will find the new framework and use it. Unfortunately, the CR assemblies in that app are only able to use 1.1 framework. Thus you have two options:

1) Recompile the .NET 2003 app on .NET 2005 or .NET 2008. Crystal reports that are supported on .NET 2005 / 2008 are able to work with framework 2.0.

2) See the following MS Kbase on how to force apps to use framework 1.1:

http://msdn2.microsoft.com/en-us/library/65y5x3xf(vs.71).aspx

Ludek

Answers (8)

Answers (8)

Former Member
0 Kudos

Hi,

I don't know what happen, my test PC is behaving the same as my webserver.

don't tink its the DLL's problem, since i've already installed the merge modules and its still not working.

I've read CrystalDecisions.CrystalReports.Engine.LogonException that sometimes some changes to any settings may cause this exception to occur

I've tried re-mapping the XSD files now the exception raised is on the exporting the file to PDF, only that the exception error is still Logon Failed.

at least it went past the rpt.SetDataSource(ds) line which i encountered last friday.

i've tried changing

rpt.SetDataSource(ds) --> rpt.SetDataSource(ds.Table(0)),

tested the application, the report is exported but it does not contain any records, only an empty formatted file

afterwhich, i revert back to original that is rpt.SetDataSource(ds)

Below is the portion of the code written to export result to PDF

Dim strExportFile As String

Dim objExOpt As ExportOptions

Dim objDiskOpt As New DiskFileDestinationOptions

Dim s As System.IO.MemoryStream = rpt.ExportToStream(ExportFormatType.PortableDocFormat)

With HttpContext.Current.Response

.ClearContent()

.ClearHeaders()

.ContentType = "application/pdf"

.AddHeader("Content-Disposition", "inline; filename=" & strExportFile)

.BinaryWrite(s.ToArray)

.End()

End With

Any idea how can i go about this?? Am i progressing anywhere??

Thanks a lot!

0 Kudos

Hi YLK,

This posting is way beyond the abilities of this forum. You seem to be asking everyone to debug your code for you and off on many topics.

Please go to our Diamond Support site where you will find all sorts of samples and how to's. Once you have a specific issue then post each question singularly. Do not post multiple issues in a posting. If this does not resolve your issue then please purchase a support case and a dedicated engineer can help you debug. But please go to the samples and downlaod samples. Start off simple with a Windows app and work your way to WEB so you get to learn the SDK and .NET object models.

Here's the link to Diamond: https://boc.sdn.sap.com/developer/library

I am going to mark this post as completed.

Thank you

Don

0 Kudos

HI YLK,

You werent a nuisance or disturbing the forum.

Don was just stating that your thread was all over the place with various questions and became so convoluted that it was impossible to figure out what was going on.

Follow Don's suggestions.

Get the samples and try and get a good understanding of the SDK.

When posting questions stick to a single issue/topic per post.

These forums are community forums, not technical support forums.

We can do basic troubleshooting, but if the issue is too complex or will take alot of time then paid support is the only recourse.

You are welcome to post questions at any time so do not let this discourage you.

Just follow the Rules of Engagement and good luck!

Jason

Former Member
0 Kudos

hi ludek,

sort of, I've set up a PC with similar environment to the webserver with CR problem to try out the various solutions i have

the only difference between these 2 machines is the OS. Webserver is Win2K Sp4, whereas test PC is WinXP

Former Member
0 Kudos

Hi,

I was wondering what happens if you try to display or use a sample report through the application? Does it works? The sample reports are available in C:\Program Files\Microsoft Visual Studio X\Crystal Reports\Samples\en\Reports\General Business. You need not pass anything for connection or parameter etc, just try to display it through the application.

Does that help?

Thanks,

AG.

Former Member
0 Kudos

hi guys,

I've tried deploying a an application with merge module to my win2k sp4 webserver. --> problem still exist

tried changing the machine.config --> problem still exist

tried add the dlls to an existing application by setting 'Copy to Local' = true --> problem still exist.

wat else can i try??

pls help!!!

Former Member
0 Kudos

hi AG,

the CR 9.1 i have is bundled together with VS.NET

Former Member
0 Kudos

Hi,

Ok, its crystal with VS2003 but what I was looking for is if sample reports work file in the system where the issue is coming up? The reason for this is these reports are simple and we need not pass anything to them like parameter or database credentials. So if we keep everything simple we can find out if we can view the report or not thus confirming the crystal dlls are ok or not.

Moreover just one thing copying the crystal dlls to target machine does not work you need to use the merge modules to create a msi file from VS or use the server install exe/msi to install the runtimes.

Thanks.

AG.

Former Member
0 Kudos

hi AG,

Thanks for your response.

As for deploying merge modules, i've already tried that, its error still persists after deployment.

I will try the crystal report samples on the webserver.

Now i'm going back to basic, setting the datasource to the crystal report.

As im a newbie to crystal report in .NET, i'm figuring out how does the connection between CR and dataset is set up.

How do i know whether my report is an embedded or non-embedded resource?

Former Member
0 Kudos

Here's the src code from my aspx.vb

Imports System.Text

Imports System.Data

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

Public Class ReportPL

Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

Protected WithEvents btnView As System.Web.UI.HtmlControls.HtmlInputButton

Protected WithEvents txtCartonNo As System.Web.UI.WebControls.TextBox

Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer

'NOTE: The following placeholder declaration is required by the Web Form Designer.

'Do not delete or move it.

Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

End Sub

#End Region

Public myFuncs As New myFunctions

Public myScript As New Script

Public myPLReport As New PLReport

Dim rpt As New rptPacking_List

Public myConnector As New Connectors

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

If Session("User") Is Nothing Then

Response.Redirect("Login.aspx")

End If

Dim s As Object = Request.ContentEncoding.EncodingName

If Not IsPostBack = True Then

Session("CartonNoAddCtPl") = Nothing

myScript.eFocus(Me, txtCartonNo.ID)

End If

End Sub

Private Sub btnView_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnView.ServerClick

Dim ds As New dtsDSMS

Dim rptPL As New rptPacking_List

If Not txtCartonNo.Text = "" Then

If Not IsNumeric(txtCartonNo.Text) Then

myScript.eAlert(Me, txtCartonNo.ID, "Carton No must in numeric number.")

Exit Sub

Else

If txtCartonNo.Text.Length <> 10 Then

myScript.eAlert(Me, txtCartonNo.ID, "Carton No must in 10 digits number.")

Exit Sub

End If

End If

Else

myScript.eAlert(Me, txtCartonNo.ID, "Please key in Carton No.")

Exit Sub

End If

Dim strCondition1 As String = " pl.CartonNo = '" & txtCartonNo.Text & "' and pl.ManageStatus <> 2"

Dim myDatatable As DataTable = myFuncs.GetPLReportList(strCondition1)

Dim strCondition As String = txtCartonNo.Text

Dim booCarton As Boolean = myFuncs.ValidateCarton(strCondition)

If booCarton = True Then

myScript.eAlert(Me, txtCartonNo.ID, "CartonNo is not exist.")

Exit Sub

End If

Dim strConnString As String = myConnector.IISConnectString -- Exception is raised from here

Dim sqlCarton As String = "Select pl.CartonNo as ""CartonNo"", pl.FileNo as ""FileNo"", REPLACE(CONVERT(CHAR(25), pl.OpenDate, 103),'/','-') ""OpenDate"",pl.ClientName ""ClientName"", pl.Subject as ""Subject"",(select StatusDesc from FileStatus where StatusCode=pl.Status) ""FStatus"",(select StatusDesc from PLStatus where StatusID = pl.PLStatus) ""PLStatus"", pl.PLStatus as ""PLStatusID"", pl.SubFileID as ""SubFileID"", pl.Remark as ""Remarks"",c.DOD as ""DOD"", (select User_Name from User_DB.dbo.User_Details where user_id=c.CreatedBy) ""CreatedByTxt"", c.CreatedBy as ""CreatedBy"", pl.FileOwner ""FileOwner"", REPLACE(CONVERT(CHAR(25), c.PLDate, 103),'/','-') ""PackingListDate"" from Carton c left join PackingList pl on c.CartonNo = pl.CartonNo where " & strCondition1 & " order by pl.fileno"

Dim cartonDA As New SqlClient.SqlDataAdapter(sqlCarton, strConnString)

Try

cartonDA.Fill(ds, "PList")

Catch ex As Exception

myScript.eAlert(Me, txtCartonNo.ID, ex.Message)

End Try

rpt.SetDataSource(ds)

Dim report As New rptPacking_List

CrystalReportViewer1.ReportSource = report

Dim strExportFile As String

Dim objExOpt As ExportOptions

Dim objDiskOpt As New DiskFileDestinationOptions

Dim s As System.IO.MemoryStream = rpt.ExportToStream(ExportFormatType.PortableDocFormat)

With HttpContext.Current.Response

.ClearContent()

.ClearHeaders()

.ContentType = "application/pdf"

.AddHeader("Content-Disposition", "inline; filename=" & strExportFile)

.BinaryWrite(s.ToArray)

.End()

End With

End Sub

End Class

Former Member
0 Kudos

This is the file where all the connection strings to various DBs stored

Public Class Connectors

Private Shared pIISConnect As String = "Persist Security Info=False;" & _

"Integrated Security=false;database=CAMS;server=DN-IIS1;" & _

"password=sa;user id=sa"

Public Shared ReadOnly Property IISConnectString()

Get

Return pIISConnect

End Get

End Property

End Class

Former Member
0 Kudos

This is the report class src code

'----


' <autogenerated>

' This code was generated by a tool.

' Runtime Version: 1.1.4322.2407

'

' Changes to this file may cause incorrect behavior and will be lost if

' the code is regenerated.

' </autogenerated>

'----


Option Strict Off

Option Explicit On

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.ReportSource

Imports CrystalDecisions.Shared

Imports System

Imports System.ComponentModel

Public Class rptPacking_List

Inherits ReportClass

Public Sub New()

MyBase.New

End Sub

Public Overrides Property ResourceName As String

Get

Return "rptPacking_List.rpt"

End Get

Set

'Do nothing

End Set

End Property

<Browsable(false), _

DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property Section1 As CrystalDecisions.CrystalReports.Engine.Section

Get

Return Me.ReportDefinition.Sections(0)

End Get

End Property

<Browsable(false), _

DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property Section2 As CrystalDecisions.CrystalReports.Engine.Section

Get

Return Me.ReportDefinition.Sections(1)

End Get

End Property

<Browsable(false), _

DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property Section3 As CrystalDecisions.CrystalReports.Engine.Section

Get

Return Me.ReportDefinition.Sections(2)

End Get

End Property

<Browsable(false), _

DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property Section4 As CrystalDecisions.CrystalReports.Engine.Section

Get

Return Me.ReportDefinition.Sections(3)

End Get

End Property

<Browsable(false), _

DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)> _

Public ReadOnly Property Section5 As CrystalDecisions.CrystalReports.Engine.Section

Get

Return Me.ReportDefinition.Sections(4)

End Get

End Property

End Class

<System.Drawing.ToolboxBitmapAttribute(GetType(CrystalDecisions.Shared.ExportOptions), "report.bmp")> _

Public Class CachedrptPacking_List

Inherits Component

Implements ICachedReport

Public Sub New()

MyBase.New

End Sub

Public Overridable Property IsCacheable As Boolean Implements CrystalDecisions.ReportSource.ICachedReport.IsCacheable

Get

Return true

End Get

Set

'

End Set

End Property

Public Overridable Property ShareDBLogonInfo As Boolean Implements CrystalDecisions.ReportSource.ICachedReport.ShareDBLogonInfo

Get

Return false

End Get

Set

'

End Set

End Property

Public Overridable Property CacheTimeOut As System.TimeSpan Implements CrystalDecisions.ReportSource.ICachedReport.CacheTimeOut

Get

Return CachedReportConstants.DEFAULT_TIMEOUT

End Get

Set

'

End Set

End Property

Public Overridable Function CreateReport() As CrystalDecisions.CrystalReports.Engine.ReportDocument Implements CrystalDecisions.ReportSource.ICachedReport.CreateReport

Dim rpt As rptPacking_List = New rptPacking_List

rpt.Site = Me.Site

Return rpt

End Function

Public Overridable Function GetCustomizedCacheKey(ByVal request As RequestContext) As String Implements CrystalDecisions.ReportSource.ICachedReport.GetCustomizedCacheKey

Dim key As [String] = Nothing

'// The following is the code used to generate the default

'// cache key for caching report jobs in the ASP.NET Cache.

'// Feel free to modify this code to suit your needs.

'// Returning key == null causes the default cache key to

'// be generated.

'

'key = RequestContext.BuildCompleteCacheKey(

' request,

' null, // sReportFilename

' this.GetType(),

' this.ShareDBLogonInfo );

Return key

End Function

End Class

Former Member
0 Kudos

all the connctions to SQL DB are using the same connection string

they are working fine as i still can perform inset & update within the application.

only can't display crystal report as a PDF format giving the error as posted on my 1st post in this thread.

thanks!

Former Member
0 Kudos

Hi AG,

I've tried deploying a sample of Crystal Report from VS.NET 2003 into my test PC set up earlier without VS.NET installed.

It only have .NET framework 1.1, 2.0 and merge module installed for CR 9.1.5

My own developed application is working fine on this test PC, but not the sample. Have yet to deploy to my webserver.

I've checked that the Database & Reports folder from the Samples are in the same path as it was in a development machine. (c:\Program Files\Microsoft Visual Studio .NET 2003\Samples)

Just wondering, if this sample does not/does work on my webserver, what does tt indicate?? What happen to those belonging to my applications?

Below is the error from VS2003.NET Crystal Report samples ->

Server Error in '/WebForms' Application.

-


Object reference not set to an instance of an object.

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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]

CRSamples.SimplePage.GetSampleReportsDir() +29

CRSamples.SimplePage.Page_Init(Object sender, EventArgs e) +12

System.Web.UI.Control.OnInit(EventArgs e) +67

System.Web.UI.Control.InitRecursive(Control namingContainer) +240

System.Web.UI.Page.ProcessRequestMain() +174

Former Member
0 Kudos

hi ludek,

for the below code, shd i put in Web.config

Specifying the Runtime Version

Without an application configuration file, the latest compatible runtime version installed on the computer is loaded by default. If this behavior does not satisfy the requirements of your COM application, you can indicate in a configuration file the specific runtime version that your application requires. For example, you can specify runtime version 1.0.3705, which loads the .NET Framework version 1.0.

To specify runtime version 1.0.3705

Using an XML editor, create an application configuration file.

Insert the following standard header at the beginning of the file:

Copy Code

<?xml version ="1.0?>

Insert the following XML elements into the file:

Copy Code

<configuration>

<startup>

<requiredRuntime version="v1.0.3705" safemode="true"/>

</startup>

</configuration>

Setting the safemode attribute to true prevents the runtime startup code from checking the registry and ensures that only runtime version 1.0.3705 is loaded.

Former Member
0 Kudos

i think the CR dlls that are deployed in the webserver by using Merge Module as there wasnt any Crystal Report s/w installed i guess.

Will deploying merge module help?

former_member183750
Active Contributor
0 Kudos

Is this thread and [this|; thread related?

Ludek

Former Member
0 Kudos

thank you amid for your reply. But what i'm trying to do is to roll back the changes. By installing VS2008 runtime, will it affect my older applications? Pls note that I've long since remove the VS2008 application from the server.

hi ludek,

i've already tried uninstalling & installing each the framework and test out the applications after action on the framework. But the problem don't go away...sob~...too many days has past, need to resolve this asap.

i can only try on the problem machine if i can get my hands on 1 test machine for me to try on or got to wait till after office hrs to try as its a 'live' server.

Will creating a merge module help? My network admin just informed me that there's disk space constraint in the server, thus installing anything big like VS2003.net as my fren suggested is not possible

thanks a lot!

Cheers

YL

Former Member
0 Kudos

hi all,

I've tried uninstalling the .NET framework 1.1 and 2.0 and installing these 2 framework back into the webserver, the error still persists.

I've notice that there's this folder in C:\Program Files\Common Files\Crystal Decisions\1.0\Bin in my webserver.

However, in my colleague's PC, there's another folder called C:\Program Files\Common Files\Crystal Decisions\1.1\Managed --> In here, contains the DLLs that we are using for CR reports. This folder is missing in my webserver!!!.

Any idea how to install these dlls into my webserver?

I've check the webserver's C:\Winnt\assembly folder, the DLLs that the older applications reference to are still there, but i just can't find the physical dll.

Pardon me for asking the above question as I've no prior knowledge on Crystal Report and the administrator/programmer who did this has left.

Thanks a lot for any help.

Edited by: YL K on Sep 22, 2008 3:16 PM

Former Member
0 Kudos

Hi,

Have you installed the runtime package of VS 2008 on a machine on which you are deploying your application.

If not then install it from [here|http://resources.businessobjects.com/support/additional_downloads/runtime.asp#08].

Hope that work

Amit

former_member183750
Active Contributor
0 Kudos

The two directories:

C:\Program Files\Common Files\Crystal Decisions\1.0\Bin

and

C:\Program Files\Common Files\Crystal Decisions\1.1\Managed

are fine and do not come into play in this case (the latter is only present on dev computers).

However, I would like to see what happens if you uninstall framework 2.0 and lever framework 1.1 only.

If the above does not help, I'd recommend the following as a test:

1) Download CR XI r2 eval from here:

http://www.businessobjects.com/products/reporting/crystalreports/eval.asp

2) Install the eval on the problem computer

3) Try to run the reports in the CR XI designer. Do they rune there?

Reason I want to do all of the above. There is still the possibility that framework 2.0 is interfering, so let's get rid of it and test that possibility. The other possibility is that something has changed on the database side (I understand that your first reaction may be "no way", bit at this point you've got nothing else to try...). Anyhow, running the report in the CR designer will tell us. If neither the designer, nor the app can run the report, it's a db issue and we'll need to fix that first. Either in the CR designer, or on the database side. But that is a bridge to be crossed when we get to it.

Ludek

Former Member
0 Kudos

hi AG,

My colleague has tried remapping the dataset, it still does not work.

We've tried running the .NET 1.1 framework set up file hoping that it will repair any damaged dlls but still cannot work. We still get the same logon fail error.

Former Member
0 Kudos

hi AG,

Thanks for your repoonse.

Yup, can say that I'm trying to rolled back the changes and i'm referring the the old applications that are getting the logon failed runtime error msg from .NET

I've tried re-deploying the one of the older applications with CR, recompiled, but i did not do the remapping step as suggested, the error, logon fail, still persists. Will try your method when i'm back in office.

Any other advises?

Thanks!

Edited by: YL K on Sep 21, 2008 2:48 AM

Former Member
0 Kudos

Thanks Luke for the answer.

i've tried aspnet_regiis -u and aspnet_regiis -i for .NET framework 1.1

however it still does not work.

Can re-registering the CR's components into GAC resolve the issue?

I've removed the application developed with VS2008 from the web server since its affecting my older application that were developed by VS2003 & .NET 1.1.

These applications seem to in their normal behavior, can retrieve and insert records.

current problem left is that applications with CR will get the Logon failed error whenever i try to retrieve a report.

Former Member
0 Kudos

Hi,

You can try opening the reports from VS2008 and save them, then try to use it in your updated application. I would suggest working with one report at this time as a test. As Ludek suggested that the application should refer to 2.0 or 3 framework and the crystal dlls need to be updated.

From the last section in your post, I believe you have rolled back the changes and reffering to the old applicatio and getting the logon prompt, right? Then try opening the reports in designer remap the fields using Set Datasource and try it in you application after saving them. That might take off any changes made to the reports.

Hope that helps!

AG.