Issues when upgrading to Version 4

Posted by: sameek on 8 September 2017, 1:53 pm EST

  • Posted 8 September 2017, 1:53 pm EST

    We have recently upgraded to the lastest maintance release of Version 4.  When opening the application after upgrading some obvious differences are


    (1)  The column widths are all messed up, We were using .GetPreferredWidth to set the column widths and now they are all much too small.


    (2)  On some of the spreads it opens up with the bottom row showing at the top??


    (3)  It is displaying zeroes in the numeric cell types where i had set the showleadingzeroes to false and no decimal places which before did not show zeroes and now is.


    (4) If I reference anything before setting the datasource as far as rows or columns go, it is blowing up the application


    (5) On some of the spreads before it is loaded there is a gray box showing in the top left corner


    (6) On one of our hierachical spreads we are not showing the column headers on the child views.  We have set the .ColumnHeaderVisible = False this used to work but since the upgrade it is now showing the column headers


    These are just the obvious observations so far, not to mention that we had to go back to set the classic style skin in all the spreads to make them look like they used to.


    I am just wondering why something would quit working in the new version?  I understand adding new features, but I don't understand why something would no longer work that was working in a previous version.  I have looked through the forums for easy solutions like the classic skin setting for some of these other problems but I have not found any solutions.  Any help would be appreciated.


     

  • Replied 8 September 2017, 1:53 pm EST

    To add to this when it is trying to remove rows from the spread using code that was in a post that supossedly works it now blows up in Version 4.  Here is the code


    <FONT color=#0000ff size=2><FONT color=#0000ff size=2> 


    With</FONT></FONT><FONT size=2> UserDefinedPrepackSetupSpread.Sheets(0)


    .DataSource = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Nothing

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</FONT></FONT><FONT size=2> .RowCount > 0 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Then</FONT></FONT><FONT size=2> .Rows.Remove(0, .RowCount)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</FONT></FONT><FONT size=2> .ColumnCount > 0 </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Then</FONT></FONT><FONT size=2> .Columns.Remove(0, .ColumnCount)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>With

    </FONT></FONT>

    the RowCount is 1 but it is blowing up with an invalid row index -1.  I don't understand how it can blow up if the row count is 1 and you are removing 0 for count of 1 how can that be an invalid index.

  • Replied 8 September 2017, 1:53 pm EST

    Hello -


    I am sorry I do not have time to create an application for you to test an upgrade on.  I would have hoped that you all would have some insight into some of the issues without requesting a sample application.  I have figured out the column heading one, setting the ColumnHeaderVisible to false does not do it, I actually had to set the columnheaderrowcount to 0 to get them not to show.  I am still having issues on two spreads with the grey box in the upper left corner upon load of the control, not sure how to get rid of that, And any spreads that get loaded with more than one page of data and loading with the bottom rows showing at the top and you have to scroll up to get to the top row.  That is really frustrating.  These are all bound spreads and the ones now blowing up when trying to set the rowcount to 0 are also frustrating.  I tried what you had and the same error happens. 


    Regards,


     

  • Replied 8 September 2017, 1:53 pm EST

    Upgrading from  3.0.2005.2005  to  4.0.2010.2005
  • Replied 8 September 2017, 1:53 pm EST

    Hello Mmeek, 

    Plesae provide us with following details:

    1. The version of spread that you are upgrading from.

    2. The version of spread that you are upgrading to.

    Regarding the "Invalid RowIndex" please try setting  

    <span class="Apple-style-span" style="font-family:Tahoma;">

    <font size="2">UserDefinedPrepackSetupSpread.Sheets(0).RowCount=0 and <span class="Apple-style-span" style="font-family:Arial;"><span class="Apple-style-span" style="font-family:Tahoma;">UserDefinedPrepackSetupSpread.Sheets(0).ColumnCount=0</span></span></font>

    <font size="2"><span class="Apple-style-span" style="font-family:Arial;"><span class="Apple-style-span" style="font-family:Tahoma;"><span class="Apple-style-span" style="font-family:Arial;">Looking forward to your inputs. </span></span></span></font>

    <font size="2"><span class="Apple-style-span" style="font-family:Arial;"><span class="Apple-style-span" style="font-family:Tahoma;"><span class="Apple-style-span" style="font-family:Arial;">Regards, </span></span></span></font>

    </span>

     

  • Replied 8 September 2017, 1:53 pm EST

    Hello, 

    Thank you for sharing this information. I would appreciate if you can provide us with a sample application with a form containing spread 3.0.2005.2005 version so that we can try upgrading it to 4.0.2010.2005

    Regards, 

  • Replied 8 September 2017, 1:53 pm EST

    Well I am not sure what is causing the problem to be honest but here is an example, when the statement that sets the rowcount = 0 gets executed it blows up.  This did not happen in the previous version.

    <FONT size=2>

    </FONT><FONT size=1><FONT color=#008000><FONT color=#008000>''' </FONT></FONT><FONT color=#808080><FONT color=#808080><summary>

    </FONT></FONT></FONT>

    <FONT color=#008000><FONT color=#008000><FONT size=1>''' Loads the control.</FONT>

    </FONT></FONT>

    <FONT size=1><FONT color=#008000><FONT color=#008000>''' </FONT></FONT><FONT color=#808080><FONT color=#808080></summary>

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>Private</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>Sub</FONT></FONT> StyleStoreSizing_Load(<FONT color=#0000ff><FONT color=#0000ff>ByVal</FONT></FONT> sender <FONT color=#0000ff><FONT color=#0000ff>As</FONT></FONT> System.Object, <FONT color=#0000ff><FONT color=#0000ff>ByVal</FONT></FONT> e <FONT color=#0000ff><FONT color=#0000ff>As</FONT></FONT> System.EventArgs) <FONT color=#0000ff><FONT color=#0000ff>Handles</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>MyBase</FONT></FONT>.Load</FONT>


    <FONT size=1>Tracer.TraceEnter()</FONT>


    <FONT color=#0000ff><FONT color=#0000ff><FONT size=1>Try</FONT>

    </FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler</FONT></FONT> Business.Binding.Placement.StyleAssignChange, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshMonthComboBoxes</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler </FONT></FONT>Business.Logic.AssignStyles.StyleAssignChange, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshMonthComboBoxes</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler</FONT></FONT> Business.Logic.AddNewLine.StyleAssignChange, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshMonthComboBoxes</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler</FONT></FONT> Business.Logic.GenerateOrders.OrdersChanged, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshOrderedLines</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler</FONT></FONT> Business.Table.StyleColor.OfferingCodeChanged, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshSpread</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler</FONT></FONT> Business.Table.Style.OfferingCodeChanged, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshSpread</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler</FONT></FONT> Business.Table.Style.PackTypeChanged, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshSpread</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler </FONT></FONT>Business.Logic.SpreadSizes.SelectPack, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> PrepackSelection</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler </FONT></FONT>StyleRanking.StyleColorChanged, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshSpread</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler</FONT></FONT> StyleSetup.StyleColorChanged, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> RefreshSpread</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>AddHandler</FONT></FONT> Spread.Spread.EscapeKeyPressedInSpread, <FONT color=#0000ff><FONT color=#0000ff>AddressOf</FONT></FONT> HandleEscapeKeyInSpread</FONT>


    <FONT color=#008000><FONT color=#008000><FONT size=1>'Fill in Month Combobox</FONT>

    </FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>Dim</FONT></FONT> myMonths <FONT color=#0000ff><FONT color=#0000ff>As</FONT></FONT> Business.Table.PlanMonthCollection = Plan.PlanMonths</FONT>


    <FONT size=1>MonthComboBox.DisplayMember = <FONT color=#a31515><FONT color=#a31515>"MonthName"

    </FONT></FONT></FONT>

    <FONT size=1>skipIndexChange = <FONT color=#0000ff><FONT color=#0000ff>True

    </FONT></FONT></FONT>

    <FONT size=1>MonthComboBox.DataSource = myMonths</FONT>


    <FONT size=1>MonthComboBox.DropDownStyle = ComboBoxStyle.DropDownList</FONT>


    <FONT size=1>MonthComboBox.SelectedIndex = -1</FONT>


    <FONT size=1>MonthComboBox.Select()</FONT>


    <FONT size=1>skipIndexChange = <FONT color=#0000ff><FONT color=#0000ff>False

    </FONT></FONT></FONT>

    <FONT size=1>StoreDetailSpread.Sheets(0).RowCount = 0  </FONT>


    <FONT size=1>StoreDetailSpread.Sheets(0).ColumnHeader.Visible = <FONT color=#0000ff><FONT color=#0000ff>False</FONT></FONT></FONT>


    <FONT size=1>StyleColorSpread.Sheets(0).RowCount = 0 </FONT>


    <FONT size=1>StyleColorSpread.Sheets(0).ColumnHeader.Visible = <FONT color=#0000ff><FONT color=#0000ff>False

    </FONT></FONT></FONT>

    <FONT size=1>StoreDetailSpread.Visible = <FONT color=#0000ff><FONT color=#0000ff>True

    </FONT></FONT></FONT>

    <FONT size=1>SetCellTypes()</FONT>


    <FONT size=1>savedIndex = -1</FONT>


    <FONT size=1>savedSelectedRow = -1</FONT>


    <FONT size=1>SizeLineButton.Enabled = <FONT color=#0000ff><FONT color=#0000ff>False

    </FONT></FONT></FONT>

    <FONT size=1>SizeAllLinesButton.Enabled = <FONT color=#0000ff><FONT color=#0000ff>False

    </FONT></FONT></FONT>

    <FONT size=1>ClearButton.Enabled = <FONT color=#0000ff><FONT color=#0000ff>False

    </FONT></FONT></FONT>

    <FONT size=1>SortLinkLabel.Enabled = <FONT color=#0000ff><FONT color=#0000ff>False

    </FONT></FONT></FONT>

    <FONT size=1>FilterLinkLabel.Enabled = <FONT color=#0000ff><FONT color=#0000ff>False

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>For</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>Each</FONT></FONT> category <FONT color=#0000ff><FONT color=#0000ff>As</FONT></FONT> PlanCriteriaCategory <FONT color=#0000ff><FONT color=#0000ff>In</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>Me</FONT></FONT>.Plan.PlanCriteriaCategories</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>If</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>CType</FONT></FONT>(category.Id, CriteriaCategoryType) = CriteriaCategoryType.Mic <FONT color=#0000ff><FONT color=#0000ff>Then

    </FONT></FONT></FONT>

    <FONT size=1>MicCheckbox.Checked = <FONT color=#0000ff><FONT color=#0000ff>True

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>End</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>If

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>If</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>CType</FONT></FONT>(category.Id, CriteriaCategoryType) = CriteriaCategoryType.MajorClass <FONT color=#0000ff><FONT color=#0000ff>Then

    </FONT></FONT></FONT>

    <FONT size=1>MajorCheckbox.Checked = <FONT color=#0000ff><FONT color=#0000ff>True

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>End</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>If

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>If</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>CType</FONT></FONT>(category.Id, CriteriaCategoryType) = CriteriaCategoryType.MinorClass <FONT color=#0000ff><FONT color=#0000ff>Then

    </FONT></FONT></FONT>

    <FONT size=1>MinorCheckbox.Checked = <FONT color=#0000ff><FONT color=#0000ff>True

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>End</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>If

    </FONT></FONT></FONT>

    <FONT color=#0000ff><FONT color=#0000ff><FONT size=1>Next</FONT>

    </FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>If</FONT></FONT> Plan.ViewOnly _</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>And</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>Not</FONT></FONT> User.UserAuthority.IsUserLevel01 <FONT color=#0000ff><FONT color=#0000ff>Then

    </FONT></FONT></FONT>

    <FONT size=1>viewOnly = <FONT color=#0000ff><FONT color=#0000ff>True

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>End</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>If

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>Catch</FONT></FONT> ex <FONT color=#0000ff><FONT color=#0000ff>As</FONT></FONT> Exception</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>Global</FONT></FONT>.Common.Logger.Report.ReportException(ex)</FONT>


    <FONT color=#0000ff><FONT color=#0000ff><FONT size=1>Throw</FONT>

    </FONT></FONT>

    <FONT color=#0000ff><FONT color=#0000ff><FONT size=1>Finally</FONT>

    </FONT></FONT>

    <FONT size=1>Tracer.TraceExit()</FONT>


    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>End</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>Try

    </FONT></FONT></FONT>

    <FONT size=1><FONT color=#0000ff><FONT color=#0000ff>End</FONT></FONT> <FONT color=#0000ff><FONT color=#0000ff>Sub

    </FONT></FONT></FONT>
  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    I created an application with Spread 3.0.2005.2005 using the functionalities that you mentioned in your very first post.


    I could not replicate most of them however I Found that while upgrading to 4.0.2010.2005 it is now showing the column headers in hierachical spreads for child view. I have reported it as a bug to our QA team to fix , Bug Number: 25772. Hope it will be fixed in our next maintenance release.


    I Would really appreciate if you could elaborate on "If I reference anything before setting the datasource as far as rows or columns go, it is blowing up the application" so that I further work on it to check.


     

  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    Since you are removing the rows and columns, then you will need to remove the spans first. Setting the DataSource should not set the RowCount to 0, since it should just replace the DataModel with a new one and the count should never be 0.

  • Replied 8 September 2017, 1:53 pm EST

    Thank you for telling me about the Span bug that does take care of a couple of issues It is still blowing up in the following code when setting the datasource, Would this be the same problem?  Would I need to remove the spans since resetting the datasource would basically get rid of the rows?


     

    <FONT color=#008000 size=2><FONT color=#008000 size=2>

    ''' </FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2><summary>

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>''' The method clears the spread.

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>''' </FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2></summary>

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>''' </FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2><param name="visible"></FONT></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>Visible boolean</FONT></FONT><FONT color=#808080 size=2><FONT color=#808080 size=2></param>

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> ClearSpread(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> visible </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Boolean</FONT></FONT><FONT size=2>)


    Tracer.TraceEnter()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Try

    </FONT></FONT><FONT size=2>

    StoreDetailSpread.Sheets(0).ColumnHeaderVisible = visible


    StoreDetailSpread.Sheets(0).RowHeaderVisible = visible


    StoreBindingSource.DataSource = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> BindingSource


    StoreDetailSpread.Sheets(0).Rows.Remove(0, StoreDetailSpread.Sheets(0).Rows.Count)


    StoreDetailSpread.Sheets(0).Columns.Remove(0, StoreDetailSpread.Sheets(0).Columns.Count)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Catch</FONT></FONT><FONT size=2> ex </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> Exception


    Report.ReportException(ex)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Throw

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Finally

    </FONT></FONT><FONT size=2>

    Tracer.TraceExit()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Try

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub

    </FONT></FONT>
  • Replied 8 September 2017, 1:53 pm EST

     


     


    Hello,


    Please put a break point where the code for not showing column header exist after upgrading to the lastest maintance release of Version 4, and check whether that line of code is being executed<FONT size=2>


    Regards,


    Deepak Sharma</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    </FONT></FONT>
  • Replied 8 September 2017, 1:53 pm EST

    I am down to two issues now with the upgrade. 


    1.  One two of my spreads it is showing a gray box in the upper left corner even though I have no rows.  I have attached a screen shot of this.


    2.  On some of my spreads it is coming up with the last few rows at the top and I am having to page up to get to the first row.  Any idea how to get the spread to load like it used to with the top row actually showing at the top?


    2009/05/SpreadBox.JPG
  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    The easiest way to remove the spans is to use the Clear method on the DefaultSheetSpanModel.

    <FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>CType</FONT></FONT><FONT size=2>(FpSpread1.Sheets(0).Models.Span, FarPoint.Win.Spread.Model.DefaultSheetSpanModel).Clear()

    </FONT>
  • Replied 8 September 2017, 1:53 pm EST

    Okay well the application is blowing up in the method when Setting the DataSource to a New Binding Source.


    Also how do you remove a row span?

  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    The issue with the RowCount being set to 0 causing an exception to happen is an already known bug if you are using any spans in the Spread. There is a bug in the current source with the spans and 0 rows or columns in the Spread. This will be fixed in the next maintenance release. For now, you can work around the issue by removing the spans first.

  • Replied 8 September 2017, 1:53 pm EST

     


    Thanks for all of your help so far.  That did clear the gray box.  Also clearing the spans has cleared up some problems but sometimes my clear blows up with the following error.  Is there a way to handle for this?  I am not sure if i is because no spans exists at that time or what because it doesn't do it everytime?


    This is the code.... <FONT color=#0000ff size=2><FONT color=#0000ff size=2>


    If</FONT></FONT><FONT size=2> StoreDetailSpread.DataSource </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>IsNot</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Nothing</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Then

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>CType</FONT></FONT><FONT size=2>(StoreDetailSpread.Sheets(0).Models.Span, FarPoint.Win.Spread.Model.DefaultSheetSpanModel).Clear()


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</FONT></FONT>


    <FONT color=#0000ff size=2><FONT color=#0000ff size=2> <FONT color=#000000>This is the error the clear statement gets....</FONT></FONT></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    </FONT></FONT>

    Specified argument was out of the range of valid values.
    Parameter name: row

  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    You can use the GetColumnViewportCount and GetRowViewportCount methods to determine the number of viewports you have. Then you can loop through each one setting or getting the top row (SetViewPortTopRow and GetViewPortTopRow).

  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    1) The gray box at the top is the SheetCorner. Now, this is a seperate table from the ColumnHeaders and RowHeaders. You can set it's RowCount to 0 as well to get rid of it.

    <FONT size=2>

    FpSpread1.Sheets(0).SheetCorner.Rows.Count = 0


    2) I am not sure why the Spread is scrolling like this. You can end your code with calling the SetViewPortTopRow property to 0 to programatically scroll the Spread back to the top.

    </FONT>
  • Replied 8 September 2017, 1:53 pm EST

    Okay I have seemed to fix this on all the controls but one.  On this particular spread we add a viewport at the bottom and set the top row of the added one to a total row towards the bottom of the spread, this viewport is still showing correctly, the original viewport however, is scrolling down and showing the bottom rows even thorugh I have set the top row to 0.  So I was wondering if there is a way to see all the viewports on the spread and what their top rows are?  I am setting the ViewportTopRow(0,0) but maybe that is the wrong viewport?
  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    Adding a new row to the Binding Source could cause the Spread to scroll to display that new row in the Spread. However, this should not keep you from using the SetViewPortTopRow method to scroll the Spread back to the top. I would suggest putting the call to programatically scroll the Spread to a seperate ButtonClick event to make sure no other code is firing after it to reset the scroll posistion somewhere else.

  • Replied 8 September 2017, 1:53 pm EST

    No I am sorry, It would take way to long to strip down this application.  I do have another question/comment regarding setting the viewport top row.  While this does work on some of the spreads, it seems I can't get it to work on a couple of the spreads and the only common thing I can find on the ones that are not working is that there is a new row added to the binding source.  I was wondering if this might be causing an issue with the viewport?  On these spreads even if I set the viewporttoprow to 0 it does not do it.
  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    I can not find what may be causing this error to show in your project. It should not be because there is no spans. When you call the Clear method, we just loop through our internal list of all the spans and remove each one. Could you post a small zipped project reproducing this behavior for us to debug?

  • Replied 8 September 2017, 1:53 pm EST

    While this did allow me to see the text it looks different when I scroll all the way to the right.  I am attaching a copy of a picture of what it looks like when i pull up and then what it looks like when you scroll all the way to the right.  Not sure what to do about that?


    Also I wanted to add that the way I got the viewport top row to be set correctly was to set it outside of the background worker.  If I set it within a background worker it would not reflect it on the spread.


     


    2009/05/GrayBox.JPG
  • Replied 8 September 2017, 1:53 pm EST

    Yes I have tried all of that.  Here is the data that is showing up in the "Stores" column on our previous version


    0061,0064,0074,0401,0402,0403,0404,0405,0406,0407,0408,0409,0410,0411,0412,0413,0414,0419,0420,0421,0422,0425,0426,0427,0428,0430,0432,0433,0435,0436,0437,0438,0440,0441,0442,0443,0444,0445,0446,0447,0448,0450,0451,0452,0453,0454,0456,0457,0459,0460,0461,0462,0463,0464,0466,0467,0468,0469,0470,0471,0472,0473,0474,0476,0478,0479,0480,0482,0484,0485,0486,0491,0492,0493,0495,0497,0498


    and nothing is showing up in that column in the new version loading the same data.


     Here is part of my code where I have been trying to fix this.

    <FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    With</FONT></FONT><FONT size=2> StoreGroupingFpSpread.Sheets(0)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> c </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Spread.CellType.ColumnHeaderRenderer


    c.WordWrap = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    .ColumnHeader.DefaultStyle.Renderer = c


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Dim</FONT></FONT><FONT size=2> textType </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>New</FONT></FONT><FONT size=2> FarPoint.Win.Spread.CellType.TextCellType


    textType.WordWrap = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True

    </FONT></FONT><FONT size=2>

    textType.Multiline = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True

    </FONT></FONT><FONT size=2>

    .ColumnHeaderVisible = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True

    </FONT></FONT><FONT size=2>

    .DataAutoSizeColumns = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    .AutoGenerateColumns = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>False

    </FONT></FONT><FONT size=2>

    .Columns(Group).DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Group"

    </FONT></FONT><FONT size=2>

    .Columns(Group).Width = .Columns(Group).GetPreferredWidth + 10


    .Columns(Group).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Center


    .Columns(Stores).DataField = </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"DelimitedStoreIds"

    </FONT></FONT><FONT size=2>

    .Columns(Stores).CellType = textType


    .ColumnHeader.Columns(Stores).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left


    </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>' .Columns(Stores).CellType = New FarPoint.Win.Spread.CellType.TextCellType

    </FONT></FONT><FONT size=2>

    .Columns(Stores).Width = .Columns(Stores).GetPreferredWidth + 300


    .Columns(Stores).HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Left


    .Columns(Stores).VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Center


     


     


     


     

    </FONT>
  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    1) The ColumnHeader label should be centered, so if the center of the cell is off the Spread, it is possible the header would not display.


    2) What event are you using to put yuor code to implement this? I would suggest making sure the code is in the ButtonClick event of the Spread.

  • Replied 8 September 2017, 1:53 pm EST

    I have fixed the viewport top row issues.  I have found two more issues in the process.


    On one of our spreads we have a spread with two columns the first column is a letter and its width is pretty much fixed but the second column can be small or large depending on the field it is bound to.  In the previous version the data showed no matter how long it was and you could just scroll to the right to see it.  Now for some reason if there is a long string that is bound to the second column it is not showing any data in the column?  Any ideas on that one?


    The other issue is we have another spread with a checkbox in the first cell, a title in the second cell, and the last cell is a combobox.  The combobox has a 1 or a 2 in it depending on which checkbox you click first that is a 1 and second that is a 2 and we are filling these in automatically when the user clicks the checkbox.  This used to work but now I am having to click off the row before the 1 or 2 will show up? 


     

  • Replied 8 September 2017, 1:53 pm EST

    Hello,

    For bound spreadsheets, by default the spreadsheet inherits the width of the columns from the database. To determine your own custom widths, you would either need to set your width after binding the Spread or set DataAutoSizeColumns to false and set your width.

    Also there is one GetPreferredWidth which gets the minimum width necessary to display all the text within the specified
    column. Have you also tested any of the 2 mentioned methods.

    Thanks

  • Replied 8 September 2017, 1:53 pm EST

    Hi, 

    It seems that the TextCellType is not supporting such a large text. Is there any specific reason for using TextCellType? 

    I created a sample by creating a DataBase in SQL Server with a table of two columns. In one of the column I placed your large text. I found that setting the CellType of the Column to TextCellType didn't display anything in the 2nd column. However, if I change the CellType to GeneralCellType or I simply set the DataAutoCellTypes to False, everything works fine. 

    This is the code that I tried.

            Me.FpSpread1.Sheets(0).DataAutoCellTypes = False

            Me.FpSpread1.ActiveSheet.Columns(1).CellType = New FarPoint.Win.Spread.CellType.GeneralCellType()

    Let me know if it helps.

    Regards, 

  • Replied 8 September 2017, 1:53 pm EST

    Okay I have figured out a workaround for issue 2, I have to set the focus to the a different row and back to the original row for it to update.


    But on the issue with my data not showing up in the bound column, I still can't get that to work no matter how much I make the column bigger or justify it.  Is there a max text lenght now that a column can be bound to.  I can run the same application using the previous version we had with spread and the data shows up, in the new version it does not, it only happens when there is an extremly long comma delimited string in the column, other wise if it is not as many it will show the data. 

  • Replied 8 September 2017, 1:53 pm EST

    Here is the other picuture...
    2009/05/StoreGroup.JPG
  • Replied 8 September 2017, 1:53 pm EST

    Hello,

    Currently I am not sure what might be causing the behavior you are seeing? Could you post a zipped sample project for us to debug?

    Thanks

  • Replied 8 September 2017, 1:53 pm EST

    Hi, 

    It seems that your code for sorting is breaking the parent child relationship. Could you try implementing the sorting directly on the view of the dataset and then bind the spread to the resulting dataview?

    Regards, 

  • Replied 8 September 2017, 1:53 pm EST

    here is the problem picture
  • Replied 8 September 2017, 1:53 pm EST

    We have found more issues


    In the attached pictures you will see a spread that we have that has 3 levels.  These are bound spreads to custom collection objects.  This worked fine in the previous version that we had but in this version acts different.


    It only happens when the spread is sorted.   The originalnosort pictures shows how the spread looks drilled down with no sorting.  The second picture shows the spread sorted and then drilled into the same store on the original spread but the child spread looks different and it does not even allow me to drill to the 3rd spread.  if you put it back in original sort order it will work correctly.  Like I said this was working before.

  • Replied 8 September 2017, 1:53 pm EST

    Hi, 

    I apologize, I missed on the MaxLength property of the TextCellType. You may switch back to TextCellType from GeneralCellType and just increase the MaxLength property to adjust the large text. 

            Dim TCT As New FarPoint.Win.Spread.CellType.TextCellType

            TCT.MaxLength = 5000

    Regards, 

  • Replied 8 September 2017, 1:53 pm EST

    Well that may be a show stopper for the upgrade then.


    Here is another issue that we are seeing with a bound spread with a childview that only has one row and you can't see it.  You see the header and a tiny bit of the row but can't see the rest? Any ideas?


    I have attached a picture.


    2009/06/OneRowProblem2.JPG
  • Replied 8 September 2017, 1:53 pm EST

    We are using the <FONT size=2>

    Spread.ActiveSheet.AutoSortColumn(e.Column)


     So are you saying that I am now going to have to write my own sort in order to get something working that has been working in the past?


    Also we are running into that gray line(look at the problem picture) on other spreads when the spread is sorted and the row is expanded, any idea what that is?

    </FONT>
  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    I hope this <FONT color=#0000ff>Thread</FONT> may help you in finding the solution to exclude the first row on a filter.


     


    Thanks,


     

  • Replied 8 September 2017, 1:53 pm EST

    No, I am sorry I don't have time to do that.  We have decided to throw in the towel.  I have worked for 3 weeks trying to upgrade to the new version of spread and this find was the last straw.  I am going to revert back to our previous version and try to figure out how to filter on just row 2 through .rowcount.  The whole reason that we upgraded was to be able to exclude the first row on a filter.  So I am starting to think that figuring that problem out is easier than upgrading.  If you have an answer for how to do that in our previous version, I would appreciate it.
  • Replied 8 September 2017, 1:53 pm EST

    Hello,


    I have not been able to reproduce the issue with the hierarchial Spread with the parent SheetView in a sorted state. And the issue with the one child row not showing may be a timing issue with how you are changing the layout. Do you have a small zipped project reproducing these issues you can post for us to debug?

  • Replied 8 September 2017, 1:53 pm EST

    There seems to be a bug in the sorting module of the latest build which is breaking the parent child relationship causing both the issues that you are facing now. I would appreciate if you can send me a sample that can isolate this issue, that we can send to our QA team to replicate this issue. This will help us to get speedy resolution. 

    Regards, 

Need extra support?

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

Learn More

Forum Channels