cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot evaluate expression because the current thread is in a stack overflow state

Former Member
0 Kudos

Hi everyone

I am using Crystal Reports with Visual Studio 2010 and have the following problem:

When I create a group name field and start the program, generate the report everything works. Shows the grouping on the program. But if  in the left hand panel with the tree drop down I click on one of the names of the group, everything stops and the app crashes and I get an error

"Value cannot be null" (null exception)

On show detail I get the

Cannot evaluate expression because the current thread is in a stack overflow state.

Without grouping everything works but that left sided panel is empty so there is nothing to click inside, there is a possibility it would crash if there was.

Even if I click on the text Preview, it crashes, so without clicking on the tree it crashes. Any text in the group tree side panel and it all breaks down.

Any idea why this is happening?

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

What SP for CRVS2010 are you using?

Can you copy in here your code?

Web, WPF or Win app?

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

I have no idea what service pack of crystal reports when I go to help it just says Crystal reports for .Net framework 4.

I am creating a WPF app. I have figured a sort of workaround, I just set the group panel not to show at all and the button as well. Would like to see a solution if possible.

Here is my code for the report. I use a dispatcher because of timing:

[code]

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Data;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Navigation;

using System.Windows.Shapes;

using Inventar.Presenters;

using Inventar.Model;

using CrystalDecisions.CrystalReports.Engine;

using Inventar.UserControls;

using System.Collections.ObjectModel;

using CrystalDecisions.Shared;

namespace Inventar.Views

{

    /// <summary>

    /// Interaction logic for Report.xaml

    /// </summary>

    public partial class Report : UserControl

    {

        //CrystalReport1 report = new CrystalReport1();

       

      

        CrystalReport1 report = new CrystalReport1();

        public Report()

        {

           

            int ZoomLevel = 75;

            try

            {

            InitializeComponent();

            //ParameterFieldDefinitions crParameterFieldDefinitions;

            //ParameterFieldDefinition crParameterFieldDefinition;

            //ParameterValues crParameterValues = new ParameterValues();

            //ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

            //crParameterDiscreteValue.Value = textBox1.Text;

            //crParameterFieldDefinitions = report.DataDefinition.ParameterFields;

            //crParameterFieldDefinition = crParameterFieldDefinitions["StartDate"];

            //crParameterValues = crParameterFieldDefinition.CurrentValues;

                Dispatcher.BeginInvoke(new Action(() =>

                {

                  

                    crystalReportsViewer1.ViewerCore.Zoom(ZoomLevel);

                    report.Database.Tables[0].SetDataSource(Presenter.ListReport);

                    crystalReportsViewer1.ViewerCore.ReportSource = report;

                  

                }), System.Windows.Threading.DispatcherPriority.Background);

                //report.SummaryInfo.ReportAuthor = Presenter.Login.Username;

            }

            catch (Exception ex)

            {

                MessageBox.Show("Doslo je do greske" + ex.Message);

                throw new Exception(" and error is: " + ex.Message);

            }

        }

       public ReportPresenter Presenter

        {

            get { return DataContext as ReportPresenter; }

        }

        private void Close_Click(object sender, RoutedEventArgs e)

        {

            Presenter.CloseReport();

        }

      

  

        //private void crystalReportsViewer1_Refresh(object source, SAPBusinessObjects.WPF.Viewer.ViewerEventArgs e)

        //{

           

        //    Presenter.RefreshReport();

        //}

     }

}

[/code]

The dispatcher is there because I had some other issue with even starting up the report and that helped me solve them.

former_member183750
Active Contributor
0 Kudos

I have no idea what service pack of crystal reports when I go to help it just says Crystal reports for .Net framework 4.

Go here:

C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86

Look at any file / dll - they all should be version 13.0.4.x.

If they are not, get SP 4 from here:

http://scn.sap.com/docs/DOC-7824

- Ludek

Former Member
0 Kudos

Hi Ludek sorry for the late reply. I go here

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64

And then right click on the file and go properties, then go to tab details and there I have

Product Version: 13.0.3.612

File version is the same. It's probably a stupid question but is this what you mean?

former_member183750
Active Contributor
0 Kudos

I got the monopoly on "stupid questions" , so no such thing left for you.

Product Version: 13.0.3.612 indicates you are on SP3, so if you could try SP4, that would be great.

- Ludek

Former Member
0 Kudos

I downloaded the SP4 but the problems are still the same. I dunno if the problem is that I use 64 bit windows and install the 32 bit crystal reports. I do it cos I develop the applications for 32 bit operating systems...

I tried installing the 64 bit version and I still get the same issue.

former_member183750
Active Contributor
0 Kudos

Hmm - not sure. The 32 bit vs 64bit should not be an issue - it's not for me anyhow. I tested with one of our sample reports and I get no issues at all. If you do the test with your report as "saved data", do you get the  same issue?

Also, can you do a quick test with your report in the win viewer?

- Ludek

Former Member
0 Kudos

Was this issue ever addressed? I am having a similar issue. When the Preview tree is clicked on a report, a StackOverflowException is thrown. If the user navigates to the last page of the report before clicking on the Preview tree, no error is thrown.

former_member183750
Active Contributor
0 Kudos

Well, I assumed there was nothing to address as Dino abandoned the Discussion after my last reply...

So, the question would be; is your issue identical? E.g.;

WPF App

Version of SP

32 bit app on a 64 bit OS

There have been a number of fixes released for the WPF viewer, so updating to SP 8 will be a good idea. If that does not work, then my questions for Dino would apply:

If you do the test with your report as "saved data", do you get the  same issue?

Also, can you do a quick test with your report in the win viewer?

- Ludek

Former Member
0 Kudos

IM so sorry ludek I got swepped up in other things at my company and then I wasnt in the country and I just completely forgot about this.

AS a possible solution (although im not sure if i ever solved this and am remembering a different problem if im being honest) I would ask if there is an issue with your formula. My problem was some bug in a formula I was using in the report (the grouping formula as a matter of fact). the formula was working fine in 2012 but in ca for 2013 problems arose even though it didn't tell me. It went through. I had to go into the formula editor and then when I tried to exit and save it said I had an error. and it was an error that I could only solve by downloading the standalone version of cs and then correcting and saving the report in there. I posted another post for that problem and I can give you a link if you find that some formula field is causing the error.

ONce again sorry for the lateness of the reply.

Former Member
0 Kudos

Updating the CR viewer to SP8 seems to have resolved the issue. Go figure

Thanks for your attention.

former_member183750
Active Contributor
0 Kudos

Not a problem at all Dino. I know how it goes. As much as I do not want to admit it, I have abandoned / lost Discussions my self here.

I do thank you for jumping in though. Very appreciated

Happy New Year,

- Ludek

former_member183750
Active Contributor
0 Kudos

Great news Steve.

Please note that we are tracking one more issue with the WPF viewer;

If you use tabs and there is a viewer on each tab, tabbing back and forth looses focus on the viewer. See this Discussion for more details. At this time, we're hopeful for SP 9 (March) to address the remaining issues, though last note I got from R&D was a bit "lukewarm"...

- Ludek

Answers (0)