cancel
Showing results for 
Search instead for 
Did you mean: 

Reports not working properly after upgrading app from Visual Studio 2008 to VS2010

mike_hopkins2
Explorer
0 Kudos

So, I've done lots of searches both here and on google... have tried lots of suggestions but nothing seems to work. 

I have a 'test' application that wrote that replicates our applications reporting functionality.  It is currently written in VS2008/VB.Net .NET 3.5 framework and uses the crystal reports 11.5 run time.  All reports are external files, this code and this set of report has been working fine for several years.  We are now trying to upgrade our dev env to VS2010 using .NET 4.0 framework (full version not the client version).

The test application does the following:

     - Shows dialog for user to pick the report file to run

     - .Load : load the report

     - Reads our DB connection info from our reg key

     - Updates the login info for the report (and any sub report if they exist)

     - Goes through the Parameters looking for one named @LocationId

          If the parameter exists, we set it a defined value so the user never gets prompted.

         (Any other parameters are untouched and the Crystal Viewer prompts for them as designed)

     - We then assign the report document to the crystal viewer .ReportSource

This all works fine in the current environment.

To test for upgrade I did the following.

     - Installed CR for VS2010 (have tried the Release, SP1-SP5)

     - Upgraded the test project to VS2010

     - Changed the .NET Framework to 4.0

     - Cleaned the project and rebuilt.

I then started testing various reports.  Most seem to work just fine, but a few are having serious issue.  The CR Viewer is prompting for the @LocationId parameter we are setting.. it does so over and over ... and the report never runs.

So, same exact report, just different run time versions .... very different results.

We have multiple customers, each has copies of the report(s) for our application...

each customer has their own copy of .Crystal Reports designer to modify/add reports.

What we are trying to avoid is manually updating a bunch of report across a large number of customers.

I do not write the reports, only maintain the code that displays them....

One example is as follows

There are 2 Stored Procedures

Both SP's have the @LocationId parameter as their only parameter.

There are 2 Parameter Fields Defined

@LocationId : is set in code

StatementDate : Is the Dynamic LOV (displays a String, but returns an numeric ID Value)

The first SP is used to build a dynamic LOV's from one of our tables

The second is actually used to build the report details from another table, based on what is picked in the first.

There are no 'Links' defined in the Database Expert (although I have tried adding them to see if it made a difference.. it did not)

On the reports Record Selection Formula Editor it does the following to filter the records

     {tl_sp_StatementGroups_AgedAR_Report;1.ID} = {?StatementDate}

Again, all this worked exactly as is with VS2008/CR Runtime 11.5.....

(The @LoationId was set in code and the user was not prompted for this value

The LOV of statement dates was displayed and allowed the user to pick a value as desired)

my question(s)

- Is this a bug in the VS2010 run time / or was it a bug in the 11.5 that it actually ran to begin with

- The behavior is definitely different, is there any way via VB code that I can compensate? (nothing that I've found leads me to believe this is true).

- Are we stuck with manually 'updating' a bunch of report across many different customers?

I've spent a considerable amount of time researching / experimenting with the code.. with no luck.  The only

thing that has worked so far is to modify the report and associated SP's.

Any input much appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Mike,

To clarify, in CR 11.5 were you using the CR .NET assemblies or the RDC?

Try exporting the report to RPT format and see what the default value is for that parameter.

Could be it is not being saved/updated.

Are you using RAS ( ReportClientDocument ) or the Engine ( ReportDocument ) to update the parameter values?

And you should link the SP's, CR is a relational database reporting tool which means the data sources should be linked.

Likely the prompts are coming for each value that could be returned. May be related to the unlinked SP's.

Don

mike_hopkins2
Explorer
0 Kudos

- We are using the CR .NET assemblies

- Using the engine (Reportdocument)

Private Sub UpdateParameters(ByRef ReportObj As ReportDocument)

Dim pvs As ParameterValues = Nothing

Dim pv As ParameterDiscreteValue = Nothing

Try

    For Each x As CrystalDecisions.Shared.ParameterField In ReportObj.ParameterFields

    If x.Name.ToLower = Me.strLocIdParam.ToLower Then

        x.CurrentValues.Clear()

        pvs = New ParameterValues

        pv = New ParameterDiscreteValue

        pv.Value = Me.intLocationID

        pvs.Add(pv)

        If x.ReportName.Length = 0 Then

        ReportObj.SetParameterValue(x.Name, pvs)

        Else

        ' its a subreport so set the param value in the specific sub report

        ReportObj.SetParameterValue(x.Name, pvs, x.ReportName)

        End If

    End If

    Next

Catch ex As Exception

    Throw ex

End Try

End Sub

- We tried linking the SP's... nothing changed.

- Try exporting the report to RPT format and see what the default value is for that parameter.

I really don't work with the actual report, but I did export it.. but not really sure how to check the value?

mike_hopkins2
Explorer
0 Kudos

Was away for a while, so this got dropped.    But I just did some re-testing with the v13 sp8 run time vs the v11.5 run time.

The exact same report runs fine with 11.5 but still shows the issue described in the original post.  Pretty sure visual studio is not the problem, but the crystal run time seems to work differently between the 2 versions.

Anyone have any thoughts on this?  It really is a show stopper for use.

0 Kudos

HI Mike,

The report prompting for parameter values is because for every record returned it prompts. I suspect there is a different parameter value missing.

Try adding a record selection formula to return 3 rows of data and see what it's looking for.

Don

mike_hopkins2
Explorer
0 Kudos

Don

Its not that is prompting for params, its that the 2 run time version work differently on the same report.  The 13 version basically does not allow me to run the report while the 11.5 version handle the parameters properly.

We provide a value for @LocationID in code that runs reports and then we let Crystal prompt for any other parameters.

For example

- We Set @LocationId = 1 (so Crystal does not prompt for this value)

- We then have a parameter @StatementID which is a dynamic list of value

- There are 2 other params based on static list of values

With 11.5

- The Crystal parameter form shows the @StatementId LIst and the other 2 lists as expected.  You pick values and the report runs.

With 13

- The Crystal parameter form shows @LocationId as a text box entry, even though we have provided a value in code.  If I type in a value and hit ok.. it will not proceed, its stuck on that parameter.  I can click the 'set null' and hit Ok and I get a second prompt showing the other params, but the @StatementId does not display a list.. it just shows the prompt for it.

The bottom line is if the report runs fine with the 11.5 runtime, why doesn't it work with the 13 version of the run time?

mike_hopkins2
Explorer
0 Kudos

Any chance we can revisit this?  At the time, we decided to stay with the 11.5 run time.  We really need some help with this.  To restate... "exact same report" runs in 11.5 but will not run properly with version 13 (sp10) run time.  The issues is somehow related to parameters.... we have a lot of reports with dynamic lov's and multiple parameters (and the person responsible for reports does not think anything is wrong with the report since it works with 11.5 sp6 runtime??)

Answers (0)