create a custom sheet

Posted by: luigggye2012 on 8 September 2017, 4:34 am EST

  • Posted 8 September 2017, 4:34 am EST

    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;">Hi, <o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">I hope all is well.<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">As every control, the sheets have a tag property, OK.<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">In the tag property we know that we can store any king of data, including a structure of data or an array of data with different types. OK.<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">But in order to make easier our development, we want to know if it is possible to add new properties to the sheets, by code, at runtime.<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">Actually, we are working in this way.<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">Public</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"> <SPAN style="COLOR:blue;">Structure</SPAN> SheetRecord<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';">        <SPAN style="COLOR:blue;">Public</SPAN> AreaId <SPAN style="COLOR:blue;">As</SPAN> <SPAN style="COLOR:blue;">integer<o:p></o:p></SPAN></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';">        <SPAN style="COLOR:blue;">Public</SPAN> AreaName <SPAN style="COLOR:blue;">As</SPAN> <SPAN style="COLOR:blue;">String<o:p></o:p></SPAN></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';">        <SPAN style="COLOR:blue;">Public</SPAN> AreaDay <SPAN style="COLOR:blue;">As</SPAN> <SPAN style="COLOR:blue;">Date<o:p></o:p></SPAN></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';">        <SPAN style="COLOR:blue;">Public</SPAN> AreaMonth <SPAN style="COLOR:blue;">As</SPAN> <SPAN style="COLOR:blue;">Date<o:p></o:p></SPAN></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';">        <SPAN style="COLOR:blue;">Public</SPAN> ReturnValueAreas <SPAN style="COLOR:blue;">As</SPAN> <SPAN style="COLOR:blue;">Object<o:p></o:p></SPAN></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';">        </SPAN><SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">Public</SPAN><SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';"> ReturnValueFilters </SPAN><SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">As</SPAN><SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';"> </SPAN><SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">Object<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">…………………………<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">…………………………<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">…………………………<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">…………………………<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">        Etc.<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">End</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"> <SPAN style="COLOR:blue;">Structure<o:p></o:p></SPAN></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';">Public</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"> <SPAN style="COLOR:blue;">Shared</SPAN> SheetProperties <SPAN style="COLOR:blue;">As</SPAN> SheetRecord = <SPAN style="COLOR:blue;">New</SPAN> SheetRecord<SPAN style="COLOR:blue;"><o:p></o:p></SPAN></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';">SheetProperties.AreaId = </SPAN><SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';">1</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';">SheetProperties.AreaName = </SPAN><SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';">"Sales"</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';">SheetProperties.AreaDay = </SPAN><SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';">Now.day</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';">SheetProperties.AreaMonth = Now.month<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';">SheetProperties.ReturnValueAreas = myObject1<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';">SheetProperties.ReturnValueFilters = myObject2<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:#002060;FONT-FAMILY:'Courier New';">FP.ActiveSheet.Tag = SheetProperties<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">If we could to create additional tag properties, we would to use simply in this way:<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.Tag = "Initialized"<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"> <o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.AreaId = 1<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.AreaName = "Sales"<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.AreaTabDay = Now.day<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.AreaMonth = Now.month<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.ReturnValueAreas = myObject1<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.ReturnValueFilters = muObject2<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">.......................<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">.......................<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">.......................<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">.......................</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"> <SPAN style="COLOR:black;"><o:p></o:p></SPAN></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.MyCustomTag99 = "Z"</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"> <o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">We know now, we can create custom sheets, with new properties, in other words <SPAN style="mso-fareast-theme-font:minor-latin;"></SPAN><SPAN style="FONT-SIZE:11pt;COLOR:black;FONT-FAMILY:Calibri;mso-fareast-font-family:Calibri;">FP.ActiveSheet.T</SPAN></SPAN><SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">ag1,  <SPAN style="mso-fareast-theme-font:minor-latin;"></SPAN><SPAN style="FONT-SIZE:11pt;COLOR:black;FONT-FAMILY:Calibri;mso-fareast-font-family:Calibri;">FP.ActiveSheet.T</SPAN></SPAN><SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">ag2,  <SPAN style="mso-fareast-theme-font:minor-latin;"></SPAN><SPAN style="FONT-SIZE:11pt;COLOR:black;FONT-FAMILY:Calibri;mso-fareast-font-family:Calibri;">FP.ActiveSheet.T</SPAN></SPAN><SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">ag3,  <SPAN style="mso-fareast-theme-font:minor-latin;"></SPAN><SPAN style="FONT-SIZE:11pt;COLOR:black;FONT-FAMILY:Calibri;mso-fareast-font-family:Calibri;">FP.ActiveSheet.T</SPAN></SPAN><SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">ag4,  etc.</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"> </SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">We have read the following articles: <SPAN style="COLOR:purple;">http://www.clubfarpoint.com/Forums/forums/post/11079.aspx</SPAN>, <SPAN style="COLOR:purple;">http://www.clubfarpoint.com/Forums/forums/post/9843.aspx</SPAN>, but is not exactly we need.</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"> </SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">We only need to create custom sheets, with the same functionality as standard sheets, plus multiples tags, <SPAN style="mso-fareast-theme-font:minor-latin;"></SPAN><SPAN style="FONT-SIZE:11pt;COLOR:black;FONT-FAMILY:Calibri;mso-fareast-font-family:Calibri;">FP.ActiveSheet.T</SPAN></SPAN><SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">ag1,  <SPAN style="mso-fareast-theme-font:minor-latin;"></SPAN><SPAN style="FONT-SIZE:11pt;COLOR:black;FONT-FAMILY:Calibri;mso-fareast-font-family:Calibri;">FP.ActiveSheet.T</SPAN></SPAN><SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">ag2, etc.</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"> </SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">We believe that is too easy to build a little complete project example doing the following:</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"> </SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"> </SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">CREATE_FP_CUSTOM_SHEET (tag1, tag2, tag3)  -----------> We need this</SPAN><SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"> </SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"> <o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.Tag = "Initialized"<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.Tag1 = 1<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.Tag2 = "A"<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">FP.ActiveSheet.Tag3 = Now()<o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">Could anybody send me an example about it?</SPAN><SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"><o:p></o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;"><o:p> </o:p></SPAN>


    <SPAN style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:Arial;">Thanks in advance,<o:p></o:p></SPAN>


    <o:p><FONT face="Times New Roman" size=3> </FONT></o:p>


    <SPAN style="COLOR:black;"><o:p> </o:p></SPAN>


     

  • Replied 8 September 2017, 4:34 am EST

    We do not have any examples that show this type of functionality.
  • Replied 8 September 2017, 4:34 am EST

    Could you give some idea about how to do that?


    Our application will work with a lot of sheets, and every sheet must to have about 30 custom properties.


    Thanks in advance,


    Luis Oliveira


     

  • Replied 8 September 2017, 4:34 am EST

    Public Class MySheetView
    Inherits FarPoint.Win.Spread.SheetView
    Implements System.Runtime.Serialization.ISerializable

    Dim s As String = "A1"

    Public Sub New()
    MyBase.New()

    End Sub

    Public Property Tag1() As String
        Get
    Return s
        End Get
        Set(ByVal value As String)
    s = value
        End Set
    End Property

    End Class

Need extra support?

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

Learn More

Forum Channels