Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Export to Word as part of a script
Topic Summary: Export module to Word after view is created.
Created On: 16-Sep-2008 22:07
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 16-Sep-2008 22:07
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

I want to create a view of a module by filtering the objects and retaining specific columns and export that view to Word - all in a single dxl script.
I succeeded in creating the view. For exporting the view to Word, I use the following function as a part of my script:

void exportDoc(DBE expWordDBE) {
#include <\\standard\\export\\office\\word.dxl>
print "Current view is exported to Word \n"
}
set(expWordDBE,exportDoc) // expWordDBE is a button on the GUI.

I am getting a host of errors such as :

-E- DXL: <utils/attrutil.inc:122> non local variable access (returnShortDateFormat)

.... too many messages -- suspending error reporting-I- DXL: all done with 912 errors and 0 warnings

Obviously there is a conflict with the declared variables in the include files associated with Export to Word file.
If the file is used in isolation - that means just one line of code in the dxl window e.g:

#include <\\standard\\export\\office\\word.dxl>

- it works. But I want to initiate its action by a button on the GUI.

How can I do it?

- Krishna
Report this to a Moderator Report this to a Moderator
 16-Sep-2008 22:59
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

DXL does not follow the normal and intuitive rules for function nesting. The only outside variables a sub-function may access are those defined in the main program, then cannot access variables defined within a function, even when the sub-function is defined inside the function. The attached demonstrates the error; it doesn't complain about using global variable 'i' inside sub-function f2, but it does complain about using function f1's declared variable j.

Thus, as far as I know, I've never used a nested sub-function but I digress.

The #include file you are using obviously has some global variables defined which its functions use. By putting the #include inside your exportDoc() function, the nested functions are now accessing variables that are no longer defined in the main program, thus you are getting the errors.

Don't know what to do about it, but you could probably figure out how to specify word.dxl to run as an eval_ string, but you may need to insert some clever code at the top to insure its using the correct 'current Module'.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.