currentPage.DropManyLinkedU is not working with drawing control in Win forms

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
 
J

JuneTheSecond

Would you try src property to set up drawing for Drawing Control.
drawingcontrol.Src = string DrawingNameWith Path
 
S

shailendrasingh823

Would you try src property to set up drawing for Drawing Control.
drawingcontrol.Src = string DrawingNameWith Path
--
JuneTheSecond














- Show quoted text -

Thanks June It's working fine Thanks A lot.

Regards
Shail
 
S

shailendrasingh823

Thanks June It's working fine Thanks A lot.

Regards
Shail- Hide quoted text -

- Show quoted text -

Hi June,

Thanks for your help.

I want another favour from you,Currently I can use only one type of
connector only (this is Dynamic connector) to connect my shapes.I want
to use another connectors also like Logical connector,Comm-link like
that some more,But when I use other type of connector shapes couldnot
connect & got the error "Inappropriate Source object for this action"
connector has been dropped on the page but not connect with specific
shapes.
If you have any Idea then please let me know.I will be thankful to
you.

Regards
Shelendra Singh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top