BIS and DDE In Action

32
Jerry Merrill ------------------------ -------- AIP4020: Business Information Server (MAPPER) and DDE in Action

description

BIS and DDE in Action (Best Presentation Award 2001)

Transcript of BIS and DDE In Action

Page 1: BIS and DDE In Action

Jerry Merrill--------------------------------AIP4020: Business Information Server (MAPPER) and DDE in Action

Page 2: BIS and DDE In Action

Agenda

• What Is DDE ?• BIS Support for DDE• Using DDE with:

- Excel - Word - Visual Basic

• DDE at Expanets• Questions and Answers

Page 3: BIS and DDE In Action

What is DDE?

Definition

• Dynamic Data Exchange

• An early Windows™ API that allows one DDE enhanced application to share data with or drive another DDE enhanced application

• Still supported but not being enhanced

• Replaced by OLE and other API’s

Page 4: BIS and DDE In Action

What is DDE?

Elements• Conversation - Windows assigns a handle - Can have more than one open

• Application - Name of main form (see manual)

• Topic - Document, worksheet or form

• Item - Bookmark, cell or field

Page 5: BIS and DDE In Action

What is DDE?

What can DDE do?• Read data

• Write data

• Link data items between applications

• Execute commands or macros

Page 6: BIS and DDE In Action

BIS Support for DDE

Requirements• BIS Hosts: - 2200, UNIX, NT, PC

• Workstations: - DW, PCE, MPC, GI

• Session: - foreground

Support• Outbound DDE only

Page 7: BIS and DDE In Action

BIS Support for DDE

@DDE: a function withmany command options

• (i) initiate a conversation

• (r) read data

• (p) poke data

• (e) execute command(s)

• (a) set an advise

• (u) clear an advise

@CLS close a conversation

Page 8: BIS and DDE In Action

BIS Support for DDE

Initiate:@DDE,”applctn”,,I,[topic],TEXT,,lbl <HDL>I6 .

Read, Poke, Advise, Unadvise:@DDE,””,<HDL>,R,item,TEXT .@DDE,”value(s)”,<HDL>,P,item,TEXT .@DDE,c,d,r,l,file,<HDL>,P,item,TEXT[,T] .@DDE,””,<HDL>,A,item,TEXT .@DDE,””,<HDL>,U,item,TEXT .

Execute:@DDE,”command_string”,<HDL>,E,,TEXT .

Page 9: BIS and DDE In Action

Using DDE with Excel

@ DDE,"EXCEL",,I,,TEXT,,LIN1 <XL>I6 ; GTO 34 . @ PC,B <XDIR>'EXCEL.EXE '<DDIR>WBS.XLS GTO 35 .@34:DDE,"[OPEN('"'<CDIR>WBS.XLS'"')]",<XL>,E,,TEXT @35:CLS,<XL> DDE,"EXCEL",,I,SHEET1,TEXT <WS>I6 . ...

Application excel

Topics system worksheet name

Items system: sysitems , topics sheet cell: R1C1 sheet range: R1C1:R3C7

Page 10: BIS and DDE In Action

Using DDE with Excel

@DDE,"[OPEN('"’STDWBS.XLS'"')]",<XL>,E,,TEXT . Excel@DDE,"[CALCULATION(3)]",<XL>,E,,TEXT,,LIN1 . off@CLS,<XL> DDE,"EXCEL",,I,SHEET1,TEXT <WS>I6 . sheet ... @DDE,"[CALCULATE.NOW]",<WS>,E,,TEXT . do now@DDE,"[CALCULATION(1)]",<WS>,E,,TEXT . on@DDE,"[SAVE.AS('"’NEWWBS.XLS'"')]",<WS>,E,,TEXT .@CLS,<WS> . sheet

Execute:

• Command set in Excel 4.0 Function Reference and/or XLMACR8.HLP file• Open/save/close• Calculation on/off

Page 11: BIS and DDE In Action

Using DDE with Excel

@DDE,”3.14159",<WS>,P,R4C6,TEXT . single cell

@DDE,”Able|Baker|Charlie",<WS>,P,R3C1:R3C3,TEXT . 1,280 character limit range of cells@DDE,-0,2,DDETEMP,<WS>,P,R1C1:R3C3,TEXT,T . 64,000 character limit range of cells

@PCW,-2,2,0199 <PTH><FIL>'.txt' . large data @PC,B <XDIR>'EXCEL.EXE '<PTH><FIL>'.txt' .

Poke:

• Single cell• Range of cells• Large amounts of data

Page 12: BIS and DDE In Action

Using DDE with Excel

@DDE,"[Select('"'R3C1:R3C2'"')]",<XL>,e,,TEXT . the *=== row@DDE,"[Column.Width(,,,3)]",<XL>,e,,TEXT . set column width@. @DDE,"[Select('"'R1C1:R2C2'"')]",<XL>,e,,TEXT . the headers@DDE,"[Format.Font('"'Arial'"',10,True)]",<XL>,e,,TEXT . Bold@DDE,"[Alignment(3)]",<XL>,e,,TEXT . center @. @DDE,"[Select('"'R3C2:R14C2'"')]",<XL>,e,,TEXT . the numbers@DDE,"[Format.Number('"'$#,##0.00'"')]",<XL>,e,,TEXT . dollar

Format:

• Column width• Font and alignment• Number format

Page 13: BIS and DDE In Action

Using DDE with Excel

@DDE,”",<WS>,R,R4C6,TEXT . single cell@CHG INPUT$ <CELLVALUE>H12 .

@DDE,”",<WS>,P,R3C1:R3C3,TEXT . range of cells@CHG INPUT$ <CELL1>H10,<CELL2>I6,<CELL3>F8.2 . 6,000 character limit

@DDE,””,<WS>,R,R1C1:R2C3,TEXT . @RDL,-0,2 1-80 <TABBED_DATA1>S . medium data@RDL,-0,3 1-80 <TABBED_DATA2>S . 6,000 character limit

Read:

• Single cell• Range of cells• Medium amounts of data

Page 14: BIS and DDE In Action

Using DDE with Excel

@DDE,"[RUN('"’MACRO1'"')]",<XL>,E,,TEXT .

@DDE,"[RUN('"’OTHER.XLS!MACRO2'"')]",<XL>,E,,TEXT .

Execute a Macro:

• Build with “Record a Macro” or Visual Basic for Applications• Store in current or external worksheet • Execute from BIS

Page 15: BIS and DDE In Action

Using DDE with Excel

D E M O

Page 16: BIS and DDE In Action

Using DDE with Word

@DDE,"WINWORD",,I,,TEXT,,LIN1 <WD>I6 ; GTO LIN2 .@PC,B <WDIR>'WINWORD.EXE' GTO LIN -1 .@DDE,"[FILEOPEN .NAME='"'<SKEL>'"']",<WD>,E,,TEXT . @DDE,"[FILESAVEAS .NAME='"'<NEW>'"', .ADDTOMRU=1]",\ <WD>,E,,TEXT .@DDE,"WINWORD",,I,<NEW>,TEXT <DOC>I6 . ...

Application winword

Topics system document filename

Items system: sysitems, topics document: bookmark

Page 17: BIS and DDE In Action

Using DDE with Word

@DDE,"",<WD>,R,Topics,TEXT . what files are open? @CHG INPUT$ <SYS>H6,<OPEN1>H18,<OPEN2>H18 .@IF <OPEN2> NE '’ \ . DDE,"[FileCloseAll]",<WD>,E,,TEXT . close them

@DDE,"[FileOpen .NAME='"'<INPDOC>'"']",<WD>,E,,TEXT .

Getting a Clean Start:

• Find out if any documents are open

• Close previously opened documents

• Open your own document

Page 18: BIS and DDE In Action

Using DDE with Word

@DDE,"[StartOfDocument]",<DOC>,e,,text . @DDE,"[EditFind .Find='"'!target!'"']",<DOC>,e,,text @DDE,”[Font ‘”’Courier New’”’],<DOC>,e,,text . @DDE,”[FontSize 10],<DOC>,e,,text .@DDE,”[LineDown 3],<DOC>,e,,text .@DDE,”[SelectCurSentence],<DOC>,e,,text .@DDE,”[EditCut],<DOC>,e,,text .@DDE,"[EndOfDocument]",<DOC>,e,,text . @DDE,”[EditPaste],<DOC>,e,,text .

Execute:

• Edit using the document’s conversation

• Command set in the WordBasic manual and/or WRDBASIC.HLP file

Page 19: BIS and DDE In Action

Using DDE with Word

@DDE,”NT",<DOC>,p,BkMrk,text . pre-existing

@DDE,"[EditFind .Find='"'!terms!'"']",<DOC>,e,,text .@DDE,"[EditBookMark .Name='"'Terms'"', .Add]",\ . <DOC>,e,,text . created @DDE,”cash only",<DOC>,p,Terms,text .

@RDL,-2,<LN>,20 ‘FI’,’VA’ <FLD>H,<VAL>S LDV,P <VAL> .@DDE,"[EditReplace .Find='"'<FLD>'"', \ . .Replace='"'<VAL>'"', .ReplaceOne]", <DOC>,E,,TEXT .@INC <LN> GTO LIN -3 .

Poke:

• Bookmark• Edit/Replace• Table driven

*OC FIELD VALUE *==.============.==============| 2|!name! |XYZ Corp |12|!appl! |RQS | 1|!runcount! |1,036 | 1|!runlines! |104,455 | 1|!drwcnt! |36 | 1|!ridcnt! |15,239 | 1|!lincnt! |10,685,449 | 1|!dbsize! |2.7090

Page 20: BIS and DDE In Action

Using DDE with Word

@DDE,"[ViewHeader]",<DOC>,e,,text .@DDE,”[ShowNextHeaderFooter]",<DOC>,e,,text . @DDE,”[EditFind .Find = ‘”’!cust!’”’]", <DOC>,e,,text@DDE,”[Insert ‘”’<cust>’”’]",<DOC>,e,,text .@DDE,"[ViewHeader]",<DOC>,e,,text .

Headers and Footers:

• Separate from body of text• Enter, edit and exit

Page 21: BIS and DDE In Action

Using DDE with Word

@DDE,"[EditFind .Find='"'!freq!'"']",<DOC>,e,,text . @DDE,"[EditBookMark .Name = '"'CmdFreq'"',\ . .Add]",<DC>,e,,text .@DDE,-3,6,ddetemp,<DOC>,p,CmdFreq,text,t .@. @RSR,ECAB$,H,26 0010 . formatting commands@LDV <LN8>I2=2 . get command@RDL,-8,<LN8>,LIN3 1-132 <MAC>S LDV,P <MAC> . @DDE,"[<MAC>]",<DOC>,e,,TEXT . execute command @INC <LN8> GTO LIN -2 . next command

Poke and Format Tables:

• Create a bookmark• Poke in table data• Reformat table

Page 22: BIS and DDE In Action

Using DDE with Word@10:brk,ecab$,b . EditBookmark .Name = ”CmdFreq", .Goto TextToTable .ConvertFrom = "1", .NumColumns = ”3",¬ .NumRows = "4", .InitialColWidth = "Auto",¬ .Format = "0", .Apply = "167" BorderOutside 1 TableRowHeight .LeftIndent = ”0.81" StartOfRow TableSelectColumn TableColumnWidth .ColumnWidth = ”0.80", .NextColumnTableColumnWidth .ColumnWidth = ”2.59", .NextColumnTableColumnWidth .ColumnWidth = "0.69" StartOfColumn StartOfRow TableSelectRow BorderOutside 1 @ brk rnm -8 esr .

• Reformatting commands

Page 23: BIS and DDE In Action

Using DDE with Word • Get indent and column size from

Table > Cell Height and Width...

Page 24: BIS and DDE In Action

Using DDE with Word

D E M O

Page 25: BIS and DDE In Action

Using DDE with Visual Basic

Begin VB.Form frmMAPZIP Caption = "MAPZIP" LinkMode = 1 'Source LinkTopic = "frmMAPZIP"

Application .EXE name

Topics form

Items text fields only

@DDE,"MAPZIP",,I,frmMAPZIP,TEXT,,LIN1 <MZ>I6 ;GTO 5 .@PC,B <PCME>MAPZIP.EXE ; GTO LIN -1 .@5:. ...

Page 26: BIS and DDE In Action

Using DDE with Visual Basic

VB Side:

Page 27: BIS and DDE In Action

Using DDE with Visual BasicBIS Side:

@DDE,"<ARCHIVE>",<MZ>,p,txtArchive,text . SET ARCHIVE@DDE,"<PCME>",<MZ>,p,txtDirectory,text . SET DIRECTORY@DDE,"Y",<MZ>,p,txtDeleteAfter,text . SET DELETE AFTER@.@PCW,<c>,<d>,<r>,2 <PCME><FILE> . EXPORT RID@DDE,"<FILE>",<MZ>,p,txtFileMask,text . SET FILE NAME@DDE,"A",<MZ>,p,txtStatus,text . FORCE THE ADD@.@DDE,"",<MZ>,r,txtStatus,text . CHECK STATUS@CHG INPUT$ <STAT>H1 IF <STAT> NE C,(LIN-1) ; . @.@DDE,"E",<MZ>,p,txtStatus,text . END MAPZIP.EXE@CLS,<MZ> .

Page 28: BIS and DDE In Action

Using DDE with Visual Basic

D E M O

Page 29: BIS and DDE In Action

DDE at Expanets

BITS (Business Info Tracking Sys)• VSS-RADS shell for managing ESS

• Uses DDE for proposals, contracts, memos

VSS-MAPPORT• VSS-RADS shell for portation proposals

• Highly automated “Inventory Report and Portation Proposal”

Page 30: BIS and DDE In Action

DDE at Expanets

wbs.xls invtrpt.doc

GenReport

SizeProject

Load &Analyze

portation rid

InventoryRids

VSS-MAPPORT Process

Page 31: BIS and DDE In Action

Questions and Answers

•What is DDE?

•BIS support for DDE

•Using DDE with:- Excel- Word- Visual Basic

•DDE at Expanets??

Page 32: BIS and DDE In Action

For more information contact:Jerry MerrillDirector of Migration ServicesExpanets15941 No 77th StreetScottsdale, AZ 85260e-mail: [email protected]: www.expanets-az.com