We currently have a manual process for generating documents for our customers. We have developed a VBAScript to import three different files, merge them together and generate the documentation we need. These three files are: the contents of the Module in book form, a table view of requirements tracing, and a table of the changes since last we created the document. |
Re: Automating my MS Word Export... c:\<DOORS Install Path>\lib\dxl\standard\export\office\word.dxl |
Re: Automating my MS Word Export... kbmurphy - Thu Oct 15 13:06:50 EDT 2009 |
Re: Automating my MS Word Export... jpoindex - Tue Feb 22 10:14:21 EST 2011 Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Automating my MS Word Export... Mathias Mamsch - Tue Feb 22 10:50:10 EST 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Automating my MS Word Export... jpoindex - Thu Feb 24 15:56:15 EST 2011
Create a file "export_batch.dxl". Put the following content in it:
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB theDiag = null
// Now override block and show, to only do realize
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
if (null current Module) {
print "You need to have a current Module set for the export."
halt
}
// we need braces, since -D will be executed at top level and we will get name
// clashes for variable defined in word.dxl and the other includes of it.
{
// now include the word.dxl -> this will pop up the dialog, but not halt execution
// due to the overrides above
#include <standard/export/office/word.dxl>
// here we can change the dialog options. See itfui2.inc and word.dxl for all
// the options
set(exportHeadingsToggle, false) // turn off export of headings
// now manually launch the export button callback
doExport theDiag
// get rid of the dialog
if (!null theDiag) destroy theDiag
// close DOORS
exit_
}
@echo off
if "%~1"=="" (
echo You need to start this script with a DOORS Module
goto :real_end
)
c:\programme\telelogic\DOORS_8.2\bin\doors.exe -f "%TEMP%" -D "current = read(\"%~1\", true); #include <export_batch.dxl>" -u Administrator
:real_end
export.bat "/Test/My Module33"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Automating my MS Word Export... I´ve got a probleme and i don´t know how to solve it: Is it possible to have this script with the differnce, that you can do the export for a project and not only for a single module? Thanks, Clemens |
Re: Automating my MS Word Export... WorkingStudent - Thu Mar 24 11:19:04 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Automating my MS Word Export... Mathias Mamsch - Fri Mar 25 05:46:05 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Your automation word script is what I have been looking for last couple days. I want to export multiple selected module from the GUI. Here what I have done.... My script showing all the modules from the current folder and displaying it on a GUI which has export button. I have the option to select multiple modules from the GUI and allows me to export by pressing the export button. My script calls your scripts to export multiple modules. Works partially! There are two issues I am encountering: 1. It exports the view to Book format. But I want to export it to Table format. How to change it in your script so that I can export all module to Table format ONLY. 2. Word export GUI pops up before my GUI shows up. I have to close the word export GUI and then select multiple modules from my GUI. How I can stop showing word export GUI. I made minor changes to your script: a) I have moved the following lines from your script to the top of my script DB theDiag = null #include <standard/export/office/word.dxl> ........ ......... .......... here is the function: void exptMod(DB box) { int pos bool closeIt int total=0 string attName int cnt=0 int counter=0 for pos in modListDBE do { cnt++ } progressStart( copyDB, "Module Export in Progress...", "Something",cnt) for pos in modListDBE do { string modName = getColumnValue(modListDBE, pos, 2) "/" getColumnValue(modListDBE, pos, 0) string mName=getColumnValue(modListDBE, pos, 0) if (open(module(modName))) { closeIt = false } else { closeIt = true } progressMessage("Exporting module " mName "...........") destMod= read(modName, true, true) if(null(destMod)) { storeMsg("Unable to open the module "modName) continue } else { destMod = read(modName, false) load view "CSU VCRM View" progressStep(counter++) if (closeIt) { close(destMod) } // override some default message box functions, so they will only print the data but // not pause execution. Write to a log file here! bool confirm (string s) { print "Confirmed: " s "\n"; return true } void ack (string s) {print "Acknowledge: " s "\n" } void acknowledge (string s) {print "Acknowledge: " s "\n" } void infobox (string s) {print "Info: " s "\n" } void info (string s) {print "Info: " s "\n" } // Now override block and show, to only do realize void show (DB x) { realize x; theDiag = x } void block (DB x) { realize x; theDiag = x } if (null current Module) { print "You need to have a current Module set for the export." halt } // we need braces, since -D will be executed at top level and we will get name // clashes for variable defined in word.dxl and the other includes of it. // now include the word.dxl -> this will pop up the dialog, but not halt execution // due to the overrides above // here we can change the dialog options. See itfui2.inc and word.dxl for all // the options set(exportHeadingsToggle, false) // turn off export of headings // now manually launch the export button callback doExport theDiag // get rid of the dialog if (!null theDiag) destroy theDiag // close DOORS // exit_ } } progressStop // displayMessages } // copyAttsCB |
Re: Automating my MS Word Export... faisal.zahidi@boeing.com - Wed Oct 05 19:10:48 EDT 2011 Anyway, you cannot do it like that. The gist of my post was that the redirection of the show and block functions must occur before the include. You are getting an exporter box you need to click on, because the redefinition of show is done after the include. As you probably noticed, you cannot just move the include down to the redefinition without getting errors. This is because global variables in that include file will not be global anymore if you put the include in a function. Therefore you cannot have a function around your export code. So refactor your code, that the call of the exporter dialog will happen on main level again, i.e. whereever you call your exptMod function, move the code and the include statement there. Return all necessary variables for that code by references in the expmod function (or any other functions around this). If this code gets to ugly you need to strip all globals from the exporter code, put them in a separate include and include this at the top. Then you can happily move the include down below the redirection and everything shall work fine. Hope that helps, regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Automating my MS Word Export... Mathias Mamsch - Fri Oct 07 00:58:52 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Hmm...Interesting. Now it is clear why it was showing the Word export GUI. Thank However, it was not clear what you mean by "wherever you call your exptMod function,move the code and the include statement there"...Where??? exptMod function is called by the export button in my GUI function. please explain... Here is a pseudo code. can you give me a hint how you would have rearrange the code.... DB theDiag = null #include <standard/export/office/word.dxl> void exptMod(DB BD) { for selectedMod in the listbox do { void show (DB x) { realize x; theDiag = x } void block (DB x) { realize x; theDiag = x } if (null destMod) { print "You need to have a current Module set for the export." halt } set(exportHeadingsToggle, false) doExport theDiag if (!null theDiag) destroy theDiag } } void myGUI() { ....... ....... ....... okBtnDBE = ok(copyDB, "Export", exptMod) } myGUI() |
Re: Automating my MS Word Export... faisal.zahidi@boeing.com - Tue Oct 11 18:25:19 EDT 2011
The idea was to get rid of the function, so you will have no global variable problem. The include must not be placed inside a function. Since this is not possible in your case I suggest an eval_ approach:
string expCode = "
DB theDiag = null
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
#include <standard/export/office/word.dxl>
set(exportHeadingsToggle, false)
doExport theDiag
if (!null theDiag) destroy theDiag
"
string exportCode (string sFullName) {
string sExportCode = "
Module mod = read(\"" sFullName "\", true)
current = mod
" expCode "
close mod
"
return sExportCode
}
void exptMod(DB BD)
{
for selectedMod in the listbox do
{
eval_ exportCode selectedMod
}
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Automating my MS Word Export... Mathias Mamsch - Tue Oct 11 18:49:21 EDT 2011
The idea was to get rid of the function, so you will have no global variable problem. The include must not be placed inside a function. Since this is not possible in your case I suggest an eval_ approach:
string expCode = "
DB theDiag = null
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
#include <standard/export/office/word.dxl>
set(exportHeadingsToggle, false)
doExport theDiag
if (!null theDiag) destroy theDiag
"
string exportCode (string sFullName) {
string sExportCode = "
Module mod = read(\"" sFullName "\", true)
current = mod
" expCode "
close mod
"
return sExportCode
}
void exptMod(DB BD)
{
for selectedMod in the listbox do
{
eval_ exportCode selectedMod
}
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
WORKS!!!. The dxl is looping thru and exporting all modules. Thanks a lot!!!. Last question, the default word export dxl exports the module in book format. But I want the default export be in table format. How to force dxl to export it to table format???? Is there any documentation in dxl help where I can get all word export functions so that I can manipulate each function such as layout, OLE and page orientation etc. FZ |
Re: Automating my MS Word Export... faisal.zahidi@boeing.com - Wed Oct 12 16:06:06 EDT 2011
You need to look at the library files of DOORS (they are not encrypted!). In itfutil.inc I find:
...
const int layoutTypeBook = 0
const int layoutTypeTable = 1
const int layoutTypeMax = 2
const int layoutTypeDefault = layoutTypeBook
const string layoutNameBook = "Book"
const string layoutNameTable = "Table"
const string layoutNamesBookOnly[] = {layoutNameBook}
const string layoutNamesAll[] = {layoutNameBook, layoutNameTable}
...
...
void makeExporterUI(string dbTitle, int helpId, bool includeFilename, bool bookOnly, string extension, description) {
Module m = current
int widgetCount = 0
exportBox = create(m,dbTitle, styleFixed_ | styleCentered_)
...
if (bookOnly) {
exportLayoutChoice = choice(exportBox,layoutLabel, layoutNamesBookOnly, layoutTypeDefault)
} else {
exportLayoutChoice = choice(exportBox,layoutLabel, layoutNamesAll, layoutTypeDefault)
}
...
string expCode = "
DB theDiag = null
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
#include <standard/export/office/word.dxl>
set(exportHeadingsToggle, false)
set(exportLayoutChoice, layoutTypeBook) // <<- add this line
doExport theDiag
if (!null theDiag) destroy theDiag
"
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Automating my MS Word Export... Do you know how I can set a view so that all the modules will use the user defined view, not the standard view. I tried to load the view after the module is opened, but the dxl didnot like it. string sExportCode = " Module destMod= read(\"" sFullName "\", true) load view ("myview") And I also want to apply user defined template, not the normal.dot. How to change code and make it happend. My impression was that the set function will allow me to change the template set(exportHeadingsToggle, false) set(exportLayoutChoice, layoutTypeBook) set(autoformatToggle,false) set templateName ="c:\temp\mytemplate.dot" //here is the problem.. |
Re: Automating my MS Word Export... faisal.zahidi@boeing.com - Wed Mar 07 14:01:52 EST 2012
A new thread would have been better suited for this question. And if you post the same question twice and additionally mail it you will normally decrease the chance of getting an answer, not increase it! set(advancedNormalTemplateToggle, false) set(advancedTemplateLabel, "c:/path/to/my/template.dot")
string sExportCode = " Module destMod= read(\"" sFullName "\", true) current = destMod load view (\"myview\") "
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Automating my MS Word Export... Mathias Mamsch - Fri Mar 09 12:05:59 EST 2012
A new thread would have been better suited for this question. And if you post the same question twice and additionally mail it you will normally decrease the chance of getting an answer, not increase it! set(advancedNormalTemplateToggle, false) set(advancedTemplateLabel, "c:/path/to/my/template.dot")
string sExportCode = " Module destMod= read(\"" sFullName "\", true) current = destMod load view (\"myview\") "
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Thanks for your suggestion what is the best way to post new threads and the feedback for the code. I encoutered a problem, ..... set(exportHeadingsToggle, false) set(exportLayoutChoice, layoutTypeBook) set(autoformatToggle,false) set(advancedNormalTemplateToggle, false) set(advancedTemplateLabel,"c:/temp/template.dot") if I use the "c:/..." like the above code. I get an error message: -E- DXL: <Line:49> incorrectly concatenated tokens -E- DXL: <Line:49> undeclared variable (c) -E- DXL: <Line:49> syntax error -I- DXL: All done. Errors reported: 3. Warnings reported: 0. set(advancedNormalTemplateToggle, false) set(advancedTemplateLabel,c:/temp/template.dot) If I don't use the "", Only the path c:/temp/template.dot, the GUI pops up and allows me to select modules then crushes. I get the following error message: -E- DXL: <Line:16> syntax error -E- DXL: <Line:16> undeclared variable (c) -E- DXL: <Line:16> syntax error -E- DXL: <Line:16> undeclared variable (c) Any suggestion! thanks fz |
Re: Automating my MS Word Export... faisal.zahidi@boeing.com - Fri Mar 09 15:06:44 EST 2012 Read my comment again. You need to be careful with the " in the code. If you embed the code into a string, you need to escape the " characters. The reason that you got this message is that you tried to embed the code in a string and again forgot to escape the template string. Therefore he tried to do "..." c :/ ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Automating my MS Word Export... Mathias Mamsch - Sat Mar 10 08:08:09 EST 2012 Read my comment again. You need to be careful with the " in the code. If you embed the code into a string, you need to escape the " characters. The reason that you got this message is that you tried to embed the code in a string and again forgot to escape the template string. Therefore he tried to do "..." c :/ ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Now I got really confused!!! When you say escape the " character. what you mean by that?? If I don't use the " in the c:/temp/template.dot, the dxl allows me to launch the form. the next step is to select the modules from GUI and run. As soon as I do that again I get the same error message. -E- DXL: <Line:16> incorrect arguments for function (set) -E- DXL: <Line:18> syntax error -E- DXL: <Line:18> undeclared variable (c) Here is the code. can you show me what you are trying to say... string expCode = " DB theDiag = null void show (DB x) { realize x; theDiag = x } void block (DB x) { realize x; theDiag = x } #include <standard/export/office/word.dxl> set(exportHeadingsToggle, false) set(exportLayoutChoice, layoutTypeBook) set(autoformatToggle,false) set(useNormalTemplate,false) set(advancedNormalTemplateToggle, false) set(advancedTemplateLabel,c:/temp/template.dot) doExport theDiag if (!null theDiag) destroy theDiag " ........................... ......................... Thanks, Appreciate it!! FZ |
Re: Automating my MS Word Export... faisal.zahidi@boeing.com - Mon Mar 12 11:45:41 EDT 2012
Hello FZ, string s = "<This is a string>"
<This is a string>
<This is a string having the character " in the middle>
string s ="<This is a string having the character " in the middle>"
<This is a string having the character
in the middle>
string s = "<This is a string having the character \" in the middle>"
set(advancedTemplateLabel,"\c:/temp/template.dot"\)
|
Re: Automating my MS Word Export... SystemAdmin - Mon Mar 12 13:21:36 EDT 2012
Hello FZ, string s = "<This is a string>"
<This is a string>
<This is a string having the character " in the middle>
string s ="<This is a string having the character " in the middle>"
<This is a string having the character
in the middle>
string s = "<This is a string having the character \" in the middle>"
set(advancedTemplateLabel,"\c:/temp/template.dot"\)
Run this code:
Confused? There are 3 people in the entire world who visualize this effortlessly, I'm not one of them. So I type what I want to see, then add an escape front-slash in front of the double quotes and front-slashes. When I have such strings that are not working, I try to just print the parts. -Louie |
Re: Automating my MS Word Export... llandale - Tue Mar 13 13:15:01 EDT 2012
Run this code:
Confused? There are 3 people in the entire world who visualize this effortlessly, I'm not one of them. So I type what I want to see, then add an escape front-slash in front of the double quotes and front-slashes. When I have such strings that are not working, I try to just print the parts. -Louie Oops, I stand corrected. Thanks for proof reading my mail:-) Mike |
Re: Automating my MS Word Export... SystemAdmin - Tue Mar 13 13:27:39 EDT 2012 If I use the following code: set(advancedTemplateLabel,\"c:/temp/template.dot\") I get an error message: -E- DXL: <Line:16> incorrect arguments for function (set) Am I doing something wrong???? Thanks, Faisal Zahidi |
Re: Automating my MS Word Export... faisal.zahidi@boeing.com - Tue Mar 13 14:43:09 EDT 2012
..err.. I should say you need to escape when the quotes and the slashes are inside some other string.
|
Re: Automating my MS Word Export... Mathias Mamsch - Fri Mar 09 12:05:59 EST 2012
A new thread would have been better suited for this question. And if you post the same question twice and additionally mail it you will normally decrease the chance of getting an answer, not increase it! set(advancedNormalTemplateToggle, false) set(advancedTemplateLabel, "c:/path/to/my/template.dot")
string sExportCode = " Module destMod= read(\"" sFullName "\", true) current = destMod load view (\"myview\") "
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Hello,
Skip selectedItems = getSelectedItems ()
Item I = null
for I in selectedItems do
{
if(isDeleted(I) || null I) {continue}
if (type (I) == "Formal")
{
Module m = read(fullName(I),true)
load view "Standard view"
delete column 0
{
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB theDiag = null
// Now override block and show, to only do realize
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
if (null current Module) {
print "You need to have a current Module set for the export."
halt
}
// we need braces, since -D will be executed at top level and we will get name
// clashes for variable defined in word.dxl and the other includes of it.
{
// now include the word.dxl -> this will pop up the dialog, but not halt execution
// due to the overrides above
#include <standard/export/office/word.dxl>
// here we can change the dialog options. See itfui2.inc and word.dxl for all
// the options
set(exportHeadingsToggle, false) // turn off export of headings
set(exportWarnUnregOLE,false) //turn off ole warning
// now manually launch the export button callback
doExport theDiag
// get rid of the dialog
if (!null theDiag) destroy theDiag
// close DOORS
//exit_
}
}
close(m)
}
}
delete selectedItems
|
Re: Automating my MS Word Export... SystemAdmin - Wed Aug 08 10:56:58 EDT 2012
Hello,
Skip selectedItems = getSelectedItems ()
Item I = null
for I in selectedItems do
{
if(isDeleted(I) || null I) {continue}
if (type (I) == "Formal")
{
Module m = read(fullName(I),true)
load view "Standard view"
delete column 0
{
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB theDiag = null
// Now override block and show, to only do realize
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
if (null current Module) {
print "You need to have a current Module set for the export."
halt
}
// we need braces, since -D will be executed at top level and we will get name
// clashes for variable defined in word.dxl and the other includes of it.
{
// now include the word.dxl -> this will pop up the dialog, but not halt execution
// due to the overrides above
#include <standard/export/office/word.dxl>
// here we can change the dialog options. See itfui2.inc and word.dxl for all
// the options
set(exportHeadingsToggle, false) // turn off export of headings
set(exportWarnUnregOLE,false) //turn off ole warning
// now manually launch the export button callback
doExport theDiag
// get rid of the dialog
if (!null theDiag) destroy theDiag
// close DOORS
//exit_
}
}
close(m)
}
}
delete selectedItems
Can you please post the batch how to call the script you post in the thread? It's no response when I run this in DOORS GUI. Thanks, Gary |
Re: Automating my MS Word Export... SystemAdmin - Wed Aug 08 10:56:58 EDT 2012
Hello,
Skip selectedItems = getSelectedItems ()
Item I = null
for I in selectedItems do
{
if(isDeleted(I) || null I) {continue}
if (type (I) == "Formal")
{
Module m = read(fullName(I),true)
load view "Standard view"
delete column 0
{
// override some default message box functions, so they will only print the data but
// not pause execution. Write to a log file here!
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
void info (string s) {print "Info: " s "\n" }
DB theDiag = null
// Now override block and show, to only do realize
void show (DB x) { realize x; theDiag = x }
void block (DB x) { realize x; theDiag = x }
if (null current Module) {
print "You need to have a current Module set for the export."
halt
}
// we need braces, since -D will be executed at top level and we will get name
// clashes for variable defined in word.dxl and the other includes of it.
{
// now include the word.dxl -> this will pop up the dialog, but not halt execution
// due to the overrides above
#include <standard/export/office/word.dxl>
// here we can change the dialog options. See itfui2.inc and word.dxl for all
// the options
set(exportHeadingsToggle, false) // turn off export of headings
set(exportWarnUnregOLE,false) //turn off ole warning
// now manually launch the export button callback
doExport theDiag
// get rid of the dialog
if (!null theDiag) destroy theDiag
// close DOORS
//exit_
}
}
close(m)
}
}
delete selectedItems
I can run your DXL script after selected the document items from DOORS database view. Did you have the answer already how to save the export once it is complete? If yes, it would be great if you can share with us. Many thanks, Gary |
Re: Automating my MS Word Export... SystemAdmin - Thu Mar 14 00:14:24 EDT 2013
When you automate a script like this, then since you do not want to change the script, what you normally do is hook into some perms, to get handles to the variables you want. In this case it could be something like:
...
bool confirm (string s) { print "Confirmed: " s "\n"; return true }
void ack (string s) {print "Acknowledge: " s "\n" }
void acknowledge (string s) {print "Acknowledge: " s "\n" }
void infobox (string s) {print "Info: " s "\n" }
// ...
// Hook the OleAutoObject creation function here:
OleAutoObj gObjWordApplication = null
OleAutoObj oleCreateAutoObjectOld (string s) { return oleCreateAutoObject s }
OleAutoObj oleGetAutoObjectOld (string s) { return oleCreateAutoObject s }
OleAutoObj oleCreateAutoObject (string s) {
OleAutoObj result = oleCreateAutoObjectOld s
if (s == "Word.Application") gObjWordApplication = result
return result
}
OleAutoObj oleGetAutoObject (string s) {
OleAutoObj result = oleGetAutoObjectOld s
if (s == "Word.Application") gObjWordApplication = result
return result
}
// ... the rest of the export code ...
doExport theDiag
if (!null theDiag) destroy theDiag
// Use the handle here to get a grip on the documents, save them.
// ...
// close DOORS
// exit_
// ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Automating my MS Word Export...
Hello. I have a question related to the initial post:
string exportDirectory = "\\c:\\Documents and Settings\\user\\newFolder"
setenv("EXPORTDIRECTORY", getDirOfNoSlash(exportDirectory))
|
Re: Automating my MS Word Export... SystemAdmin - Thu Apr 04 10:43:03 EDT 2013
Hello. I have a question related to the initial post:
string exportDirectory = "\\c:\\Documents and Settings\\user\\newFolder"
setenv("EXPORTDIRECTORY", getDirOfNoSlash(exportDirectory))
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Automating my MS Word Export... SystemAdmin - Thu Apr 04 10:43:03 EDT 2013
Hello. I have a question related to the initial post:
string exportDirectory = "\\c:\\Documents and Settings\\user\\newFolder"
setenv("EXPORTDIRECTORY", getDirOfNoSlash(exportDirectory))
This may surprise you:
So try just this:
-Louie |
Re: Automating my MS Word Export... llandale - Thu Apr 04 14:24:17 EDT 2013
So try just this:
-Louie Thanks everyone for posting snippets. Almost getting mine to work. Only problem is that I can't seem to set output file name for the word document. I tried this- set(exportFileName,"c:/tmp/temp.doc") and I get this error-
-R-E- DXL: <export_batch.dxl:34> null dialog element (DBE) parameter was passed into argument position 1
-I- DXL: execution halted
My guess is that the exportFileName DBE isn't getting allocated. I tried doing it, but no use. Any ideas ? |
Re: Automating my MS Word Export... dalvia - Fri Dec 27 17:17:30 EST 2013 Thanks everyone for posting snippets. Almost getting mine to work. Only problem is that I can't seem to set output file name for the word document. I tried this- set(exportFileName,"c:/tmp/temp.doc") and I get this error-
-R-E- DXL: <export_batch.dxl:34> null dialog element (DBE) parameter was passed into argument position 1
-I- DXL: execution halted
My guess is that the exportFileName DBE isn't getting allocated. I tried doing it, but no use. Any ideas ? Please post your export_batch.dxl (or the relevant parts of it)... The variable name seems to be right, however if you try manipulating it before it is allocated it seems that you try to do it in the wrong position. Make sure, that the dialog has already been created and is visible on the screen, before putting the set(...) statement. Regards, Mathias |
Re: Automating my MS Word Export... I have made some progress since. I can see the outpuit filename I want in dialog box after it is created. However the actual word file does not get saved. My export_batch.dxl script has been attached. Also had to make 1 line change in word.dxl so that the DBE for data export file name is allocated Changed this line ( line 3341 ) makeExporterUI(wordTitle, helpExportWord, false, false, null, null) to ( mde 3rd argument true ) makeExporterUI(wordTitle, helpExportWord, true, false, null, null) Now the dialog boz gets created. I can see the file name that I set ( "c:/adi.doc") on the dialog box as it gets created. However it does not trickle down to the word document. The document still opens as "Document2". Don't know what to do about it. Any ideas ? Ideally would like the word document to be saved on c:/ as "adi.doc" Attachments export_batch.dxl |
Re: Automating my MS Word Export... dalvia - Thu Jan 02 13:08:35 EST 2014 I have made some progress since. I can see the outpuit filename I want in dialog box after it is created. However the actual word file does not get saved. My export_batch.dxl script has been attached. Also had to make 1 line change in word.dxl so that the DBE for data export file name is allocated Changed this line ( line 3341 ) makeExporterUI(wordTitle, helpExportWord, false, false, null, null) to ( mde 3rd argument true ) makeExporterUI(wordTitle, helpExportWord, true, false, null, null) Now the dialog boz gets created. I can see the file name that I set ( "c:/adi.doc") on the dialog box as it gets created. However it does not trickle down to the word document. The document still opens as "Document2". Don't know what to do about it. Any ideas ? Ideally would like the word document to be saved on c:/ as "adi.doc" I just realized that you are doing Word exports ... The Word Exporter of DOORS does not save the document after export. It just exports your document to your current Word instance and then just quits. So you need to save the document yourself. For this you can use the trick mentioned above to get a grab to the Word Application handles. Use the hooks into oleCreateAutoObject and oleGetAutoObject to get a grip to the OleAutoObj handle of Word.Application then you can use the ActiveDocument or something to get a handle to the exported document and save it. Regards, Mathias |
Re: Automating my MS Word Export... Hello guys,
I am new on this forum, so first of all I want to salute you all. I need your help to make my life easier, I am trying to make an automation, using a batch file in order to obtain a proper excel export from DOORS. I followed all the instructions from here: http://www-01.ibm.com/support/docview.wss?uid=swg21567793 The thing is that I am getting errors in DXL, which from my point of view belongs to the path of the module. I entered in the export.bat the following:
@echo off
export.bat "/MLB Evo_FAS_IS_EF/MLBevo1/xxx/xxx/TLM - xxx" After execution I get the following error:
-R-W- DXL: <Line:1> null value passed to DXL command (current Module)
Help!
|
Re: Automating my MS Word Export... Ursy - Wed Apr 20 01:24:54 EDT 2016 Hello guys,
I am new on this forum, so first of all I want to salute you all. I need your help to make my life easier, I am trying to make an automation, using a batch file in order to obtain a proper excel export from DOORS. I followed all the instructions from here: http://www-01.ibm.com/support/docview.wss?uid=swg21567793 The thing is that I am getting errors in DXL, which from my point of view belongs to the path of the module. I entered in the export.bat the following:
@echo off
export.bat "/MLB Evo_FAS_IS_EF/MLBevo1/xxx/xxx/TLM - xxx" After execution I get the following error:
-R-W- DXL: <Line:1> null value passed to DXL command (current Module)
Help!
Yes your conclusion seems probable. I suggest you open yoru module and run the following DXL line to see if you have got the correct path: print fullName(current) The full module path in DOORS is from the closest parent project. Maybe that's your problem. |
Re: Automating my MS Word Export... Ursy - Wed Apr 20 01:24:54 EDT 2016 Hello guys,
I am new on this forum, so first of all I want to salute you all. I need your help to make my life easier, I am trying to make an automation, using a batch file in order to obtain a proper excel export from DOORS. I followed all the instructions from here: http://www-01.ibm.com/support/docview.wss?uid=swg21567793 The thing is that I am getting errors in DXL, which from my point of view belongs to the path of the module. I entered in the export.bat the following:
@echo off
export.bat "/MLB Evo_FAS_IS_EF/MLBevo1/xxx/xxx/TLM - xxx" After execution I get the following error:
-R-W- DXL: <Line:1> null value passed to DXL command (current Module)
Help!
Note that you are getting two things:
One reason for this can be, that you simply have a typo on your module name, or the user that runs the script has no access to the module. The other possibility is that you might have unsupported characters inside the module name. Note that the export.bat script creates the following command line parameter: -D "current = read(\"%~1\", true); #include <export_batch.dxl>" where %~1 means the first command line parameter. To find out whats going on, you can change this part of the batch file to: -D "string sMod=\"%~1\"; print sMod; current = read(sMod, true); #include <export_batch.dxl>" Normally DOORS will not allow you special ascii characters. But its possible if you got certain non-ascii characters inside the module name, that the command line will not correctly transfer them. So 1. double check the module as you pass it over the command line exists and the user can access it. 2. do the above change and post the full module name to test if there are any non ascii characters on it, that might be transferred badly over the commandline. Regards, Mathias
|
Re: Automating my MS Word Export... Mathias Mamsch - Wed Apr 20 06:36:59 EDT 2016 Note that you are getting two things:
One reason for this can be, that you simply have a typo on your module name, or the user that runs the script has no access to the module. The other possibility is that you might have unsupported characters inside the module name. Note that the export.bat script creates the following command line parameter: -D "current = read(\"%~1\", true); #include <export_batch.dxl>" where %~1 means the first command line parameter. To find out whats going on, you can change this part of the batch file to: -D "string sMod=\"%~1\"; print sMod; current = read(sMod, true); #include <export_batch.dxl>" Normally DOORS will not allow you special ascii characters. But its possible if you got certain non-ascii characters inside the module name, that the command line will not correctly transfer them. So 1. double check the module as you pass it over the command line exists and the user can access it. 2. do the above change and post the full module name to test if there are any non ascii characters on it, that might be transferred badly over the commandline. Regards, Mathias
Thank you guys for your responses! After morast wrote me, I discovered that I do not have rights to run DXLs, because the RUN and Save as buttons appear to be inactive (http://www-01.ibm.com/support/docview.wss?uid=swg21404574). I will request permission for this, and after getting it, I will try again. Thanks again! |