Adding a new sheet to existing sheet in fpspread web

Posted by: jbshaik on 8 September 2017, 2:03 pm EST

  • Posted 8 September 2017, 2:03 pm EST

    Hi,

      Any one can suggest me how to add new sheet to existing sheet.

    Thank's in Advance.

  • Replied 8 September 2017, 2:03 pm EST

    Hello,

    Sheets can be added to workbook or the Spread component.In case you want to add the new sheets to the component, then you can either increase the sheet count to desired number of sheets or you can explicitly add sheet by using the Add method. Below illustrates the same:

    <blockquote>

    FpSpread1.Sheets.Count = 5

               OR

    Dim newsheet As New FarPoint.Win.Spread.SheetView()
    newsheet.SheetName = "North"
    newsheet.ColumnCount = 10
    newsheet.RowCount = 100
    FpSpread1.Sheets.Add(newsheet)

    </blockquote>

    Hope this helps.Thanks

  • Replied 8 September 2017, 2:03 pm EST

    Hi Suresh !


     Thank's it's working.

  • Replied 8 September 2017, 2:03 pm EST

    Hi Suresh,


      It's nice to see working. But i have small doubt.Assume that  i just write below code.


                                             <FONT size=2>FarPoint.Web.Spread.</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>SheetView</FONT></FONT><FONT size=2> newsheet=</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>new</FONT></FONT><FONT size=2> FarPoint.Web.Spread.</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>SheetView</FONT></FONT><FONT size=2>();


                                                                                           newsheet.ColumnCount=20;


                                                                                            newsheet.RowCount=20;


                                                                                    FpSpread1.Sheets.Add(newsheet);

    </FONT>

    I get exactly what i want.but here i'm observing the name of the adding sheet  is Sheet2. if user can want to change the name like "Price" replace Sheet2 how can i get this ? otherwise  How to change newsheet name in runtime. [I don't want to give sheetname is "Hard Coded" like u specify "North"]


     I hope  u can give reply asap to me.


    Thank's in Advance.

  • Replied 8 September 2017, 2:03 pm EST

    Hello,

    You can use the SheetName property to set the name of desired sheet. e.g. if you want to set the sheet2 name as Price, then by setting the SheetCount to any number greater than 2. e.g.

    <blockquote>

            FpSpread1.Sheets.Count = 5
            FpSpread1.Sheets(1).SheetName = "Price"

    </blockquote>

    similarly, you can also modify the sheet name in the earlier provided snippet from newsheet.sheetname="Price"

    Hope it helps. Thanks

  • Replied 8 September 2017, 2:03 pm EST

    Hi


     Thank's

Need extra support?

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

Learn More

Forum Channels