Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Upgrade diagrams saved in base16/64? (Read 6049 times)
darrenwwwa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: May 12th, 2009
Upgrade diagrams saved in base16/64?
May 25th, 2009 at 7:24am
Print Post  
Hi,
We have been using an older version of the Diagram products for a while now. We are now upgrading from the older VB version to the newer WPF version. The new version only supports SaveToSTring (XML or compressed XML). With the older version we used SaveToString wtih Base 64 or 16 (I think).

Example: ArrayString = FlowChart1.SaveToString(True)

Is it possible to upgrade the saved diagrams?

Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Upgrade diagrams saved in base16/64?
Reply #1 - May 25th, 2009 at 8:59am
Print Post  
Hi,

The WPF version does not support the binary format of the Windows Forms one. You will have to transfer the old strings through the XML format. If you have all data in a database, you can convert them in bulk by calling LoadFromString followed by SaveToString(XML) as part of the upgrade to the new version. Otherwise, you will have to add a reference to mindfusion.diagamming.dll to the WPF version of the application, and do the conversion during each load operation.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
darrenwwwa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: May 12th, 2009
Re: Upgrade diagrams saved in base16/64?
Reply #2 - May 25th, 2009 at 10:58am
Print Post  
Hello Stoyo,

I tried the LoadFromString. That did not work and gave a strange error.

What do you mean by ‘You will have to transfer the old strings through the XML format’? The old version saves in Base-64. The LoadFromString expects an XML string I assume.

In our previous version we are currently using: flowchartX Professional 4.1

In the flowchartx version, the save options are:
* SaveToFile
* SaveToString – returns a base-64
* SaveToMetaFile – returns some sort of EMF type

In our new version, we are using: WPFDiagram v 2.1.1

When I load the string from the old database and try  ‘diagram.LoadFromString(myString)’ I get this funny error:
“The magic number in the header of gzip is incorrect. Make sure you indicate a GZIP stream.”

Is it possible to convert the base-64 string to XML and then LoadFromString?
  
Back to top
 
IP Logged
 
darrenwwwa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: May 12th, 2009
Re: Upgrade diagrams saved in base16/64?
Reply #3 - May 25th, 2009 at 11:11am
Print Post  
I tried to add the DLL from FlowChartPro to my project. It will not let me and responds with:

'... could not be added. Please make sure the file is accessible, and that it is a valid assembly or COM component.'

Is this a valid assemply? Is it compatible with WPF/.NET 3.5? Your site says it can be used with c#.

hmmm.......
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Upgrade diagrams saved in base16/64?
Reply #4 - May 25th, 2009 at 11:46am
Print Post  
You mean you have been using the ActiveX version until now? You can't add a reference to flowchartpro.dll directly to a WPF project. Try adding it to the toolbox first and dropping a Flowchart on a WinForms form; this will create a .NET wrapper for the COM objects in FlowchartX, and then you should be able to use its methods. I don't think ActiveX controls can be used in WPF projects at all, you'll probably need to create the migration tool as a WinForms application or user control.

SaveToString in FlowChartX cannot create XML strings; use the SaveToXml method to get the diagram XML.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
darrenwwwa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: May 12th, 2009
Re: Upgrade diagrams saved in base16/64?
Reply #5 - May 25th, 2009 at 3:05pm
Print Post  
Quote:
SaveToString in FlowChartX cannot create XML strings; use the SaveToXml method to get the diagram XML.


I tried to create an xml string of the FlowChartX diagram. We discovered there was no FlowChart.SaveToXml method. We did find there was an XML writer.
I imported the xml file into my WPF document and tried to LoadFromXML:

diagram.LoadFromXml("C:\\xmlFile.txt");

I got the error: 'Not ported to wpf'

I guess our version of the FlowChartx is older fairly old.

We can get the XML as you can see. Any way to convert it/load it into our WPFDiagram?

Below is part of the xml, just in case you find it useful.

Code
Select All
<?xml version="1.0" standalone="yes"?>
<!--FlowChartX diagram-->
<Diagram Version="11"><Brushes Count="18"><Brush Id="0" Type="Solid"><Color>#FF8080FF</Color></Brush><Brush Id="1" Type="Solid"><Color>#FFB4A0A0</Color></Brush><Brush Id="2" Type="Solid"><Color>#FF00DC32</Color></Brush><Brush Id="3" Type="Solid"><Color>#FFDCDCFF</Color></Brush><Brush Id="4" Type="Solid"><Color>#FFDCDCFF</Color></Brush><Brush Id="5" Type="Solid"><Color>#FFDCDCFF</Color></Brush><Brush Id="6" Type="Solid"><Color>#FFDCDCFF</Color></Brush><Brush Id="7" Type="Solid"><Color>#FFDCDCFF</Color></Brush><Brush Id="8" Type="Solid"><Color>#FFDCDCFF</Color></Brush><Brush Id="9" Type="Solid"><Color>#FFDCDCFF</Color></Brush><Brush Id="10" Type="Solid"><Color>#FFDCDCFF</Color></Brush><Brush Id="11" Type="Solid"><Color>#FF00DC32</Color></Brush><Brush Id="12" Type="Solid"><Color>#FF00DC32</Color></Brush><Brush Id="13" Type="Solid"><Color>#FF00DC32</Color></Brush><Brush Id="14" Type="Solid"><Color>#FF00DC32</Color></Brush><Brush Id="15" Type="Solid"><Color>#FF00DC32</Color></Brush><Brush Id="16" Type="Solid"><Color>#FF00DC32</Color></Brush><Brush Id="17" Type="Solid"><Color>#FF00DC32</Color></Brush></Brushes><AnchorPatterns Count="4"><AnchorPattern Id="0"><Id>Decision1In3Out</Id><Points Count="4"><AnchorPoint><AllowIncoming>True</AllowIncoming><AllowOutgoing>False</AllowOutgoing><Color>#FF0000FF</Color><Column>-1</Column><MarkStyle>3</MarkStyle><X>50</X><Y>0</Y><ChangeArrowStyle>False</ChangeArrowStyle><ArrowStyle>1</ArrowStyle><SegmentCount>1</SegmentCount></AnchorPoint><AnchorPoint><AllowIncoming>False</AllowIncoming><AllowOutgoing>True</AllowOutgoing><Color>#FFFF0000</Color><Column>-1</Column><MarkStyle>4</MarkStyle><X>100</X><Y>50</Y><ChangeArrowStyle>False</ChangeArrowStyle><ArrowStyle>1</ArrowStyle><SegmentCount>1</SegmentCount></AnchorPoint><AnchorPoint><AllowIncoming>False</AllowIncoming><AllowOutgoing>True</AllowOutgoing><Color>#FF00FF00</Color><Column>-1</Column><MarkStyle>4</MarkStyle><X>50</X><Y>100</Y><ChangeArrowStyle>False</ChangeArrowStyle><ArrowStyle>1</ArrowStyle><SegmentCount>1</SegmentCount></AnchorPoint><AnchorPoint><AllowIncoming>False</AllowIncoming><AllowOutgoing>True</AllowOutgoing><Color>#FFFF0000</Color><Column>-1</Column><MarkStyle>4</MarkStyle><X>0</X><Y>50</Y><ChangeArrowStyle>False</ChangeArrowStyle><ArrowStyle>1</ArrowStyle><SegmentCount>1</SegmentCount></AnchorPoint></Points></AnchorPattern><AnchorPattern Id="1"><Id>Decision2In2Out</Id><Points  .........
 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Upgrade diagrams saved in base16/64?
Reply #6 - May 25th, 2009 at 4:28pm
Print Post  
SaveToXml was added in FlowChartX version 4.1.5, and the old format used by XmlWriter is not supported in WPF. Contact us by email and we'll send you a free upgrade to the latest FlowchartX release if it's just to migrate your data.

Stoyan
  
Back to top
 
IP Logged
 
darrenwwwa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: May 12th, 2009
Re: Upgrade diagrams saved in base16/64?
Reply #7 - May 29th, 2009 at 7:56am
Print Post  
Good morning Stoyo,
Thank you for helping with the upgrade of FlowChartx 4.1 to 4.5. We were able export to the new XML format.

However, when we try to load these xml files, I get the error "The object reference not set to an instance of an object."
This is strange because it is so simple 1 or 2 lines of code and the diagram object is not null. 

I tried this 2 ways. Load from String and Load from XML. Both give the same error:

StreamReader reader = File.OpenText("C:\\eurail_pass.xml");
string xmlstuff = reader.ReadToEnd();
diagram.LoadFromString(xmlstuff);
           diagram.LoadFromXml("C:\\eurail_pass.xml");

The object 'diagram' is a 'MindFusion.Diagrammgin.Wpf.Diagram'.
With this object I can load diagrams created by our new program.

Here is a clip of the XML file:

Code
Select All
<Diagram Version="12">
&#8722;
<Nodes>
&#8722;
<Node Class="std:ShapeNode" Id="0" Version="1">
<Bounds>8.000000, 120.000000, 188.000000, 107.000000</Bounds>
<ZIndex>0</ZIndex>
<ToolTip>|eurail_pass_526</ToolTip>
<Locked>False</Locked>
<Visible>True</Visible>
<Printable>True</Printable>
<Selected>False</Selected>
<Brush Id="0"/>
&#8722;
<Pen>
<Color>#FF000000</Color>
<DashStyle>0</DashStyle>
<Width>1.000000</Width>
</Pen>
<ShadowOffsetX>3.000000</ShadowOffsetX>
<ShadowOffsetY>3.000000</ShadowOffsetY>
<Weight>1.000000</Weight>
<IgnoreLayout>False</IgnoreLayout>
<HyperLink/>
&#8722;
<Constraints>
&#8722;
<Constraint Type="0">
<Value>0</Value>
</Constraint>
&#8722;
<Constraint Type="1">
<Value>0.000000</Value>
</Constraint>
&#8722;
<Constraint Type="2">
<Value>0.000000</Value>
</Constraint>
&#8722;
<Constraint Type="3">
<Value>0.000000</Value>
</Constraint>
&#8722;
<Constraint Type="4">
<Value>0.000000</Value>
</Constraint>
</Constraints>
<Obstacle>True</Obstacle>
<AllowIncomingLinks>True</AllowIncomingLinks>
<AllowOutgoingLinks>True</AllowOutgoingLinks>
<EnabledHandles>-1</EnabledHandles>
<HandlesStyle>1</HandlesStyle>
<Expanded>True</Expanded>
<Expandable>False</Expandable>
<XStyle>2</XStyle>
&#8722;
<Text>
ID:524
A: I want to buy a Eurail Pass
R: Eurail offers 4 different types of passes. The Global Pass, the Regional Pass, the National Pass and the Select Pass. Which Pass would you like to purchase?
</Text>
<TextColor>#FF000000</TextColor>
<PolygonalTextLayout>False</PolygonalTextLayout>
&#8722;
<TextFormat XValue="16">
<Alignment>0</Alignment>
<LineAlignment>0</LineAlignment>
</TextFormat> 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Upgrade diagrams saved in base16/64?
Reply #8 - May 29th, 2009 at 8:40am
Print Post  
Hi,

Could you email us the xml file?

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Upgrade diagrams saved in base16/64?
Reply #9 - May 29th, 2009 at 9:43am
Print Post  
The WPF version expects to load information about a lanes-grid that was never implemented in the ActiveX one. We'll add some code to skip that and send you the updated wpf dll.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Upgrade diagrams saved in base16/64?
Reply #10 - May 29th, 2009 at 12:44pm
Print Post  
  
Back to top
 
IP Logged
 
darrenwwwa
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: May 12th, 2009
Re: Upgrade diagrams saved in base16/64?
Reply #11 - May 29th, 2009 at 2:59pm
Print Post  
It worked! Great! Thanks for your extensive help on this. We appreciate it.

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint