OpenDocument4all - Info and tools about OpenDocument
Wednesday, 07 January 2009
Home arrow Forum
Forum Statistics
Total user: 67
Total message: 166
Main Menu
Home
My Blog
AODL - Project
AODC - Project
OO Development & Info
Forum
About OpenDocument ...
Search
News
Contact Us
Login Form





Lost Password?
No account yet? Register
Sourceforge.net

SourceForge.net - Goto the project homepage
Project site on SF.net

 

Demand OpenDocument

 

Countomat Webcounter und Webstatistik (Statistik & Logfileanalyse, Counter)

OpenDocument4all-Forum

 
<< Start < Prev 1 2 3 4 Next > End >>
.net in labwindows
Date: 2007/01/26 22:08 By: Gerrit Van Damme Status: User  
Karma: 0  
Senior Boarder

Posts: 12
graphgraph
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;



switch (event) {
case EVENT_COMMIT:
error = Initialize_AODL();
error = Initialize_ICSharpCode_SharpZipLib();

error = AODL_Document_TextDocuments_TextDocument__Create(&dochandle,cnethandle);
error = AODL_Document_TextDocuments_TextDocument_New (dochandle, 0);
error = AODL_Document_IDocument

//error = AODL_Document_IDocument_Get_, , 0);
//error = AODL_Document_Content_Text_Paragraph__Create(&parhandle,(AODL_Document_IDocument)dochandle,cnethandle);
error = AODL_Document_Content_Text_ParagraphBuilder_CreateStandardTextParagraph ((AODL_Document_IDocument)dochandle,&parhandle, cnethandle);
error = AODL_Document_Content_Text_SimpleText__Create (&texthandle,(AODL_Document_IDocument)dochandle ,"tettekes" , cnethandle);
AODL_Document_Content_Text_Paragraph__Create_2 (&parhandle,(AODL_Document_IDocument)dochandle,0 ,"prottekes" ,cnethandle);

//error = AODL_Document_Content_Text_ParagraphCollection__Create(&parcolhandle,cnethandle);
//parcolhandle=(AODL_Document_Content_Text_ParagraphCollection)parhandle;
//error = AODL_Document_Content_Text_ParagraphCollection_Add(parcolhandle,parhandle,&ret,cnethandle);

error = AODL_Document_TextDocuments_TextDocument_SaveTo (dochandle,str, cnethandle);
//error = AODL_Document_Content_Text_ParagraphCollection_Add (, , , 0);
Close_AODL();

//AODL_Document_Content_Text_Paragraph_Set_Document (, , 0);

break;
}
return 0;


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
graph
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
graphgraph
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
graph
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
graphgraph
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
graph
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

AODL_Document_TextDocuments_TextDocument_Content_Add

??

Regards
Lars
The administrator has disabled public write access.

<< Start < Prev 1 2 3 4 Next > End >>
Quick jump
Download area
Who's Online
We have 1 guest online
Polls
Should AODL and AODC also implement export as PDF and RTF?
 
Popular
© 2005 MamboZ. All rights reserved.