المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Using Visio 2007



C# Programming
04-03-2009, 07:12 PM
Helo,

I need to create a dynamical organization chart using visio from C# code.

Currently im using the following code only to test nothing special.


if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
axViewer1.SRC = openFileDialog1.FileName;
Microsoft.Office.Interop.Visio.Application app = new Microsoft.Office.Interop.Visio.Application();
Microsoft.Office.Interop.Visio.Page currentpage = app.Documents.Open(openFileDialog1.FileName).Pages[1];
Microsoft.Office.Interop.Visio.Document stencil = app.Documents.OpenEx("Basic_U.vss", (short)Microsoft.Office.Interop.Visio.VisOpenSaveArgs.visOpenDocked);
//Microsoft.Office.Interop.Visio.Window stencilwindow = currentpage.Document.OpenStencilWindow();
//app.SaveWorkspaceAs(@"C:\Users\Chris\Desktop\tezt.vsd");

Microsoft.Office.Interop.Visio.Shape shape2 = currentpage.Drop(stencil.Masters["Square"], 10, 7.50);

// create a dynamic connector from the stencil master collection
Microsoft.Office.Interop.Visio.Shape connector = currentpage.Drop(stencil.Masters["Dynamic connector"], 4.50, 4.50);


}


now the problem is here. On my computer the application is working fine because i have Visio 2007 installed and shapes are added etc.. but when the application is going to be used by the clients and they dont have visio installed the whole applicaiton wont work. Is there a way which i can create the charts dynamicaly at runtime without visio being installed??