I want to have 2 columns in a module:
1 Column: Object Heading&Text, which may contain tables as well as object headings, texts
2 Column: DXL, which shall display contents of the first column if current object hasn't out links. Otherwise, it shall displays the a column of the links.
I created such a script which have most of the functions above, but have 2 problems:
1. Can't display a table
2. Can't change Object Heading's font and font size, it can only be bolded
I have no ideas now to fix them. It'll be very appreciated if any suggestions.
Huyi.Wang - Tue Apr 10 05:43:54 EDT 2012 |
|
Re: Is there a way to display a table? llandale - Tue Apr 10 11:15:36 EDT 2012
If when you say "Table" you mean a DOORS Table, then it has no columns and you can display only one attribute in it (usually Object Text). Seems like you should adjust the properties of the table to display your Attr-DXL.
If when you say "Table" you mean an OLE diagram of perhaps an MS-Word table, then you should be able to retrieve the Object Text:
-
string TextRich = richTextWithOle(obj, "Object Text")
and when you are done set the attr DXL:
-
obj.attrDXLName = richText(Results)
Perhaps someone else can help with the font size issue.
-Louie
|
|
Re: Is there a way to display a table? Huyi.Wang - Wed Apr 11 02:01:00 EDT 2012 llandale - Tue Apr 10 11:15:36 EDT 2012
If when you say "Table" you mean a DOORS Table, then it has no columns and you can display only one attribute in it (usually Object Text). Seems like you should adjust the properties of the table to display your Attr-DXL.
If when you say "Table" you mean an OLE diagram of perhaps an MS-Word table, then you should be able to retrieve the Object Text:
-
string TextRich = richTextWithOle(obj, "Object Text")
and when you are done set the attr DXL:
-
obj.attrDXLName = richText(Results)
Perhaps someone else can help with the font size issue.
-Louie
Thanks, I might know how to display my table now.
Another question, in DOORS, when shall we have to use DOORS table? I feel in most any cases we can use word or other OLE tables.
|
|
Re: Is there a way to display a table? llandale - Wed Apr 11 13:34:16 EDT 2012 Huyi.Wang - Wed Apr 11 02:01:00 EDT 2012
Thanks, I might know how to display my table now.
Another question, in DOORS, when shall we have to use DOORS table? I feel in most any cases we can use word or other OLE tables.
There are other folks who like the native DOORS tables but some of us do not. If they contain "requirements" and you figure to "link" them with other documents, then they become hopeless.
The OLE word-table approach is pretty standard, but lacks modification traceability. These you create in Word, copy, then insert a Word Object, and paste them there. Then copy the word object and paste into DOORS.
For small tables I often use (what I call) "RTF" tables. Copy the Word table and directly paste it into DOORS (without the word-object step). You get rudametary formatting but the text is searchable and replaceable. If you need to modify the structure (more rows or wider cells), you need to copy to work, adjust, and copy back.
-Louie
|
|
Re: Is there a way to display a table? Huyi.Wang - Fri Apr 20 09:13:05 EDT 2012
1. Use RTF table
2. obj.attrDXLName = richText(Results)
|
|
Re: Is there a way to display a table? Huyi.Wang - Fri Apr 20 09:13:58 EDT 2012 llandale - Wed Apr 11 13:34:16 EDT 2012
There are other folks who like the native DOORS tables but some of us do not. If they contain "requirements" and you figure to "link" them with other documents, then they become hopeless.
The OLE word-table approach is pretty standard, but lacks modification traceability. These you create in Word, copy, then insert a Word Object, and paste them there. Then copy the word object and paste into DOORS.
For small tables I often use (what I call) "RTF" tables. Copy the Word table and directly paste it into DOORS (without the word-object step). You get rudametary formatting but the text is searchable and replaceable. If you need to modify the structure (more rows or wider cells), you need to copy to work, adjust, and copy back.
-Louie
Thanks.
|
|
Re: Is there a way to display a table? Peter_Albert - Tue Apr 24 11:34:45 EDT 2012 llandale - Wed Apr 11 13:34:16 EDT 2012
There are other folks who like the native DOORS tables but some of us do not. If they contain "requirements" and you figure to "link" them with other documents, then they become hopeless.
The OLE word-table approach is pretty standard, but lacks modification traceability. These you create in Word, copy, then insert a Word Object, and paste them there. Then copy the word object and paste into DOORS.
For small tables I often use (what I call) "RTF" tables. Copy the Word table and directly paste it into DOORS (without the word-object step). You get rudametary formatting but the text is searchable and replaceable. If you need to modify the structure (more rows or wider cells), you need to copy to work, adjust, and copy back.
-Louie
Picking up on that old post - how do you export those "RTF" tables back to Word? I tried, and in WEXP I only get the plain text exported - no table formatting.
Regards,
Peter
|
|
Re: Is there a way to display a table? SystemAdmin - Tue Apr 24 13:11:18 EDT 2012 Peter_Albert - Tue Apr 24 11:34:45 EDT 2012
Picking up on that old post - how do you export those "RTF" tables back to Word? I tried, and in WEXP I only get the plain text exported - no table formatting.
Regards,
Peter
None of the export methods are perfect.
I think the one that does the best job overall is export as HTML. In particular, it does a good job with tables and pictures. I use the Table mode as opposed to the Book mode.
After you export as HTML, you can open with Word and save as .DOC or .RTF file.
Suppose you are exporting a subset for a meeting and using landscape format. You would export from a landscape-sized DOORS view. Next you could open in Firefox and set Firefox page properties to landscape. Select shrink to fit for extra assurance. Lastly print.
VERY IMPORTANT -- Arrange the widths of columns just as you want them to appear once exported.
I have a canned "Export Portrait View" and "Export Landscape View" for this purpose. OLE objects will be converted to PNG files and the resolution of those files is based on the width of columns upon export.
You can use DXL to fine tune your column widths for an export view to save a lot of trial and error (and wasted trees).
In this example:
-
Landscape is desired
-
Paper is 8.5 x 11"
-
Left and right margins are 0.75"
-
Columns (in order) are:
-
DOORS ID
-
(main column)
-
Object Type
-
Effectivity
Everything is specified in inches and (main column) gets whatever is left over.
// NOTE 96 pixels per inch is typical.
// It may vary with output device.
void setColumnWidth() {
real widthInInches_page = 11.0;
real widthInInches_leftMargin = 0.75;
real widthInInches_rightMargin = 0.75;
real widthInInches_ID = 0.5;
real widthInInches_ObjectType = 0.8;
real widthInInches_Effectivity = 1.4;
real widthInInches_main = widthInInches_page //-
- widthInInches_leftMargin //-
- widthInInches_rightMargin //-
- widthInInches_ID //-
- widthInInches_ObjectType //-
- widthInInches_Effectivity;
int widthInPixels_ID = intOf( (96.0 * widthInInches_ID) );
print("Setting ID to " (widthInPixels_ID) " pixels.\n");
width(column(0), widthInPixels_ID);
int widthInPixels_main = intOf( (96.0 * widthInInches_main) );
print("Setting Main to " (widthInPixels_main) " pixels.\n");
width(column(1), widthInPixels_main);
int widthInPixels_ObjectType = intOf( (96.0 * widthInInches_ObjectType) );
print("Setting Object Type to " (widthInPixels_ObjectType) " pixels.\n");
width(column(2), widthInPixels_ObjectType);
int widthInPixels_Effectivity = intOf( (96.0 * widthInInches_Effectivity) );
print("Setting Effectivity to " (widthInPixels_Effectivity) " pixels.\n");
width(column(3), widthInPixels_Effectivity);
int totalWidth = widthInPixels_ID + widthInPixels_main //-
+ widthInPixels_ObjectType + widthInPixels_Effectivity;
print("Total Width is " (totalWidth) " pixels\n");
print("Total Width is " (widthInInches_page) " inches\n");
}
setColumnWidth();
You can customize it for your particular
|
|
Re: Is there a way to display a table? Peter_Albert - Tue Apr 24 15:06:52 EDT 2012 SystemAdmin - Tue Apr 24 13:11:18 EDT 2012
None of the export methods are perfect.
I think the one that does the best job overall is export as HTML. In particular, it does a good job with tables and pictures. I use the Table mode as opposed to the Book mode.
After you export as HTML, you can open with Word and save as .DOC or .RTF file.
Suppose you are exporting a subset for a meeting and using landscape format. You would export from a landscape-sized DOORS view. Next you could open in Firefox and set Firefox page properties to landscape. Select shrink to fit for extra assurance. Lastly print.
VERY IMPORTANT -- Arrange the widths of columns just as you want them to appear once exported.
I have a canned "Export Portrait View" and "Export Landscape View" for this purpose. OLE objects will be converted to PNG files and the resolution of those files is based on the width of columns upon export.
You can use DXL to fine tune your column widths for an export view to save a lot of trial and error (and wasted trees).
In this example:
-
Landscape is desired
-
Paper is 8.5 x 11"
-
Left and right margins are 0.75"
-
Columns (in order) are:
-
DOORS ID
-
(main column)
-
Object Type
-
Effectivity
Everything is specified in inches and (main column) gets whatever is left over.
// NOTE 96 pixels per inch is typical.
// It may vary with output device.
void setColumnWidth() {
real widthInInches_page = 11.0;
real widthInInches_leftMargin = 0.75;
real widthInInches_rightMargin = 0.75;
real widthInInches_ID = 0.5;
real widthInInches_ObjectType = 0.8;
real widthInInches_Effectivity = 1.4;
real widthInInches_main = widthInInches_page //-
- widthInInches_leftMargin //-
- widthInInches_rightMargin //-
- widthInInches_ID //-
- widthInInches_ObjectType //-
- widthInInches_Effectivity;
int widthInPixels_ID = intOf( (96.0 * widthInInches_ID) );
print("Setting ID to " (widthInPixels_ID) " pixels.\n");
width(column(0), widthInPixels_ID);
int widthInPixels_main = intOf( (96.0 * widthInInches_main) );
print("Setting Main to " (widthInPixels_main) " pixels.\n");
width(column(1), widthInPixels_main);
int widthInPixels_ObjectType = intOf( (96.0 * widthInInches_ObjectType) );
print("Setting Object Type to " (widthInPixels_ObjectType) " pixels.\n");
width(column(2), widthInPixels_ObjectType);
int widthInPixels_Effectivity = intOf( (96.0 * widthInInches_Effectivity) );
print("Setting Effectivity to " (widthInPixels_Effectivity) " pixels.\n");
width(column(3), widthInPixels_Effectivity);
int totalWidth = widthInPixels_ID + widthInPixels_main //-
+ widthInPixels_ObjectType + widthInPixels_Effectivity;
print("Total Width is " (totalWidth) " pixels\n");
print("Total Width is " (widthInInches_page) " inches\n");
}
setColumnWidth();
You can customize it for your particular
My apologies if my question was not properly put: I have no problem in general exporting DOORS views to HTML or Word - my specific question was on the "RTF" tables Louie had mentioned. They are in fact very useful to have small tables applear in the Object Text of an Object, but at least for me I fail to export them back to Word or HTML. To be clear, those are tables built in rich text, stored in the "Object text", using the fact that DOORS is able to display more RTF features than it is actually able to modify through the GUI.
Regards,
Peter
|
|
Re: Is there a way to display a table? SystemAdmin - Tue Apr 24 17:11:04 EDT 2012 Peter_Albert - Tue Apr 24 15:06:52 EDT 2012
My apologies if my question was not properly put: I have no problem in general exporting DOORS views to HTML or Word - my specific question was on the "RTF" tables Louie had mentioned. They are in fact very useful to have small tables applear in the Object Text of an Object, but at least for me I fail to export them back to Word or HTML. To be clear, those are tables built in rich text, stored in the "Object text", using the fact that DOORS is able to display more RTF features than it is actually able to modify through the GUI.
Regards,
Peter
I was thinking the HTML export honored RTF tables but I was wrong.
I just ran a few tests and my results are consistent with yours.
Export of RTF tables fails for HTML, PDF, and Word.
Specification of fixed width font fails as well.
Looks like you'll have to use native DOORS tables or OLE Objects of Word or Excel. Note that an extra wrinkle with OLE objects is big ones (over a pages worth won't do page breaks).
I tend to use native DOORS tables because they export better.
I use small Word OLE objects if anything other than fixed width font would look messy (for example, output from a text-based database client like SqlPlus where text alignment depends on a fixed width.) I really wish you could specify fixed width override for a given Object Text but you can't.
|
|