Strange behavior

Posted by: lg_sony_27 on 8 September 2017, 1:19 pm EST

  • Posted 8 September 2017, 1:19 pm EST

    Hi! I'm not sure as to what subject will i put for this new post. I get this strange behavior to my other sheets except the first one sheet. I generated my sheet programatically.


    This is what's happening. I typed Assign number of item and Score of students. I have a formula to sum up all the assign number of item as well as the total score of the students. I have set autocalculation to true. It works fine for the first sheet but when i do the same for the rest of the sheets it's not autocalculating. It will only calculate when i press the up arrow key and the strange thing is the sheet creates new row and duplicates the name of the student where i entered a the score or item. why is this so?


    Please see the attachment for a more detailed behavior of the sheets.


    By the way, i tried this with two students only for purposes of checking if my formula works.


    Thanks!


    2008/06/FarPoint.zip
  • Replied 8 September 2017, 1:19 pm EST

    Since I can't attached the database it self, I just created script for the table. 
    2008/07/script.zip
  • Replied 8 September 2017, 1:19 pm EST

    You are binding to a database that I do not have so I am unable to run your project.  Do you have a smaller project that uses an Access database that shows the same issues you are seeing?  I don't see anything in your code that would cause the problem you are seeing.  In the meantime I will see if I can get your project working to see if I can reproduce the problem.
  • Replied 8 September 2017, 1:19 pm EST

    I have attached smaller project but  I can't attach my database its more than 256KB. Im using sqlexpress 2005.


    Try entering value for the 1st grading and 2nd grading. you will see the problem in 2nd grading. When you type value in the fields it will not autocalculate. It will only autocalculate when you press the arrow key but doing so will create a new line (row) in the spread.


    2008/07/FarPoint.zip
  • Replied 8 September 2017, 1:19 pm EST

    Here's the XML file.


    2008/07/farpointXML.zip
  • Replied 8 September 2017, 1:19 pm EST

    I will see if I can get the project working using your script but I don't have sqlexpress.  Could you save the spread as an xml file and attach that.  If it is bigger than 256k send it to fpsupport@fpoint.com and mark it to my attention.  Thanks.
  • Replied 8 September 2017, 1:19 pm EST

    i will send it to you again
  • Replied 8 September 2017, 1:19 pm EST

    after selecting the section and subject in combobox, go to 2nd grading sheet. in the first row just type in any value in A1 item and A1 columns. If you will look at the assign column, note that it is not autocalculating. you need to click the save button first before it will calculate. You try to type in value in the 2nd row and press the up arrow key you will see that it fpspread will create a new rows and it will autocalculate this time.


    It's been bothering me for quite sometime now. I hope you can help me here.

  • Replied 8 September 2017, 1:19 pm EST

    BobM, can you try adding two records in the table? Just fill up the following fields- IDNO, LastName, FirstName and MiddleName,SubjectName and SectionName as follows


    HL20080001     Brown       Alain            Pierce     Computer1        St. John


    HL20080002    Benning     Christine      Reed       Computer1        St. John


    When you run the apps, just select from the first 2 combobox list.


    Thanks again.


     


     

  • Replied 8 September 2017, 1:19 pm EST

    I am still not able to reproduce this.
  • Replied 8 September 2017, 1:19 pm EST

    I received your mdf file but something is still not correct.  If I select an item from the first two comboboxes and click the display button then there are no rows in the spread.
  • Replied 8 September 2017, 1:19 pm EST

    There is no data in this file, just a few new labels in the header.  Can you save it to an xml file after you are done with all your binding, etc?  I was able to get your sql file and create a database but again when binding the spread to it I see the same thing.  There is no data in the cells.
  • Replied 8 September 2017, 1:19 pm EST

    Hello,


    These columns must be calculated fields in the bound DataSource, since there is no where you added a Formula property to those columns in the Spread.

  • Replied 8 September 2017, 1:19 pm EST

    Does it mean that I have to do it all over again? Any suggestions? the fastest and easiest way or doing these without major overhauling my codes?
  • Replied 8 September 2017, 1:19 pm EST

    Hello,


    What is it that you are asking if you have to do all over again? You are only setting the Fomula property for the first sheet. Youhave not set the Formula on any other of the Sheets. When you format the other sheets, you would just need to add code to set the Formula property on each column you want formulas.

  • Replied 8 September 2017, 1:19 pm EST

    Hello,


    Bob asked me to look at your project. I was able to get it to load and see the issue you are talking about, so I debugged your code and I do not see where you are assigining any formulas except to the first sheet in the Spread Designer. This is why the formulas only work on the first sheet, since you only assign the formulas to this first sheet.

  • Replied 8 September 2017, 1:19 pm EST

    How do I set the formula on the other sheets since I create those through codes?


    thanks!

  • Replied 8 September 2017, 1:19 pm EST

    I am creating the other sheets on load of the form that's why i have only one sheet. The other formulas are also written on that same sheet. if you scroll to the right side of the sheet you can see my formulas.


    Formulas also worked on the other sheets except that its not autocalculting and whenever I pressed the arrow key the names of the students are doubled. I need to click the save button first before it calculates. Any alternative way of doing this right? I have been stuck with this for more than a week now. Thanks!

  • Replied 8 September 2017, 1:19 pm EST

    In my code, you will see that columns for 1st grading are only shown for 1stgrading sheet, the same also with 2ndgrading sheet, only columns for 2nd grading are shown. I have hidden the columns.

  • Replied 8 September 2017, 1:19 pm EST

    That's where I would start.
  • Replied 8 September 2017, 1:19 pm EST

    Just call the SuspendLayout at the beginning of your code and the ResumeLayout at the end of your code.
  • Replied 8 September 2017, 1:19 pm EST

    With my current setup, how do i use the SuspendLayout and ResumeLayout methods?


    I read one of the post in databindings that turning off the autocalculation will help but it's not an option to me because I need the user to see the computed result at once after they press the enter key.


    By they way, I will be using the app in a network environment. If in local computer the accessing time takes sometimes, I would imagine how it would be in a network environment especially that there are more than 30 users will be accessing it at the same time. Sad

  • Replied 8 September 2017, 1:19 pm EST

    You can place a call to the SuspendLayout method at the start of your code and a call to ResumeLayout at the end of your code.  There is not a way to speed up the saving to a database.
  • Replied 8 September 2017, 1:19 pm EST

    Thanks BobM. It works. My one issue now is speed of opening and saving to the database. It takes quite sometime to load and save it.
  • Replied 8 September 2017, 1:19 pm EST

    Just specify the sheet and the cell(s) you want to put the formula in...

    FpSpread1.Sheets(x).Cells(x,x).Formula = your formula

    where x is the sheet index and the cell co-ordinates.

  • Replied 8 September 2017, 1:19 pm EST

    you mean in i have to put it in my display button and in the formatspread() subs that i have?

  • Replied 8 September 2017, 1:19 pm EST

    Yes, that is the correct way to do it.  If it isn't increasing your performance then there aren't any other options I can think of.
  • Replied 8 September 2017, 1:19 pm EST

    am i doing it right?

  • Replied 8 September 2017, 1:19 pm EST

    Hi!


    I tried putting suspendlayout and resumelayout at every sub I have but it seems that it has no effect at all. SadSad

Need extra support?

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

Learn More

Forum Channels