Page Index Toggle Pages: [1] 2 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Any VB.net sample? (Read 32944 times)
ysliew
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jul 18th, 2007
Any VB.net sample?
Jul 18th, 2007 at 2:45am
Print Post  
Hi all,

I would like to generate an org chart based on SQL tables, is there any VB.net sample? Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Any VB.net sample?
Reply #1 - Jul 18th, 2007 at 7:24am
Print Post  
Hi,

Here is a C# example:
http://mindfusion.org/cgi/Forum/YaBB.pl?board=fcnet_disc;action=display;num=1177...

Let me know if you are having troubles porting it to VB.

Stoyan
  
Back to top
 
IP Logged
 
ysliew
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jul 18th, 2007
Re: Any VB.net sample?
Reply #2 - Jul 19th, 2007 at 12:07am
Print Post  
Thanks Stoyo, but I couldn't view the org chart, here is the error in Java Console. Kindly advise, thanks.

Quote:
load: class com/mindfusion/jdiagram/FlowChartApplet.class not found.
java.lang.ClassNotFoundException: com.mindfusion.jdiagram.FlowChartApplet.class

at sun.applet.AppletClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadCode(Unknown Source)

at sun.applet.AppletPanel.createApplet(Unknown Source)

at sun.plugin.AppletViewer.createApplet(Unknown Source)

at sun.applet.AppletPanel.runLoader(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.

at sun.applet.AppletClassLoader.getBytes(Unknown Source)

at sun.applet.AppletClassLoader.access$100(Unknown Source)

at sun.applet.AppletClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

... 10 more



« Last Edit: Jul 20th, 2007 at 3:13am by ysliew »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Any VB.net sample?
Reply #3 - Jul 19th, 2007 at 6:05am
Print Post  
Have you copied the JDiagram.jar file to your project's folder?

Stoyan
  
Back to top
 
IP Logged
 
ysliew
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jul 18th, 2007
Re: Any VB.net sample?
Reply #4 - Jul 19th, 2007 at 11:39pm
Print Post  
Thanks Stoyo, it's working now.
Anyway, does the client need the java plugin to view the chart? Also, can I export to a clickable html after the chart is generated?
« Last Edit: Jul 20th, 2007 at 3:13am by ysliew »  
Back to top
 
IP Logged
 
ysliew
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jul 18th, 2007
Re: Any VB.net sample?
Reply #5 - Jul 20th, 2007 at 3:17am
Print Post  
Hi Stoyo,

I have a constructed a query to return 3 fields; ID, Description and ParentID, and there are few hundreds records returned, is there anyway to validate the data?

Besides that, can the datatype for both ID and the Parent ID in string? And how many nodes does the trial version support?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Any VB.net sample?
Reply #6 - Jul 20th, 2007 at 6:00am
Print Post  
The client needs the Java plugin only if you are using FlowChart.ClientSideMode = JavaApplet. If you don't need user interaction on the client side, set the ClientSideMode to ImageMap. That will generate a clickable html image map + image, and Java won't be required.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Any VB.net sample?
Reply #7 - Jul 20th, 2007 at 6:10am
Print Post  
Hi,

I guess the only validation needed is to check whether every node has a valid Parent ID, and there is only one node without parent - the root.

You can use any data type you'd like for IDs, just make sure you are calling the correct SqlDataReader.Get? method.

There isn't any limit on the number of nodes in the trial version. However .NET can generate image of max. size about 3k x 3k pixels, and you will get exceptions if the diagram becomes larger. So you might have to limit the displayed nodes to only some branch of the organization if you expect the full tree image to become larger than that.

Stoyan
  
Back to top
 
IP Logged
 
ysliew
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jul 18th, 2007
Re: Any VB.net sample?
Reply #8 - Jul 23rd, 2007 at 8:26am
Print Post  
Hi Stoyo,

Thanks for your reply, few more questions...

(i) Does the org chart support Chinese data? Some of our clients are from China, and I tested loading org chart with chinese data but no chart was generated.

(ii) After changing the ClientSideMode to ImageMap, i can't view the org chart.

(iii) How to disable the drawing function? Creating new box/arrow on the chart is not allowed.

(iv) Which properties should I set to control the Box size and thickness of the arrow?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Any VB.net sample?
Reply #9 - Jul 23rd, 2007 at 10:21am
Print Post  
Hi,

Quote:
(i) Does the org chart support Chinese data? Some of our clients are from China, and I tested loading org chart with chinese data but no chart was generated.


Do you mean there aren't any boxes shown at all, or only the text is missing?

Quote:
(ii) After changing the ClientSideMode to ImageMap, i can't view the org chart.


You must add ImageGen.aspx to your project.

Quote:
(iii) How to disable the drawing function? Creating new box/arrow on the chart is not allowed.


Set FlowChart.Behavior = Modify.

Quote:
(iv) Which properties should I set to control the Box size and thickness of the arrow?


Set the Pen property to one with bigger Width value.

Stoyan
  
Back to top
 
IP Logged
 
ysliew
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jul 18th, 2007
Re: Any VB.net sample?
Reply #10 - Jul 24th, 2007 at 11:49pm
Print Post  
Hi Stoyo,

Thanks for your reply.

Quote:
Do you mean there aren't any boxes shown at all, or only the text is missing?


Yes, there is nothing shown.

Quote:
You must add ImageGen.aspx to your project.


How should I code in ImageGen?

Besides, how could I arrange the nodes horizontally or vertically?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Any VB.net sample?
Reply #11 - Jul 25th, 2007 at 5:50am
Print Post  
Hi,

Could you email me a diagram with Chinese texts in it? We'll trace though our code to see why it is not transferred to the client side.

I've just discovered there isn’t ImageGen.aspx available for VB.NET projects with version 1.0 of the control. You ca get the VB.NET version here:

https://mindfusion.org/_temp/ImageGen.vb.zip

Use the Add Existing File command from the project's context menu to add the aspx file to your project.

Call the TreeLayout.Arrange or LayeredLayout.Arrange method to arrange the nodes.

Stoyan
  
Back to top
 
IP Logged
 
ysliew
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jul 18th, 2007
Re: Any VB.net sample?
Reply #12 - Jul 25th, 2007 at 11:57pm
Print Post  
Hi Stoyo,

The given aspx has some errors at the line 1.

Quote:
Original
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ImageGen.aspx.vb" Inherits="ImageMap.ImageGen" %>


Quote:
Corrected
<%@ Page Language="vb" AutoEventWireup="false" CodeFile="ImageGen.aspx.vb" Inherits="ImageGen" %>


Please get the sample chinese data from the following link.

Sample Data.txt

http://www.mediafire.com/?bmdxbsoyygr

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Any VB.net sample?
Reply #13 - Jul 27th, 2007 at 7:03am
Print Post  
Hi,

We have only set the font to MingLiU on the server side and the diagram loaded ok with that sample data -



Have you installed the far-east language support with the Java runtime? I think that option is disabled by default.

Stoyan
  
Back to top
 
IP Logged
 
ysliew
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 21
Joined: Jul 18th, 2007
Re: Any VB.net sample?
Reply #14 - Jul 27th, 2007 at 8:54am
Print Post  
Thanks Stoyo, after setting the font, I'm able to see the org chart. By the way, do I really need to install for the far-east language support with the Java runtime? Since I'm using the ImageMap instead of JavaApplet, will it cause any problem without installing?

Thanks.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint