Errors in Spread.NET 12

Posted by: grapecity on 15 February 2019, 6:25 pm EST

    • Post Options:
    • Link

    Posted 15 February 2019, 6:25 pm EST

    Hello,

    I have just updated to Spread.NET 12. When I try to open a form with a spread I get an error.

    Code:

             // 
             // m_grdHingeLocations
             // 
             this->m_grdHingeLocations->AccessibleDescription = L"";
             this->m_grdHingeLocations->AllowEditOverflow = true;
             this->m_grdHingeLocations->Anchor = static_cast<System::Windows::Forms::AnchorStyles>(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) 
                | System::Windows::Forms::AnchorStyles::Left));
             this->m_grdHingeLocations->ColumnSplitBoxPolicy = FarPoint::Win::Spread::SplitBoxPolicy::Never;
             this->m_grdHingeLocations->EditModeReplace = true;
             this->m_grdHingeLocations->LFDApplicable = true;
             this->m_grdHingeLocations->Location = System::Drawing::Point(72, 96);
             this->m_grdHingeLocations->LRFDApplicable = true;
             this->m_grdHingeLocations->Name = L"m_grdHingeLocations";
             this->m_grdHingeLocations->RowSplitBoxPolicy = FarPoint::Win::Spread::SplitBoxPolicy::Never;
             this->m_grdHingeLocations->Sheets->AddRange(gcnew cli::array< FarPoint::Win::Spread::SheetView^  >(1) {this->m_grdHingeLocations_Sheet1});
             this->m_grdHingeLocations->Size = System::Drawing::Size(256, 216);
             this->m_grdHingeLocations->TabIndex = 1;
             this->m_grdHingeLocations->TabStripPolicy = FarPoint::Win::Spread::TabStripPolicy::Always;
             tipAppearance1->BackColor = System::Drawing::SystemColors::Info;
             tipAppearance1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
                static_cast<System::Byte>(0)));
             tipAppearance1->ForeColor = System::Drawing::SystemColors::InfoText;
             this->m_grdHingeLocations->TextTipAppearance = tipAppearance1;
             this->m_grdHingeLocations->RowAdded += gcnew Brass::RowAddedEventHandler(this, &FormHinges::m_grdHingeLocations_RowAdded);
             // 
    
    

    Error, which happens on these lines:

             this->m_grdHingeLocations->ColumnSplitBoxPolicy = FarPoint::Win::Spread::SplitBoxPolicy::Never;
    ...
             this->m_grdHingeLocations->RowSplitBoxPolicy = FarPoint::Win::Spread::SplitBoxPolicy::Never;
    
    
    

    “Message: Object reference not set to an instance of an object.” When I comment out those lines, this line

             this->m_grdHingeLocations->Sheets->AddRange(gcnew cli::array< FarPoint::Win::Spread::SheetView^  >(1) {this->m_grdHingeLocations_Sheet1});
    
    

    produces the exception error: “System.AccessViolationException: ‘Attempted to read or write protected memory. This is often an indication that other memory is corrupt.’”

    m_grdHingeLocations_Sheet1 has been successfully created above with

             this->m_grdHingeLocations_Sheet1 = (gcnew FarPoint::Win::Spread::SheetView());
    
    

    With these errors already I am very wary about staying on with version 12.

  • Posted 18 February 2019, 7:38 am EST

    Hello,

    Could you please clarify from which version are you upgrading your application? And is possible please send us a small working sample in older version. We will try to upgrade it at our end and will check the errors you are getting and will try to get it fixed for you in latest version.

    Please share small working sample. We will look into the same thereon.

    Thanks,

    Reeva

  • Posted 20 February 2019, 5:59 pm EST

    We updated from 11.45.20183. I have created a sample project but I can’t duplicate the errors in it. I will continue to test to see what is causing the issue.

  • Posted 25 February 2019, 6:36 am EST

    Hello,

    Please share your sample at your convenience. We will look into the same thereon.

    Thanks,

    Reeva

  • Posted 27 February 2019, 4:43 pm EST

    Hi Reeva,

    I deactivated 12, reactivated 11, then reversed it again and no longer get those errors when opening my forms. I am getting new behavior that I did not get in version 11. We have always used

             long lRowHeaderWidth = static_cast<long>(this->Sheets->default[lSheet]->RowHeader->Columns[iRowHeader]->Width);
    
    

    to get the row header width, but now with version 12 that is returning a value of -1. Should I be using a different call to get the width of the row header?

  • Posted 28 February 2019, 3:39 am EST

    Hello,

    We are able to replicate the issue with V12 wherein default width of rowHeader column is coming to be -1 and hence we are escalating the same to the concerned team for the fix.

    Tracking id for your issue is #270368

    We will update you as soon as we hear anything from our concerned team.

    Thanks,

    Reeva

  • Posted 28 February 2019, 4:39 am EST

    Hello,

    Our developers have confirmed that it is by design for default models of V12.

    In V12, the value -1 indicates that the width of row header will be calculated automatically.

    In V11, value 35( default width of rowHeader column) is hard-coded as initialized value. However, in case you want to have same behavior then you can set that value to the row header’s column width explicitly.

    Hope it clarifies.

    Thanks,

    Reeva

  • Posted 28 February 2019, 11:40 am EST

    Yes, that clarifies. Thank you.

  • Posted 28 February 2019, 12:05 pm EST

    When I put text (“Away from Interior Support”) into the row header and set the width to 150, then call GetPreferredWidth(), it returns -1 again. Perhaps I don’t understand what that function should return, but it seems to me that it should return a value that is large enough to include the entire text string I assigned the row header. Can you please verify?

  • Posted 1 March 2019, 3:01 am EST

    Hello,

    According to our developers, GetPreferredWidth return the suitable smallest width that can display all content. It doesn’t relate to your assigned width.

    Hope it clarifies.

    Thanks,

    Reeva

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels