S
shailendrasingh823
Hi I am trying to make a application which should generate a automatic
shapes according to available external data. I a passing a drawing
control with the file name in Generate drawing function & then taking
the application & adding vst file.
internal static void
GenerateDrawing(AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
drawingcontrol,
string fileName)
{
// Open a document.
//Visio.Document newDocument =
setUpDocument(visioApplication);
/////////////Open A Templete of stensils////////////
Visio.Document newDocument = null;
// newDocument = setUpDocument();
newDocument = setUpDocument(drawingcontrol);
//Visio.Application Visioapplication =
drawingcontrol.Window.Application;
//newDocument =
Visioapplication.Documents.OpenEx(Application.StartupPath + "\\" +
_VisioTemplateName,
// (short)Visio.VisOpenSaveArgs.visOpenCopy);
if (newDocument != null)
{
// Link the database information to the document's
// DataRecordset collection.
if ((readData(newDocument, fileName)) &&
(columnsExist(newDocument)))
{
// Create the Visio drawing.& before that empty
hashtable exists data
_ItemShapeIndexMap.Clear();
buildVisioDrawing(newDocument);
}
}
}
private static Visio.Document
setUpDocument(AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
drawingcontrol)
{
Visio.Document newDocument = null;
try
{
// Open Visio.
// Visio.Application visioApplication = new
Visio.Application();
//string applicationName = visioApplication.Name;
// Open a new document based on the template.
Visio.Application visioApplication =
drawingcontrol.Window.Application;
newDocument = visioApplication.Documents.OpenEx(
Application.StartupPath + "\\" +
_VisioTemplateName,
(short)Visio.VisOpenSaveArgs.visOpenCopy);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return newDocument;
}
Every where it's giving me correct values but finnaly nothing coming
in Drawing control.
Thanks
Shail
shapes according to available external data. I a passing a drawing
control with the file name in Generate drawing function & then taking
the application & adding vst file.
internal static void
GenerateDrawing(AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
drawingcontrol,
string fileName)
{
// Open a document.
//Visio.Document newDocument =
setUpDocument(visioApplication);
/////////////Open A Templete of stensils////////////
Visio.Document newDocument = null;
// newDocument = setUpDocument();
newDocument = setUpDocument(drawingcontrol);
//Visio.Application Visioapplication =
drawingcontrol.Window.Application;
//newDocument =
Visioapplication.Documents.OpenEx(Application.StartupPath + "\\" +
_VisioTemplateName,
// (short)Visio.VisOpenSaveArgs.visOpenCopy);
if (newDocument != null)
{
// Link the database information to the document's
// DataRecordset collection.
if ((readData(newDocument, fileName)) &&
(columnsExist(newDocument)))
{
// Create the Visio drawing.& before that empty
hashtable exists data
_ItemShapeIndexMap.Clear();
buildVisioDrawing(newDocument);
}
}
}
private static Visio.Document
setUpDocument(AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl
drawingcontrol)
{
Visio.Document newDocument = null;
try
{
// Open Visio.
// Visio.Application visioApplication = new
Visio.Application();
//string applicationName = visioApplication.Name;
// Open a new document based on the template.
Visio.Application visioApplication =
drawingcontrol.Window.Application;
newDocument = visioApplication.Documents.OpenEx(
Application.StartupPath + "\\" +
_VisioTemplateName,
(short)Visio.VisOpenSaveArgs.visOpenCopy);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return newDocument;
}
Every where it's giving me correct values but finnaly nothing coming
in Drawing control.
Thanks
Shail