Serialize And Deserialize Stitext

Stimulsoft Ultimate discussion
Post Reply
Eng.MAMB
Posts: 14
Joined: Mon May 23, 2011 1:44 am
Location: K.S.A

Serialize And Deserialize Stitext

Post by Eng.MAMB »

I need save some stitext properties separate than stireport

I used stitext.Serialize Function To save properties in XML File
And
I used stitext.Deserialize to Load properties values from XML File

But the properties is not loaded from XML

I this link file to show my work
and I hope to knew the correct way to save all properties from / to stitext

Thanks

HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Serialize And Deserialize Stitext

Post by HighAley »

Hello.
[quote="Eng".MAMB]I need save some stitext properties separate than stireport

I used stitext.Serialize Function To save properties in XML File
And
I used stitext.Deserialize to Load properties values from XML File

But the properties is not loaded from XML

I this link file to show my work
and I hope to knew the correct way to save all properties from / to stitext[/quote]
There is no any link in your message.
Please, send us your code for analysis.

Thank you.
Eng.MAMB
Posts: 14
Joined: Mon May 23, 2011 1:44 am
Location: K.S.A

Serialize And Deserialize Stitext

Post by Eng.MAMB »

Sorry..
This is The Link For Sample
http://www.tecnyt.com/Projects/SerializStiText.zip
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Serialize And Deserialize Stitext

Post by HighAley »

Hello.

Sorry for the delay with response. We need some additional time to prepare the answer for you.

Thank you.
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Serialize And Deserialize Stitext

Post by Ivan »

Hello,

Please modify your code:

Code: Select all

    Public Con As New StiReportObjectStringConverter()

    Private Sub ButSerializ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButSerializ.Click
        If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then

            Dim X As New XmlTextWriter(SaveFileDialog1.FileName, System.Text.Encoding.Default)
            X.WriteStartElement("item1")
            SText.Serialize(Con, X)
            X.WriteEndElement()

            X.Flush()
            X.Close()
        End If
    End Sub

    Private Sub ButDeSerializ_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButDeSerializ.Click
        Dim NText As New StiText
        If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then

            Dim x As New XmlTextReader(OpenFileDialog1.FileName)
            x.Read()
            NText.Deserialize(Con, x)

        End If
        Me.PropertyGrid1.SelectedObject = NText
        Me.Label2.Text = NText.Name
    End Sub
Thank you.
Post Reply