Hello I'm new to the whole .net framework. I need to create reports from labwindows and found your library very usefull. In labwindows there is the option to create a .net controller which takes your dll file and creates an instrument driver. This driver contains a huge amount of functions like AODL_Document_Content_Text_SimpleText__Create. Problem is I don't know which functions I need to use to create a paragraph with simple text for instance... I had a look at the code snippets but it seems my .net controller has a really different behavior. It takes really a lot of code to do something simple.
It might sound all very strange but maybe a code snippet might explain my issue. int error = 0; AODL_Document_TextDocuments_TextDocument dochandle; AODL_Document_IDocument idochandle; char str[10]="check.odt"; CDotNetHandle cnethandle=0; AODL_Document_Content_Text_SimpleText texthandle; AODL_Document_Content_Text_Paragraph parhandle; AODL_Document_Content_Text_ParagraphCollection parcolhandle; int ret;
It's a lot of code to just create the document. I was not able to create a paragraph with some simple text...
Could someone help me on my way?
Thanks
Greets,
GErrit
The administrator has disabled public write access.
Re:.net in labwindows
Date: 2007/01/26 22:45
By: Lars B
Status: Admin
Karma: 1  
Admin
Posts: 33
Hi Gerrit,
sorry but I've never used LabWindows/CVI. But it seems that it build a wrapper for the added AODL .net assemblie. Also it looks like that LabWindows/CVI could'nt manage namespaces and so the wrapper put all prefixes, the classname and the method together to a unique name.
e.g. AODL_Document_TextDocuments_TextDocument_SaveTo (dochandle,str, cnethandle); seems to be namespace: AODL.Document.TextDocuments class: TextDocument method: SaveTo
so I guess you should split all these unique names into their complement .net parts and then use the compiled help file to find out more.
Regards Lars
The administrator has disabled public write access.
Re:.net in labwindows
Date: 2007/01/26 23:26
By: Gerrit Van Damme
Status: User
Karma: 0  
Senior Boarder
Posts: 12
Thanks Lars for your very fast response.
Indeed labwindows seems to have some trouble with the namespaces. But OK now I now the .net wrapper is OK.
Now I'm still not able to create a simple paragraph. AODL_Document_Content_Text_Paragraph_Set_Document (parhandle, (AODL_Document_IDocument)dochandle, 0); This is the function to assign a created paragraph to a document right?
And this functions needs an IDocument as argument.Can I cast a Textdocument for this argument like in the code above or is this not allowed?
regards,
Gerrit
The administrator has disabled public write access.
Re:.net in labwindows
Date: 2007/01/26 23:40
By: Lars B
Status: Admin
Karma: 1  
Admin
Posts: 33
Hi Gerrit,
the IDocument interface must be implemented resp. supported by every document inside AODL and so you can pass a document object as value where ever a IDocument interface is required.
For adding a paragraph to the document contents take a look at the following code snippet. It demonstrate how to do this in C#.
// Use the static CreateStandardTextParagraph method // of the ParagraphBuilder class to create a new paragaph Paragraph paragraph = ParagraphBuilder.CreateStandardTextParagraph(document); //Add some formated text FormatedText formText = new FormatedText(document, "T1", "Some formated text!"); formText.TextStyle.TextProperties.Bold = "bold"; paragraph.TextContent.Add(formText); //Add the paragraph to the document document.Content.Add(paragraph);
Sorry once more, but I couldn't translate this into LabWindows code
Regards Lars
The administrator has disabled public write access.
Re:.net in labwindows
Date: 2007/01/27 00:01
By: Gerrit Van Damme
Status: User
Karma: 0  
Senior Boarder
Posts: 12
Hi Lars,
Yes I had a look at those code examples. I also got the AODLTest resources from CVS which are also very nice as example code.
Now do you think that: document.Content.Add(paragraph); could be this in CVI AODL_Document_TextDocuments_TextDocument_Set_Content (dochandle,(AODL_Document_Content_IContentCollection)parhandle,0);
I think I created a paragraph but I'm not able to add it.
But this code doesn't execute because I can't cast a paragraph to a IContentCollection (it seems)
greets,
Gerrit
The administrator has disabled public write access.
Re:.net in labwindows
Date: 2007/01/27 00:17
By: Lars B
Status: Admin
Karma: 1  
Admin
Posts: 33
Hi Gerrit,
while looking at your code line, I guess it's the set property method to set the IContentCollection of the document. It's definitely not the method to add a paragraph. This must be an Add method. Does there exists a method that looks like the following