Manuale d’uso / di manutenzione del prodotto 2 del fabbricante Sybase
Vai alla pagina of 500
Dat aWindow Designer User ’ s Guide Dat aW indow .NET ™ 2.0.
DOCUMENT ID: DC00043-01- 0200-01 LAST REVISED: March 2006 Copyright © 20 04-2006 by Sy base, Inc. All righ ts reserved. This publicatio n pertains to S ybase software and to any subsequent release until otherwise indicate d in new editions or technic al notes.
Content s Data Win dow De si gne r User’s Gu ide iii About This B ook ................................................................................................................ .......... xv PART 1 THE DATAWINDOW DESIGNER ENVIRONM ENT CHAPTER 1 Working with DataWindow Designer .
Contents iv DataW indow .NET How your DataWindow Designer environment is managed ........... 32 About the registry .................................................................... 32 About the initialization file ..................................
Conte nts Dat aWindow D esigner Us er ’s Guide v Closing a table ......................................................................... 70 Dropping a table ...................................................................... 70 Viewing pending SQL changes .
Contents vi DataW indow .NET Using Quick Select ....................................................................... 112 Selecting a table .................................................................... 113 Selecting columns ..................
Conte nts Dat aWindow D esigner Us er ’s Guide vii Working in a grid DataWindow object ................................... 166 Saving data in an external file ...................................................... 168 Saving the data as PDF ........
Contents viii DataW indow .NET Adding buttons to a DataWindow object ............................... 210 Adding graphs to a DataWindow object ................................ 213 Adding InkPicture controls to a DataWindow object.............. 213 Adding reports to a DataWindow object .
Conte nts Dat aWindow D esigner Us er ’s Guide ix The DropDownDataWindow edit style ................................... 249 The InkEdit edit style ............................................................. 251 Defining a code table ..............
Contents x DataW indow .NET Format ................................................................................... 307 Height .................................................................................... 307 Pen.Color ......................
Conte nts Dat aWindow D esigner Us er ’s Guide xi Enhancing crosstabs .................................................................... 344 Specifying basic properties ................................................... 345 Modifying the data associated with the crosstab .
Contents xii DataW indow .NET Composite and nested reports .............................................. 395 CDATA sections .................................................................... 397 Comments ............................................
Conte nts Dat aWindow D esigner Us er ’s Guide xiii APPEND IX B The Extended Attribute S ystem Tables ........................ ............ 453 About the extended attribute system tables ................................. 453 The extended attribute system tables .
Contents xiv DataW indow .NET.
Data Win dow De si gne r User’s Gu ide xv About This Book Audience This boo k is written for programmers who need to design DataW indow® objects. DataW indow objects ar e used to ret rieve, present , and manipu late data from a relational database or ot her source.
xvi Dat aWindow .NET • The Sy base Produ ct Manuals W e b site is an onl ine versio n of the SyBoo ks CD that you can access using a standard W eb browser . In addition to product manuals , you will find links to EB Fs/Maintenance, T echnical Documents, C ase Manageme nt, Solved Cases , newsgroups , and the Sybas e De velop er Ne twork .
PA R T 1 The Da t aWin dow Designer Environmen t This part in troduces you to DataWindow Desi gner and describe s how to work in and manag e its environment .
.
Data Win dow De si gne r User’s Gu ide 3 CHAPTER 1 W orking with Dat aWindow Designer About thi s chapter This chapter descri bes the basics of working w ith DataW indow Designer and its painters.
About DataWindow Designer 4 Dat aWindow .NET About Dat aWindow De signer DataW indow Designer is a tool that creates DataW indow objects for use in applications. A DataW indow object is an object that you use to retrieve and manipu late data from a r elational data base or other d ata source.
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 5 If you ha ve used Data Window Des igner before Y ou can open an existing p roject by se lecting Open Project or Recent Projects from the File menu, or Open Project from the pop-up menu in the System T ree.
Working with projects 6 Dat aWindow .NET Buttons on the PowerBar Fro m left to right on the PowerBar , here are the buttons and what you can do after yo u click a button: Custo mi zi ng the PowerBar Y ou can customize th e PowerBar . For ex ample, you can move it to dif ferent locations and add button s for oper ations you perform freq uently .
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 7 ❖ T o create a new project: 1 Click the New b utton in the PowerBar , or select File>New from the menu bar . 2 On the Project page in the New dialog box, select the pro ject icon and click OK.
Working with DataWi ndow objects 8 Dat aWindow .NET Creating new Dat a Window objects T o create new DataW indow objects, use the New bu tton in the PowerBar . ❖ T o create a new object: 1 Click the New butto n in the PowerBar , or select File>New from t he menu bar .
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 9 2 In the Open dialog box, select one or more libraries in the Library pane and then select the object you wan t to open. 3 Click OK. The object opens in the DataWindow painter .
Working in painters 10 Dat aWindow .NET W orking in p ainte rs The DataW indow Desi gner painter s are listed in T able 1-1. T able 1-1: DataWi ndow Designer pai nters Using views in painters Most of t he Dat aW i ndow Des igner painter s have views.
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 11 Displaying t he titl e bar For most views a title bar does not permanently display at the top of a pane (because it is often unnecessary). But you can display a title bar for any pane either temporarily or permanently .
Working in painters 12 Dat aWindow .NET A gray outline appears in the pane: 2 Drag the outline to the new locati on. The outline chan ges size as you drag it. When the pointer is o ver the middle of a pane, the outline fills the pan e. As you drag the pointer toward any border , the outline becomes a narrow rectangle adjacent to that bo rder .
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 13 ❖ T o move a view in a st acked p ane: • Place the pointer anywhere on the view’ s tab, hold down th e left mouse button, an d start mov ing the view . Y ou can now move the view as in the prev ious procedure.
Working in painters 14 Dat aWindow .NET ❖ T o add a new view to the p ainter window : 1 Select V iew from the menu bar and then s elect the view you wan t to add. The view displays in a new p ane in a new row . 2 Move the pane where you want it . For ho w to move pan es, see “Moving and resizing panes a nd views” on page 1 1.
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 15 2 Click the N ew Layout button ( second from the left at the top of the dialo g box).
Working in painters 16 Dat aWindow .NET Defining colors Y ou can define custom colo rs to use in most painters and in o bjects you create. ❖ T o defin e custom co lors: 1 In a painter that uses custom color s, select Design>Custom Colors from the menu bar .
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 17 W orkin g with to ols In addition to painters , DataW in dow Designer provides you with some other tools t o help you w ith your work. Y ou can open mo st tools f rom the T ools menu, the Po werBar , or the T ools page in the New d ialog box.
Working with tools 18 Dat aWindow .NET Editing ac tiv iti es The file editor provides a full set of basic editi ng faci lities including: • Openi ng, savi ng, and pri nting fi les • Cutti ng, copy.
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 19 When you mo ve the poin ter over entrie s on the T o-Do list, the pointer chan ges to a hand if it is over a linked entry . Y ou can export or impor t a T o-Do List by sel ecting Impor t or Export fro m the pop-up men u.
Setting properties 20 Dat aWindow .NET Sett ing prop erties In Dat aW indow De sig ner , you set pr op erti es on pages that di sp l ay i n a t abb ed dialog box or in a view in a painter . In the DataW indow painter , you set object properties in the Properties view .
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 21 • Select Properties from the pop-up me nu of an o bject, control, library name, or tab le or column name • Se.
Using toolbars 22 Dat aWindow .NET For example, the d own ar row next to the T ext button in the DataW indow painter displays the Co ntrols drop-down toolbar , which has a button for each control you .
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 23 Moving toolbars using the mouse Y ou can use the mo use to move a to olbar . ❖ T o move a toolbar w ith the mou se: 1 Position the pointer on the grab bar at the left of th e toolbar or on any vertical line s eparating g roups of buttons.
Using toolbars 24 Dat aWindow .NET The Cust omize dialog box dis plays. 3 Click the palette of buttons you want to use in the Select pa lette g r oup. 4 Choose a button fr om the Selected palette bo x and drag it to the posi tion you wa nt in the Cur rent tool bar box.
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 25 ❖ T o delete a bu tton from a toolbar: 1 Position the pointer on the too lbar, display the pop-up menu, and select Customize. 2 In the Cur rent toolbar b ox, select t he button and dr ag it outside the Curr ent toolba r box.
Using toolbars 26 Dat aWindow .NET ❖ T o add a custom button: 1 Positi on the point er on the to olbar , display the po p-up menu, and select Customize. 2 Select Custom in the Select Palette group. The custom buttons display in th e Selected Palette box.
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 27 5 In the Item T ext box, specify the text associated with th e button in two parts separat ed by a comma—the te.
Using toolbars 28 Dat aWindow .NET The defaul t command lin e is: DataWindow /o DataWindowN ame /ro Modifying a custom button ❖ T o modi fy a custom button: 1 Positi on the point er on the to olbar , display the po p-up menu, and select Customize. 2 Double-click the butt on in the Cu rrent toolbar box.
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 29 Using onlin e Help DataW indow Designer has online Hel p that provides both refer ence and task-oriented informatio n. Context-sensitive and reference information is provided i n W indow s Help for mat.
Customizing keyboard sh ortcuts 30 Dat aWindow .NET Customizing keyb oard shortcuts Y ou can associate your own key board shor tcuts wit h DataW indow Designer menu items.
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 31 3 Press the keys you wan t for the s hortcut; t he new shor tcut displ ays in the textbo x. If you t ype a short cut that is already bei ng used, a mes sage notifies you so that you can type a dif ferent shortcut or change the exis ting short cut.
How your DataWindow Designer environment is managed 32 Dat aWindow .NET Use the Printer font tab to set fonts specifically for printing. If you need to pr int multilanguage char acters, make sure you u se a font that is installed on y our prin t e r .
CHAPTER 1 Working with DataWindow Designer Data Win dow De si gne r User’s Gu ide 33 About the init ialization file The initialization file is a text file that co ntains var iabl e s th at sp ecify your DataW indow Designer pref erences.
How your DataWindow Designer environment is managed 34 Dat aWindow .NET ❖ T o spe cify a differen t location for DW .INI: 1 Select T o ols>System Option s from the menu b ar . 2 On the General tab page, enter the path of your initializatio n file in the Initialization Path textbox.
Data Win dow De si gne r User’s Gu ide 35 CHAPTER 2 W orking with Librari es About thi s chapter DataW indow Designer stor es all th e objects you create in libraries. This chapter describes how to work with your lib raries . Conten ts About libraries DataW indow Designer uses libr ar ies to hold objects.
About the Library painter 36 Dat aWindow .NET What you ca nnot do i n the Libr ary pa inte r Y ou cannot create a library or ren ame a library in the Library painter . For inform ation about cr eating a library , see “W orking with proj ects” on page 6.
CHAPTER 2 Working with Libraries Data Win dow De si gne r User’s Gu ide 37 About sorting the Name colum n When you Click the Name column header repeatedly to s ort, the sort hap pen s in four ways : by obj ect t ype and then name i n bo th ascen di ng and des cend ing order and by obj ect name in both ascending and descending order .
Working with li braries 38 Dat aWindow .NET Usin g drag and drop to ex pand it em s Y ou can dr ag and drop items to expand them and see the contents: For exampl e, you can d rag a libr ary fr om the T ree view and drop it in the List view to quickly d isplay the objects the library contains in the List view .
CHAPTER 2 Working with Libraries Data Win dow De si gne r User’s Gu ide 39 Selecting objects In the List view , you can select one or more libraries or o bjects to act on. ❖ T o select multiple entries: • In the List view , use Ctrl+Click (for individu al entries ) and Shift+Click (for a group of ent r ies).
Working with li braries 40 Dat aWindow .NET Overri ding the choices you ma de for a specif ic vie w In either the T ree view or the List view , you can overr ide your choice of object s that display in all libra ries by selecting a library , dis playing the library’ s pop-up menu, and then clearing or selecting items on the list of objects .
CHAPTER 2 Working with Libraries Data Win dow De si gne r User’s Gu ide 41 ❖ T o copy o r move objec t s using drag and drop: 1 In the T ree view or the List view , se lect the objects you want to co py or move. 2 Press Shift to mo ve the ent ries.
Working with li braries 42 Dat aWindow .NET Setting the root In either the T ree view or the List vi ew , you can set the root location o f the view . ❖ T o set the root of th e current view : 1 In either view , select V iew>Set Root from the menu bar , or select Se t Root from th e pop-up menu.
CHAPTER 2 Working with Libraries Data Win dow De si gne r User’s Gu ide 43 Modifying comments Y ou can use commen ts to document your objects an d libraries.
Optimizing li braries 44 Dat aWindow .NET Deleting libraries ❖ T o dele te a library: 1 In either the T ree view or the List view , select th e lib rary you want to delet e. 2 Select Libr ary>Delete fr om the menu bar . Restrict ion Y o u cannot delete libraries in the current library list .
CHAPTER 2 Working with Libraries Data Win dow De si gne r User’s Gu ide 45 If you do not want a bac kup file If you do not want to save a backup copy of the library , clear the Save Optimized Backups ch eck box in the Li br ary painter's Design>Opt ions tab dialog box.
Exporting and importing entries 46 Dat aWindow .NET DataW indow Design er uses proj ect (.dwp) files to manage libraries. Th e following s a m ple has three libraries: lib1.pbl , lib2.pbl , and lib 3.pb l . If you delete the library listed on the applib lin e, l ib1.
CHAPTER 2 Working with Libraries Data Win dow De si gne r User’s Gu ide 47 ❖ T o export entries to text files: 1 Select the Library entries you want to export.
Creating a deployment li brary (PBD file) 48 Dat aWindow .NET 3 Click Open. The Import File Into Library Entry dialog b ox displays listing the libraries in the library search path. 4 Select the library you want to impor t the text files to . 5 Click OK.
CHAPTER 2 Working with Libraries Data Win dow De si gne r User’s Gu ide 49 A PBR f ile is an ASC II text f ile in whi ch you lis t resource names (such as B MP , CUR, R LE, an d WMF f i les) an d DataWindow ob jects .
Creating a library directory report 50 Dat aWindow .NET ❖ T o crea te the libra ry directory report: 1 Select the current library . 2 Select Library>Print Directory f rom the menu bar . DataW indow Designer sends the library directory repo rt to the prin ter specified un der File>Pri nter Setup in t he menu bar .
Data Win dow De si gne r User’s Gu ide 51 CHAPTER 3 Managing the Dat abase About thi s chapter Thi s c hapte r des c ribes how to m ana ge the da taba s e from withi n Data W i ndow Desig ner. Conten ts Before yo u begin Y ou work wit h relatio nal databases in DataW indow Design er.
Working with database components 52 Dat aWindow .NET How you work with dat abases in Dat aWindow Designer Y ou can use DataW indow Design er to work wit h the follo wing database components: • T abl.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 53 In the following illustr ation there is a join on the dept_ id column, which is a primary k ey for the de pa rtm ent table and a foreign key for th e employee tab le: For more i nformation, s ee “W orking with keys” on page 75.
Managing databases 54 Dat aWindow .NET Extende d attribute s Extended attributes enable you to store information about a table’ s columns in special sys tem tables. U nlike tables, keys, in dexes, and da tabase views (which are DBMS-specific), extend ed attributes are DataW indow Designer-specific.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 55 What you can do Using the Database painter, you can do the following in any DBMS to which you have been given access by the .
Using the Database painter 56 Dat aWindow .NET Views i n the Databa se pai nt e r T a b le 3-1 lists the views available in the Database painter . T able 3-1: Database painter v iews View De scri ptio n Activit y Log Displays th e SQL synta x gener ated by the a ctions yo u execute.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 57 Draggin g and dropping Y ou can select certain database ob jects from th e Objects view and drag them to the Object Details, Object Layout, Columns , and/ or ISQL views. Just positi on the pointer on t he database ob ject ’ s icon and drag it to the appropriate view .
Using the Database painter 58 Dat aWindow .NET Modifying database preferences T o modi fy database preferences , select Des i gn>Op tions from the me nu ba r. Some preferences are s pecific to the data base connection; others are specific to the Database painter .
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 59 Preferen ces on th e Object Co lors property page Y ou can set colors separately for each comp onent of the Database painter's graphical table representation: the table header , columns, indexes, primary k ey , foreign keys, and joins.
Creating and deleting an Adaptiv e Server Anywhere database 60 Dat aWindow .NET ❖ T o stop the log: • Select S top Log from the Desi gn menu or the pop-up men u in the Activity Log view . DataW indow Desi gner stop s se nding th e generated synt ax to the Act ivity Log vi ew .
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 61 3 Define other prop erties of the database as need ed. If you ar e using a non-Eng lish databas e, you can specify a code page in the Collation Sequence bo x. For complete informatio n about f illin g in the dialog box, click the Help button i n the dialog box.
Working with tables 62 Dat aWindow .NET W orking with t ables When you open the Database painter , the Object view lists all tables in the current database that y ou have access to (i ncluding tables that were not created using DataW indow Designer). Y ou can create a new table or alter an existing table.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 63 5 Click the S ave button o r select Sav e from the Fi le or pop-u p menu, then enter a name for th e table in the Create New T able dialog box. DataW indow Designer subm its the pending SQL syntax statemen ts it generated to the DBMS, and the table is created.
Working with tables 64 Dat aWindow .NET Specifying column definitions When you create a new table, you must specify a definition for each column . The fields that di splay for each column in the Columns view depend on you r DBMS. Y ou might not see all of the followi ng fields, and the values th at you can enter are dep endent on the DBMS.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 65 Spec if ying t able propertie s In addition to adding a comment to associate with the table, you can choose the fonts that will be used to display information from the table in a DataWindow object.
Working with tables 66 Dat aWindow .NET S peci fying column extended attr ibut es In addition to addin g a comment to associate with a column , you can specify extended attributes fo r each column. An extended attribute is information specific to DataW indow Designer that en hances the d efinition of the colum n.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 67 Overriding de finitions In the DataWindow painter, you can ove rride the extended attributes specified in the Database painter for a particular DataWindow object.
Working with tables 68 Dat aWindow .NET S pecifyi ng a col umn as a picture Y ou can specify that a character colu mn can contain nam es of picture files. ❖ T o spe cify that colu mn values a re name s of picture file s: 1 On the Display prop erty page, select the Picture check b ox.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 69 Data base p ainter is DBM S aware The Database paint er gray s out or not ifi es yo u about action s that your DBMS prohibits. For complete information abo ut what you can and cannot do when you modif y a table in your DBMS, see your DBMS documen tation.
Working with tables 70 Dat aWindow .NET Cutting, copying, and pasting columns In the Database painter , you can use the Cut, Copy , and Paste b uttons in the PainterBar (or Cut, Copy , and Paste f rom the Edit or pop-up menu) to cut, copy , and paste one co lumn at a time within a table or b etween tables.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 71 Deletin g orphaned tabl e i nfo r matio n If you drop a table outside DataWin dow Designer, information rem ains in the system tables about the table, in cludin g extended attributes for the columns.
Working with tables 72 Dat aWindow .NET ❖ T o copy the SQL synt ax to the clipbo ard: • In th e Pending Syn t ax vi ew , clic k the Copy but ton or select Copy from the pop-up menu . ❖ T o sav e SQL synt ax fo r execution a t a later ti me: 1 In the Pending Syntax view , Select File>Save As.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 73 ❖ T o export th e synt ax of an e xisting t a ble to a log: 1 Select the table in the painter workspace.
Working with tables 74 Dat aWindow .NET T able 3-6: Extended attribute syste m tables Openi ng and disp la yi ng sy ste m t ables Y ou can open system t ables like o ther tables, in the Database pai nter . By default, DataW indow Designer show s only user- created tables in the Objects v iew .
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 75 Working with keys If your DBMS suppor ts primary and for eign keys, you can work with the keys in DataW indow Designer. Why you should u se keys If your DBMS supp orts them, you shou ld use pri mary and for eign keys t o enforce the referential integrity of your databas e.
Working with keys 76 Dat aWindow .NET In the following pict ure, the Dep artment table has two key s: • A pr i m ary k ey (on de pt_id ) • A foreig n key (on dept_head_id ) If you cannot see the l.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 77 • Expand the table’ s tree view , right-click Primar y Key , and select New Primary Key from the pop-up menu . The Primary Key properties disp lay in the Object Details view .
Working with keys 78 Dat aWindow .NET Defining foreign k eys I f your DBMS supports foreign k eys, you can define t hem in Data W indow Designer . ❖ T o create a foreign key: 1 Do one of the follo wing: • Highlight the table and click the Create For eign Key drop-down toolbar button in Painter Bar1 .
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 79 Modi fyi ng key s Y ou can modify a pri mary key in D ataW indow D esigner. ❖ T o modify a primary key: 1 Do one of t he following: • Highlight the primary k ey listed in the table’ s expanded tree view and click the Properties butto n.
Working with indexes 80 Dat aWindow .NET Creati ng an ind ex In Adaptive Server Anywhere dat abases In Adapt ive Server Anyw here databa ses, you sho uld not d efine an index on a column that is defined as a foreign key , because for eign keys are alread y optimized for quick reference.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 81 2 In the Object Details view , select or deselect column s as needed. 3 Right-click on t he Object Detail s view and s elect Sa ve Chan ges from t he pop- up me nu . Any changes you made in the view are immediately sav ed to the table definitio n.
Working with database views 82 Dat aWindow .NET Y ou de fine, op en, an d mani pulate databa se vie ws in the V iew pa inter, which is similar to the Select p ainter . For more informatio n about the Select painter, see “Selecting a data source” on page 110.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 83 For information, see the section on using the SQL Select painter in “Selecting a data source” on page 1 10. The V iew painter and the SQL Select painter are similar . 6 When you h ave completed t he view , click the Return button.
Working with database views 84 Dat aWindow .NET The completed SELECT statement used to create the datab ase view displ ays i n the D e finit ion fi eld on the Gen eral page: V iew dialog box is read-o nly Y ou cannot alter the view definition in the Object Details view .
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 85 3 T o create a join other than the equality join, click the joi n representation in the workspace. The Join di alog box di splays: 4 Select the join operator you wan t from the Join dialog b ox.
Manipulating data 86 Dat aWindow .NET Manipulating d at a As you w ork on the dat abas e, y ou often wa nt to look at exi s tin g d at a or creat e some dat a for tes ting purpos es. Y ou might also wa nt to test displa y formats, validation rules, and edit styles on real data.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 87 This window is in the grid format: Only a few rows of data display at a tim e. Y ou can use the First, Prior , Next, and L ast bu ttons to move from p age to page. Modifying data Y ou can add, mo dify , o r delete rows.
Manipulating data 88 Dat aWindow .NET Sorting rows Y ou can sort the data, but any sort criteria you define are fo r testing only and are not saved with the table or passed to the DataW indow painter . ❖ T o sort th e rows: 1 Select Rows > Sor t from th e menu ba r .
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 89 5 Click OK to return to the S pecify Sort C olum n s dialog box with the expressi on displa yed. If you chang e your mind Y ou can remove a column or exp ressio n from the sorting specification by simply dragging it an d releasing it outside the Columns box.
Manipulating data 90 Dat aWindow .NET ❖ T o remov e the filter: 1 Select Rows>Filter from the menu bar . The Specify Filter dialog box displays, showin g the current filter . 2 Delete the filter expression, then click OK. Filtered row s and up dates Filtered rows are updated when you update the databas e.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 91 2 Specify the fi le from wh ich you want t o import t he data. The types of files y ou can import into the painter are show n in the Files of T ype drop-down list. 3 Click Open.
Creating and executing SQL stateme nts 92 Dat aWindow .NET 2 Choose a format for t he file. Y ou can select from several fo rmats, includ ing Power soft report (P SR), XML, and HTML. If you wan t the column headers saved in the f ile, select a file format that includes headers, s uch as Excel W ith Headers.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 93 Creating stored proced ures Y ou can use the In teractive SQL view to create stored proced ures or triggers , but make sure .
Creating and executing SQL stateme nts 94 Dat aWindow .NET 2 Double-click the approp riate icon to select the statement type . The Select T able dialog box display s. 3 Select the table(s) you will referen ce in the SQL statement. Y ou go to the Select, Insert, Update, or Delete painter , depending on the type of SQL statement you are p asting.
CHAPTER 3 Managing the Database Data Win dow De si gne r User’s Gu ide 95 Sybase Adaptive Serve r Enterprise stored proce dures When you use the Database painter to execute a Sybase Adaptive Server Enterprise system s tored procedur e, you must start th e syntax with the keyword EXEC or EXECUTE .
Controlling access to the current database 96 Dat aWindow .NET Setting Sc ript and Font properties Select Design>Options from the menu bar to open the Database Prefer ences dialog box. Th e Script and Font properties are the same as those y ou can set for the file editor .
PA R T 2 Dat aWindows This part in troduces you to the many styles of DataWindows available i n DataWindow D esigner and describe s how to create and work with them.
.
Data Win dow De si gne r User’s Gu ide 99 CHAPTER 4 Defining Dat aW indow Objects About thi s chapter This c hapter describes h ow t o defin e DataW indow object s to di s play an d manipulate data.
About DataWindow ob jects 100 Dat aWindow .NET Dat aWindow object examples Y o u can display the data in the format th at best pres ents the data to you r u ser s.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 101 Choosing a present a tion style The presentation style you select fo r a DataW indow object determines the format Dat aW indow Des igner uses to display t he DataW indow object i n the Design view .
Choosing a presentation style 102 Dat aWindow .NET Using the T abular style The T abular presentation style pr esents data with the data column s going across the pag e and headers abov e each column. As many rows from the database will disp lay at one time as can fit in the DataWindow object.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 103 Using the Grid style The Grid presentation s tyle shows data in row-and-column f ormat with g rid lines separating r ows and col umns. W ith other styles, you can move text , values, and o ther objects ar ound freel y in designing the report.
Choosing a presentation style 104 Dat aWindow .NET Maili ng labels Busi ness ca rds Name tags S pecif ying l abel properti es If you ch oose the Label style, y ou are asked to sp ecify the properties for the label after specifying the data source.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 105 Using the N-Up style The N-Up style presents two or more rows of d ata next to each other . It is similar to the Label style in that you can have inform ation from several rows in the database across the pag e.
Choosing a presentation style 106 Dat aWindow .NET Here is the DataW indow object in the Preview view: Another wa y to get multip le-column Dat aWindow objects In an n-up D ata W indow object, the dat a is dis pl ayed acros s an d t hen d own.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 107 For more about th e Group presentation st yle, see Chapter 9, “ Filtering, Sorting, and Group ing Row s .” Using the Composite style The Composite presentatio n style allows you to combine multiple DataW indow objects in t he sam e objec t.
Choosing a presentation style 108 Dat aWindow .NET Using the Graph and Cross t ab styles In addition to the (p receding) text-based presentation styles , DataWi ndow Designer provides t wo styles that allow y ou to displ ay inform ation graphicall y: Graph and C rosstab.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 109 This T reeV iew style report groups by manager ID an d state and lists empl oyee informati on and salari es : For more about th e T reeV iew presentation style, see Chapter 13, “W or king with TreeV i ew s.
Selecting a data s ource 11 0 DataW indow .NET ❖ T o crea te a new Dat aWindow object: 1 Select File>New from the menu ba r and select the DataW indow tab. 2 Choose a pr esentation style for the DataW indow object. The presen tation styl e determines how the data is displayed.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 111 If the dat a is in the dat abase If the data for t he DataW indow obj ect will be retrieved from a database, choose o.
Using Quick Sel ect 11 2 DataW indow .NET Using Quick Select The easiest way to def ine a data source is us ing Quick Select. ❖ T o defin e the dat a using Quick Select: 1 Click Quick Select in the Choose Data Source dialo g box in the wizard and click Next .
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 11 3 Selecting a table When you choos e Quick Select, the Quick Select dialog box displays.
Using Quick Sel ect 11 4 DataW indow .NET Meanin g of the up and down arrows An arrow displays next to a table to indicate its relationship to the selected table.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 11 5 As you sel ect col umns, they di spl ay in t he grid at the bo ttom of the dialog box in the order in which you select them.
Using Quick Sel ect 11 6 DataW indow .NET As you specify s election criteria, DataW indow Desig ner builds a WHERE clause for the SELECT statement. ❖ T o specify selection criteria: 1 Click the Criteria row below the first column for which you want to select the data to retrieve.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 11 7 Compar ison o perators Y ou can use the LIKE , NOT LIKE , IN , and NOT IN oper ators to compare expression s. Use LIKE to search for strings that match a predetermined pattern.
Using Quick Sel ect 11 8 DataW indow .NET SQL expression examples The first six examples in this section a ll refer to a grid that contains three columns: EmpId , DeptId , a n d Sala ry .
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 11 9 Exam ple 4 The expr essions 100 in the Criteria row and >3 00 in the Or row for the DeptId column, together with .
Using Quick Sel ect 120 Dat aWindow .NET The SELECT statement that DataW indow Designer creates is: SELECT emp_id, dept_id, salary FROM employee WHERE (emp_id >= 500 AND emp_id <= 1000) AND (sal.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 121 Using SQL Select In specif ying data fo r a DataW indow object, you have mor e options for specifying complex SQL st atements when you use SQL Select as the data source.
Using SQL Select 122 Dat aWindow .NET 6 Limit the retrieved row s with WHE RE , ORDER BY , GR OUP BY , and HA VING criteria, if appropriate. For mor e informati on, see “Specifying selecti on, sort ing, and grouping criteria” o n page 130. 7 If you wan t to eliminate duplicate ro ws, select Distinct f rom the Design menu.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 123 Below the T able Layout v iew , severa l tabbed views also disp lay by defa ult. Y ou use th e views (fo r example, Co mpute, Havi ng, Group) to spec ify the SQL Select statement in mor e detail.
Using SQL Select 124 Dat aWindow .NET Selecting columns Y ou can click each column y ou want to include fro m th e table r epres entation s in the T able Layout view . DataW indow Designer highlights selected columns and places them in th e Selection List at the top of the Select painter .
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 125 3 Press the T ab key to get to the next row to define another computed column, or click another tab to make addition al specifications. DataW i nd ow Desig ner adds the comp ut ed columns to th e list of columns you have s elected.
Using SQL Select 126 Dat aWindow .NET ❖ T o edit the SELECT st atement: 1 Select Design > Convert to Syntax fro m the menu bar . DataW indow Designer displays the SELEC T statement in a text window .
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 127 The Join di alog box di splays: 4 Select the join operator you want and click OK. If your DBMS sup por ts o uter joins, outer join options als o disp lay in the Join dial og box.
Using SQL Select 128 Dat aWindow .NET The order o f evaluation f or ANSI syn tax nested out er joins is determined by the or der of t he ON search conditio ns.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 129 Equivalent s tatem ent s The syntax ge nerated when you select table A then table B and create a left outer join i s equivalent to the synt ax generate d when you sel ect table B then table A and create a right outer join.
Using SQL Select 130 Dat aWindow .NET ❖ T o defin e retrieva l argumen ts: 1 In the Select painter , select Design > Re trieva l Argum ents fr om t he menu bar . 2 Enter a name and select a datatype for each arg ument. Y ou can enter any valid SQL iden tifier for the ar gument name.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 131 Dynamically selecting, sorting, an d grouping dat a Selection , sorting, and g rouping c riteria that you define in the Select painter are added to the SQL statement and processed by the DBMS as part of the retrieval.
Using SQL Select 132 Dat aWindow .NET For example, if you ar e retrieving information about emp loyees, you can limit the employees to tho se in Sales and Marketing, or to those in Sales and Marketing who make mo re than $50,00 0.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 133 For each additional exp ression, select a logical operator ( AND or OR ) to connect the multiple boolean ex pre ssion s into one e xpressi on that DataW indow Designer evaluates as true or false to limi t the rows that are retrieved.
Using SQL Select 134 Dat aWindow .NET 4 Define li miting (Where vi ew), grouping (Group vi ew), and limit ing groups (Having view) criteria as appropria te.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 135 3 Continue to specify ad ditional colum ns for groupin g within the f irst grouping co lumn as needed. T o change the grouping o rder , drag the column na mes in the rig ht side to the positions you want.
Using Query 136 Dat aWindow .NET Using Query When you cho ose Query as the data s ource, you select a predef ined SQL SELECT s tatement (a query) as specifying the data for your DataW indow object. ❖ T o de fine the da ta us ing Q uery : 1 While using any of the DataW indow wizards, click Query in the Choose Data Source dialog box.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 137 What you do next In a script, you need to tell DataW indow Designer how to get data into the DataW indow objec t in your applicati on.
Using Stored Procedure 138 Dat aWindow .NET • T o build the result set descr ip tio n automatically , clear the Manual Resul t Set check b ox and clic k Next. DataW indow Designer executes the stored procedure and build s the resu lt set de scriptio n for you.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 139 The syntax is: execute sp_procname ; num arg1 = : arg1 , arg2 = : arg2 ..., argn =: arg n where sp_procnam e is the name of t he stored procedure, num is the stored procedure gr oup suf fix, and arg1 , arg2 , and ar gn are the stored procedure’ s arguments.
Using ADO DataSet 140 Dat aWindow .NET 2 Select the XSD file you want to us e to access the data. 3 Select one DataT able that you will use as the data source for the DataW indow object. 4 Complete the DataW indow wizard as n eeded for the presentation style you are using.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 141 Default s for strin g an d decimal dat atypes The System.String type does not always specify a maximum length. The length of string columns defaults t o 40 characters in the DataW i ndows.
Generating and saving a DataWindo w object 142 Dat aWindow .NET 4 Change on e or more of the follow ing propert ies: 5 Click OK. About color s elections If you s elect W i ndow Background, A pplicatio.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 143 About the extended at tribute system tables and Dat aWindow objects The extended attribute system tables are a set of tables maintained b y the Database pai nter . They co ntain infor mation abo ut databas e tables an d columns.
Generating and saving a DataWindo w object 144 Dat aWindow .NET Saving the DataWindow object When you have created a D ataW indow o bject, you shou ld save it. T he first time you save it you give it a name. As you work, yo u should sa ve your DataW indow object f requentl y so that you do not lo se change s.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 145 3 Select the object you want. DataW indow Designer opens the Da taW indow p ainter and di splays the DataW indow object. Y ou can also open a DataW indow object by do uble- clicking it in the Sys tem T ree.
Defining queries 146 Dat aWindow .NET Previewing the query While creating a query , you can preview it to m ake sur e it is retrieving the correct rows and columns.
CHAPTER 4 Defining DataWindow Objects Data Win dow De si gne r User’s Gu ide 147 Naming th e query The query name can be any valid DataW ind ow Designer identifier up to 40 characters.
What's next 148 Dat aWindow .NET.
Data Win dow De si gne r User’s Gu ide 149 CHAPTER 5 Enhancing DataW in dow Objects About thi s chapter Before you put a Da taW indow object i nto pro duction , you can enhance it to make it easier to use and interpret data. Y o u do that in the DataW indow painter.
Working in the DataWindow painter 150 Dat aWindow .NET W orking in th e Dat aWindow p ainter The DataW i ndow painter provides views related to the DataWindow o bject you are working on. Interacting with these vi ews is how you work in the DataW indow painter.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 151 Preview vi ew The Preview view in the middle o n the le ft shows the DataW indow o bject with data as it will appear at runtime. If the Print Preview tog gle is selected, you see the DataW i ndow object as it would appear when printed.
Working in the DataWindow painter 152 Dat aWindow .NET Underst anding the DataW indow painter Design view For m ost pr esentation s tyles, th e DataW indow pain ter Desi gn view is divid ed into areas called ba nds. Each band co rresponds to a section of the displayed DataW indow object.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 153 The header band The header band contains heading inform ation that is displayed at the top of every screen or p age.
Working in the DataWindow painter 154 Dat aWindow .NET How Da t aWindow Designer names the c olumns in th e Design view If the DataW indow object uses one table, the names of the column s in the Design view are th e same as the names in the table.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 155 T able 5- 2: Drop-down toolbars in the DataW indow pain ter S tyl eBar The S tyleBar includes bu ttons for apply ing properties (s uch as bold) to selected text elements.
Working in the DataWindow painter 156 Dat aWindow .NET Selecting controls in the D at aWindow p ainter The DataW i ndow painter provides several ways to select controls to act o n. Y ou can select multiple controls and act on all the selected controls as a unit.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 157 ❖ T o selec t controls by p osition in the Dat aWindow object: • Do one of the followi ng: • Select Edit>Se.
Using the Preview view of a DataWi ndow object 158 Dat aWindow .NET ❖ T o zoo m the displa y in the Dat aWindow p ainter: 1 Select the view you want to zoom (click in the view). Y ou can zoom the Design view , Preview view , Data V iew , and Column Specifications view .
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 159 As the rows are being retrieve d, the Retr ieve button in the PainterBar changes to a Cancel bu tton. Y ou can click the Cancel button to sto p the retrieval. 2 T est your DataW indow object.
Using the Preview view of a DataWi ndow object 160 Dat aWindow .NET Dat aWindow Designer uses data cac hing Wh en DataW indow Desi gner first retrieves data, it stores th e data in ter nally . When it refreshes the Preview view , DataW indow Designer displays the stored data ins tead of retrieving rows from the databas e again.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 161 • Retrieve R ows to D isk Lets you speci fy that DataW indow Desi gner should save retrieved dat a on your har d disk in a tempor ary file rather than keep the data in memo ry .
Using the Preview view of a DataWi ndow object 162 Dat aWindow .NET T o save t he changes to the d atabase, you must appl y them, as des cribed be low . ❖ T o apply chang es to the dat abase: • Click the Update Database button. DataW indow Design er updates t he table with all the changes yo u have made .
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 163 Importing data into a Dat aWindow object Y ou can impor t and display data fro m an external source and save the imported data in the database. ❖ T o import dat a into a Dat aWindo w object: 1 Select Rows>Imp ort from the menu bar .
Using the Preview view of a DataWi ndow object 164 Dat aWindow .NET Contro lling the di splay of rulers Y ou can choose whet her to displa y rulers ar ound page bo rders. ❖ T o contro l the display of rul ers in Print Previe w: • Select/deselect File>Print Preview Rulers from th e menu bar .
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 165 The contents of the page zooms in or out as appropriate. If you enlar ge the contents so they no longer fit, DataWindow Designer creates additional pages as nee ded. Printing data Y ou can print a DataW in dow object while the Preview view is displayed.
Using the Preview view of a DataWi ndow object 166 Dat aWindow .NET 6 If you want to change the collating option, clear or select the Collate Copies check bo x and click OK. If you specified print to file, the Print to File d ialog box displays. 7 Enter a file name an d click OK.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 167 2 Drag the mouse lef t or right to mov e the column. 3 Release the mouse button.
Saving data in an external fil e 168 Dat aWindow .NET Saving data in an external file While previewin g, you can save the data retr ieved in an external file. Note th at the data and hea ders (if specified) are sav ed. Information in the f ooter or summary bands is not save d unless you are s aving as P DF or as a PSR fi le.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 169 DataW indow Designer uses a Po stScript p rinter d river speci fically designed for distilling purpo ses to conf ig ure th e PDF o utpu t.
Saving data in an external fil e 170 Dat aWindow .NET About the result s Some presentatio n styles translate bette r into HTML than others. The T ab ular , Group , Freeform, Cro sstab, and Grid presen tation st yles produ ce good resu lts.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 171 Figure 5-1: PSR fi le About reports A report is the same as a no nupdatab le DataW indow object. Fo r more informati on, see “Reports versus DataWindow objects” on page 100.
Modifying general DataWindow object properties 172 Dat aWindow .NET ❖ T o change the defau lt style proper ti es: 1 Positi on the pointer i n the backgroun d of the DataW indow object, d isplay the pop -up menu, and s elect Proper ties. The Prop erties view displays wi th the General page on top.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 173 ❖ T o set the color of a ban d in a Dat a Window object: 1 Position the mouse pointer on the ba r that represents the band, d isplay the pop-up men u, then s elect Proper ties.
Modifying general DataWindow object properties 174 Dat aWindow .NET Specifying pointers for a DataW indow object Just as with colors, you can specify dif ferent pointers to use when the mouse is over a par t icular area of the DataW indow object.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 175 3 Select the Print Specifications tab. The Print Specifications pag e uses the units of measure you specified o n the General page. 4 Specify print specifications fo r the current DataW indow object.
Modifying general DataWindow object properties 176 Dat aWindow .NET Printing with newsp aper-style columns When you define a DataWindow object, you can specify that it print in multiple columns acr oss the page, like a new spaper .
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 177 4 Specify the number of columns acro ss the page and the width of column s in the News paper Column s Acros s and Newspaper Columns W idth properties.
Modifying general DataWindow object properties 178 Dat aWindow .NET The finis hed DataW indow obj ect has one s et of page heading informat ion and two columns of column header and detail informatio n.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 179 ❖ T o change the text properties for a text control in a Dat aWindow object: 1 Select the text control. 2 Do one of t he following: • Change the t ext proper ties in the S tyleBar .
Modifying general DataWindow object properties 180 Dat aWindow .NET ❖ T o change the t a b order: 1 Select Format>T ab Order from the menu bar or click the T ab Order button on PainterBar2. The cu rren t tab or der di splays . 2 Use the mouse or t he T ab key to move the po inter to the tab value yo u want to change.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 181 ❖ T o specif y prefixes for naming c ontrols sy stematically in a Dat aWindow object: 1 Select Design>Options from the menu ba r and then select the Prefixes tab.
Modifying general DataWindow object properties 182 Dat aWindow .NET Specifying variable-height bands in a DataWindow object Sometimes DataW indow objects contain columns whose data is of var iable length. For exam ple, a Memo column in a table might be a character column that can take up to several thousand ch aracters.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 183 Y ou should not u se an expression whose ru ntime value is greater than the value returned by RowHeight . For example, you shoul d not set t he height o f a column to rowh eight( ) + 30 .
Modifying general DataWindow object properties 184 Dat aWindow .NET Some chan ges you make (such as addi ng or remov ing column s) requir e DataW in dow Designer to modify the update capabilities of the DataW indow object.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 185 If the dat a so urce is a stored pro cedure If you are mo difying the result set for a DataW indow object whose data source is a stored proced ure, the pop-u p menu for the Column Specif ication view contains the menu item S tored Proce dure.
Storing data in a DataWindow object using the Data v iew 186 Dat aWindow .NET 2 Do a n y of the foll ow ing: • Click the Insert Row button in the PainterBar to create an empty row and type a row of data .
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 187 What happens at runti me Data stored in a DataWindow object is stored within the actu al object itself, so when a window op ens showi ng s uch a DataW indow , the data is already t her e.
Retrieving data 188 Dat aWindow .NET T esting in Dat aWindow Des igner Y ou can test the pr ompting fo r criteria b y retrie ving data in t he Previe w view of the DataW indow ob ject.
CHAPTER 5 Enhancing DataWindow Objects Data Win dow De si gne r User’s Gu ide 189 For example, if a DataW indow object displays on ly 10 rows at a time, DataW indow Designer only needs t o retrieve 1 0 or more ro ws before presenting the data.
Retrieving data 190 Dat aWindow .NET.
Data Win dow De si gne r User’s Gu ide 191 CHAPTER 6 Controlling Up dates in Dat aW indow Objects About thi s chapter When DataW indow Designer generates the basic DataW indow object, it defines w hether the data is updatable. This chapter des cribes the defaul t settings and how you can modify them.
About controlling updates 192 Dat aWindow .NET If using a Store d Procedure or External dat a source If the data s ource is S tored Procedure or External, you can us e the FindNextMod iedRow method to write your own up date code.
CHAPTER 6 Controlling Updates in DataWindow Ob jects Data Win dow De si gne r User’s Gu ide 193 Changi ng tab value s DataW indow Desi gner does no t chan ge th e tab values associated with colum ns after you chang e the update characteristics o f the DataW indow object.
Specifying an identi ty column 194 Dat aWindow .NET S pecifying an identity column Many DBMSs allow you to specif y that th e value for a column in a new row is to be automatically assigned by the DBMS. This kind of column is called an identity column.
CHAPTER 6 Controlling Updates in DataWindow Ob jects Data Win dow De si gne r User’s Gu ide 195 Specifying the WHERE clause for up date/delete Sometimes multiple users are accessing the same tables at the same time. In these situations , you need to decide wh en to allo w you r application to update the database.
Specifying the WHERE claus e for update/delete 196 Dat aWindow .NET T able 6-1: Specifyin g the WHERE clau se for UPDA TE and DELETE Exampl e Consider this situ atio n: a DataW indo w object is updating the Empl oyee tab le , whose key is Emp_ID ; all columns in the table are updatable.
CHAPTER 6 Controlling Updates in DataWindow Ob jects Data Win dow De si gne r User’s Gu ide 197 This statement will succeed r egar dless of whether ot her users have modified the row since your application r etrieved the r ow .
Using stored procedures to update the database 198 Dat aWindow .NET How to choose a setti ng Consider the followin g when choosing the Key Modification setting: • If multiple rows are changed, DE LETE and INSERT always work.
CHAPTER 6 Controlling Updates in DataWindow Ob jects Data Win dow De si gne r User’s Gu ide 199 ❖ T o use st ored proced ures to up date the dat abase 1 In the DataWin dow painter, select Rows>Stored Procedure Update to display th e Stored Procedure Up date dialog bo x.
Using stored procedures to update the database 200 Dat aWindow .NET If a stored procedure fo r a particul ar SQL update m ethod is not def ined, the DataW indow contr ol s ubm its the appropr iate S QL s yn tax i n th e sa me man ner it always has.
Data Win dow De si gne r User’s Gu ide 201 CHAPTER 7 W orking with Controls in Dat aW indow Objects About thi s chapter One of the ways you can enhance a DataW indow object is to add contro ls, such as colum ns, d rawing o bjects, b uttons, and computed fields.
Adding controls to a DataWindow object 202 Dat aWindow .NET Adding colu mns not previ ously retrieved to the dat a source T o specify that yo u want to retrieve a colu mn not previously r etrieved (that is, add a col umn to the data s ource), you m ust modify the data sour ce.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 203 Adding drawing contro ls to a DataW indow object Y ou can add th e following drawing cont rols to a D.
Adding controls to a DataWindow object 204 Dat aWindow .NET ❖ T o add a group box to a Dat aWind ow object: 1 Select Insert>Con trol>Group Box from the menu bar and click in the Design vi ew . 2 W ith the group box selected, type the text to display i n the frame.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 205 T o compute a picture name at runtime, us e the Bitmap fu nction in the expression defin ing a computed field . If you chan ge the bitm ap in the Picture control in a DataW indow object, you need to reset the original size property .
Adding controls to a DataWindow object 206 Dat aWindow .NET • In the DataW indow painter, you can def ine computed fields afte r you have defin ed the SELECT statement (or other data source) .
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 207 In this scenario, if the user changes the price of a part in th e DataW indow object, the cost chan ges immediately .
Adding controls to a DataWindow object 208 Dat aWindow .NET Dat aWindow expressions Y ou are entering a DataW indow expression, not a SQL expression pro cessed by the DBMS, so the expression follo ws th e rules for DataW in dow expre ssions. Referri ng to next an d previ ous rows Y ou can refer to o ther rows i n a computed field.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 209 ❖ T o summarize va lues: 1 Select one or more columns in th e DataW indow object’ s detail band. 2 Select Insert>Control from the men u bar . 3 Select one of the options at the bo ttom of the cascading menu: A verage, Count, o r Sum.
Adding controls to a DataWindow object 210 Dat aWindow .NET 4 Click the Function button. The Functi on For T oolbar dial og box dis plays. 5 Select a function and click OK. Y ou return to the T oolbar It em Command d ialog box. 6 Specify text and microhelp that display s for the butto n, an d click OK.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 21 1 5 Select the acti on you want t o assign to th e button from the Action drop-dow n list. For inf ormation about actions, see “Actions assignabl e to buttons in DataW indow objects” on pa ge 211.
Adding controls to a DataWindow object 212 Dat aWindow .NET T able 7-2: Button acti ons for DataW indow objects Action Effect V alue A ction return code User Defined (default) Allows the dev eloper to pr ogram t he ButtonCl icke d eve nt with no interve n ing action o ccurring.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 213 Adding graphs to a Da t aWindow object Graphs are one of the best ways to p res ent information.
Reorganizing controls in a DataWindow objec t 214 Dat aWindow .NET The InkPicture control is fully functional on T ablet PCs . If the Microsoft T ablet PC So ftware Develo pment Kit ( SDK) 1.7 is i nstalled on other com puters, InkPicture contro ls in DataW indow objects can accept ink inp ut from the mouse.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 215 Displaying boundarie s for controls in a DataWindow object When reorganizing controls in the Design view , i t is sometimes hel pful to see how lar ge all the controls are.
Reorganizing controls in a DataWindow objec t 216 Dat aWindow .NET Deleting controls in a DataWindow object ❖ T o dele te controls in a Dat aWindow object: 1 Select the controls you wan t to delete. 2 Select Edit>Delete from the menu bar or press the Delete key .
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 217 • T o copy the contro l to anot her DataW indow ob ject, open th e desired DataW indow object and pas te the control. DataW indow Designer pastes the con trol at th e sam e locat ion as in the source Data W indow obj ect.
Reorganizing controls in a DataWindow objec t 218 Dat aWindow .NET Aligning controls in a DataWindow object Often yo u want to al ign several controls or ma ke them all the same size. Y ou can use the grid to align the contr ols or you can have DataW indow Designer align them f or you.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 219 Equalizing the size o f controls in a DataWindow object Suppos e you have sev eral control s in a DataW indow ob ject and want their sizes to be the same.
Reorganizing controls in a DataWindow objec t 220 Dat aWindow .NET 2 Select the Slide options you wan t: These options are also available on PainterBar2.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 221 Positioning controls in a D at aWindow ob ject T able 7- 3 shows the properties fo r each control in a DataW indow object that determine how it is positio ned with in the DataW indow object.
Rotating controls in a DataWindow object 222 Dat aWindow .NET Rot ating controls in a Dat aWindow objec t Cont rols that displ ay t ext s uch a s tex t controls, column s, and computed fields can be rotated from the original baselin e of the text.
CHAPTER 7 Working with Controls in DataWindow Objects Data Win dow De si gne r User’s Gu ide 223 The origin of rotatio n is the center of the top bor der of the box containing the text. It is often helpful to use left-aligned text (General property page>Alignment>Left) because it makes it easier to position the control correctly .
Rotating controls in a DataWindow object 224 Dat aWindow .NET If you are using a conditional e xpression for rot ation If you ar e specifying dif ferent rotati ons dependi ng on parti cular condi tion.
Data Win dow De si gne r User’s Gu ide 225 CHAPTER 8 Displaying and V alidating Data About thi s chapter This chapt er describ es how to customize your DataW indow object by modifying the dis play val ues in columns and specifying valid ation rules.
About display ing and validating data 226 Dat aWindow .NET Presenting the data When you generate a n ew DataW indow object, Da taW indow De signer presents the d ata according to the p roper ties already defined for a column, such as a column's display for mat and edit style.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 227 V alidating data When data is entered in the Database pain ter or in a DataW indow object, DataW indow Designer evaluates the d ata against val idation ru les defined for that column.
Working with dis play formats 228 Dat aWindow .NET W orking with display formats Y o u work with display formats in the Database painter and the Dat aW indow painter.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 229 Edi t styl e takes pre ceden ce If a column has an associated edit st yle, the edit style takes precedence over a display form at unless you use an EditMas k edit s tyle and check the Use Format box on the F ormat property page.
Working with dis play formats 230 Dat aWindow .NET ❖ T o remov e a display form at from a colum n in the Dat a base pa inter: 1 In the Databa se painter Objects view , position the p ointer on the colum n, select Properties from the pop-up m enu, and select th e Display tab in the Properties view .
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 231 Shortcut s T o assign the Currency or Percent disp lay form at to a numeric column in a report, select the column, then click the Currency or Percent button in the PainterBar or select Form at>Currency or Format>Percent from the men u bar .
Defining display formats 232 Dat aWindow .NET Usin g keywords Enclose display form at keywords in square brackets. For example, yo u can use the keywo rd [Genera l] when yo u want Dat aW indow Designer to d etermine the appropriate f ormat for a number .
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 233 Using spe ci al chara cters T o include a character in a mas k that has special meaning in a display format, such as [, precede the character with a b ackslash (). For example, to display a single quotation mark, enter '.
Defining display formats 234 Dat aWindow .NET Numb er and curr ency setti ngs T o ensure that an ap plication behaves the same in ev ery country where it is deployed, DataW indow expression s and the masks used in display formats and edit masks requ ire U.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 235 String display formats Stri ng display form ats can have two sect ions.
Defining display formats 236 Dat aWindow .NET T able 8-4: Charac ters with sp ecial m eaning in da ta display fo rmats Colons, slashes , and spaces display as en tered in the mask.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 237 T able 8- 5: Date displa y format exam ples Time display format s T ime di splay fo rmats can hav e two se ctio ns.
About edit styles 238 Dat aWindow .NET Ti m e k e y w o r d Y ou can use t he following keyword as a time disp lay format to specify th e format specified in th e W indows control p anel: • [T ime] Exampl es T able 8-7 shows how t he time 9:45: 33:234567 PM displ ays when dif ferent format masks ar e applied.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 239 Edit styl es T able 8- 8 shows the available ed it styles. T able 8- 8: Edit styles For exampl e, suppose yo u have a colum n S tatus that takes one of three values: the letters A, T , and L, each repr esenting a status (Active, T erminated, or On Leave).
Working with edit styl es 240 Dat aWindow .NET W orking with edit styles Y ou work with edit styles in the Database painter and DataWindow painter. What you do i n the Databa se paint er In the Database painter , you can: • Create, modify , and delete named edit s tyles The edit styles are s tored in the exte nded attribut e system tables.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 241 ❖ T o create a new edit styl e: 1 In the Database painter, select Ob ject>Ins ert>Edit S tyle from the menu bar . 2 In the Edit Styl e dialog box, s elect the edit style type fr om the S tyle drop- down list.
Defining edit styles 242 Dat aWindow .NET Working with edit styles in the DataWindow p ainter An edit style you assign to a col umn in the Database painter is used by def ault when you place the column in a DataW i ndow object.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 243 • T o allow users to tab to the column but not change the value, check the Disp lay On l y box.
Defining edit styles 244 Dat aWindow .NET In the preced ing example, when user s see the value Business Serv ices, the correspo nding data v alue could be 200. ❖ T o us e t he Dr opDown ListB ox ed it sty le: 1 Select Drop DownListBox from the S tyle T ype box.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 245 What happ ens The value you en ter in the T ext box becomes the display v alue, and values entered for On, Off, and Other b ecome the data values.
Defining edit styles 246 Dat aWindow .NET The EditMask edit style Sometimes users need to enter data that has a fixed format. For example, in North America pho ne numbers have a 3-digit area code, f ollowed by three digit s, followed by four di gits.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 247 Also, no te certai n behavior in Date edit m asks: • Entering zero for the day or mo nth causes the next valid date to be entered. For example, if the edit mask is DD/MM/YY , typing 00/11/ 01 results i n 01/11/ 01 .
Defining edit styles 248 Dat aWindow .NET Usin g spin contro ls Y ou can define an e dit mask as a spin control, a box that contains up and down arrows that users can clic k to cycle throug h fixed values. For example, you can set up a code table that provides the val id entr ies in a column; users simply click an arrow to select an entry .
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 249 T o conserve b andwidth, J avaScript f or client form atting is not included by default. T o include this s c ript , yo u can s el ect th e Clie nt Fo rmatting ch eck bo x on the W eb Generati on tab of t he DataW indow Proper ties view .
Defining edit styles 250 Dat aWindow .NET 2 For the column getting its data from the DataWindow object, select the DropDow nDW edit s tyle. In the example, y ou wo uld specify the Dro pDownDataW in do.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 251 Limit on siz e of dat a value The data value for a column that uses the DropDownDataWind ow edit style is limited to 51 1 characters.
Defining a code table 252 Dat aWindow .NET How code tables are implemented Y ou can define a code table as a property of the following column edit st yles: Edit DropDow nListB ox RadioB uttons DropDow.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 253 ❖ T o define a code t able as a proper ty of the DropDo wnDataW indow ed it style: 1 Specify the colu mn that provides the di splay values in the Disp lay Column box.
Defining a code table 254 Dat aWindow .NET If the code table is in a DropDownListBox edit sty le, and if the colu mn has a code table that contains duplicate displa y values, then each value displays only once.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 255 About valid ation rules When users enter d ata in a DataW indow object, you want to be sure the data is valid befor e using it to updat e the databas e. V alidation rules provide one way to do this.
Working with validation rules 256 Dat aWindow .NET At runtime In code, y ou can use the GetColumnV alidation method to obtain the validation rule for a column and the S etColumnV alidation method to change t he validation rule for a co lumn. For information abo ut the Get ColumnV a lidation and Set Colu mnV alid atio n methods, see the online help.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 257 Defining validati on rules T ypically , you define validation rules in the Database pa inter , because validation rules are properties of the data itself.
Defining validation rules 258 Dat aWindow .NET ❖ T o modi fy a validat ion rule: 1 In the Database painter , open the Extended Attributes view . 2 In the Extended Attributes view , open th e list of validation rules. 3 Position the p ointer on the validatio n rule you want to m odify , d isplay the pop-up menu, and sel ect Propertie s.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 259 For information about these fun ctio ns, see the DataW indow Object Refer ence. Use the notation @placeholder (where pl aceholde r is any gr oup of characte rs) to indicate the current co lumn in the rule.
Defining validation rules 260 Dat aWindow .NET Customizing the err or mes sage When you define a va lidation rul e, DataW indow Designer aut omatically creates the error mes sage that displays by default when users enter an invalid value : 'Item ~'' + @ Col + '~' does not pass validation test.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 261 ❖ T o specif y a validati on rule for a column in the Dat aWindow p ainter: 1 In the Data W ind ow pa inter , select V iew>Column Specifications from the menu bar .
Defining validation rules 262 Dat aWindow .NET GetT ext returns a string. Be sure to use a data conv ersion function (s uch as Integer or Real ) if you want to compare t he entered val ue with a datatype other than st ring. For more on the GetT ext function and text patterns, see the Data W indow Object Refer ence.
CHAPTER 8 Displaying and Validati ng Data Data Win dow De si gne r User’s Gu ide 263 The Sal es table has t wo column s, Price and Commission . The validation rule for the Commis sion column is: (Number(GetText( )) >= If(price >= 1000, .10, .04)) AND (Number(GetText( )) <= If(price >= 1000, .
How to maintain extended attributes 264 Dat aWindow .NET.
Data Win dow De si gne r User’s Gu ide 265 CHAPTER 9 Filtering, Sorting, and Grouping Rows About thi s chapter This chapter d escribes how you can customize you r DataW i ndow object by doing the fo.
Filtering rows 266 Dat aWindow .NET Usin g filters In the DataW indow painter , you can define filters to limit th e rows that display at runtime. Filters can use most DataWin dow express ion functio ns . Filters do not affect which ro ws are retrieved A filter operates against th e retrieved data.
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 267 3 (Optional) Click V erify to make sure the expression is valid.
Sorting rows 268 Dat aWindow .NET Howeve r , you mi ght want to sort the rows after they are re trieved. For ex ample, you might wan t to: • Offload the processing from the DBMS • Sort on an expre.
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 269 Suppressin g repeating values When you sor t on a column, ther e might be several r ows with the same value in one column. Y ou can choose to suppre ss the repeating values i n that column.
Grouping rows 270 Dat aWindow .NET If you change you r mind Y ou can remove a column from the su ppress ion li st simpl y by dr agging i t and re leasing it out side the Suppress ion List b ox. Groupin g rows Y ou can group related rows together and, optionally , calculate stat istics for each group separately .
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 271 The followi ng screenshot shows the DataW indow object. How to do it Y ou can create a gr ouped DataW indow.
Grouping rows 272 Dat aWindow .NET Making th e Dat aWindow control large en ough If a DataW indow object has grouped rows, each page contains all group headers (inc luding zero-height head ers) at the top of the p age. Y our DataW indow control must be lar ge enough to acco mmodate all the group headers that di splay on each page o f the report.
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 273 4 Drag the colum n(s) you wan t to group on from the S ource Data bo x to the Columns box. Multiple co lumns a nd multiple gro up levels Y ou can specify more than one colu mn, but all columns apply to group level one.
Grouping rows 274 Dat aWindow .NET 10 Select Color and Bord er settings and click Next. 1 1 R eview your specificatio n and click F inish. The DataW indow object displays wi th the basic gro uping pr operties set .
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 275 Here is the preceding DataW indow object in the Preview view: Using an exp res si on for a group If you w a.
Grouping rows 276 Dat aWindow .NET Dat aWindow Object is not up dat able by def ault When you generate a Dat aW indow obj ect using the Gro up present ation style, DataW indow Desi gner makes it not upd atable b y default.
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 277 Creating subgroup s After defining your fir st group, y ou can defi ne subgrou ps, which are groups within t he group y ou just d efined.
Grouping rows 278 Dat aWindow .NET Y ou can also sort o n additional ro ws. For exam ple, if you want to sor t by employee ID within each group, specify em p_i d as the third sorting column. For mor e informati on about so rting, see “Sorting rows ” on page 267.
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 279 At runtime, you see this: Suppressi ng group headers If you do n ot want a gr oup head er to dis play at the to p of each p age wh en y ou print or di splay a report, select the Su ppress Group Header check box on the General property p age for the header .
Grouping rows 280 Dat aWindow .NET ❖ T o add a summ ary st atistic: 1 Select Inser t>Control>Co mputed Fie ld from the menu bar . 2 Click in the Design view where yo u want the statistic. The Mo dify E xpressi on dial og bo x displa y s. 3 Specify the expr ession that defines the comp uted field (see belo w).
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 281 T o get the total salary of employees in a depa rtment, sp ecify: Sum( Salary for group 1 ) At runtime, you see this: Sorting the group s Y ou can sort the gr oups in a DataW indow object.
Grouping rows 282 Dat aWindow .NET ❖ T o sort th e group s: 1 Place the mouse pointer on the group header bar (not inside the band) until the pointer beco mes a double-headed arrow . 2 Click. The Gener al property page for the gr oup displ ays in the Pr operties v iew .
CHAPTER 9 Filtering, Sorting, and Grouping Rows Data Win dow De si gne r User’s Gu ide 283 For example, if you chose the Salary column, DataW i ndow Desi gn er specifies that the group s will be sorted by the expression sum(sa lary f or group 1) : 5 Select ascending or d escending sort as app ropriate.
Grouping rows 284 Dat aWindow .NET.
Data Win dow De si gne r User’s Gu ide 285 CHAPTER 10 Highlighting Information in Dat aW indow Objects About thi s chapter This chapt er describ es how y ou modify t he way info rmation dis plays in Data W i ndow ob jects and re ports based o n the condi tions you spe cify .
Highlighting inform ation 286 Dat aWindow .NET In the following DataW indow object, the Salary Plus Bene fits co lumn has a Shadow box b order around eve ry data value in the co lumn.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 287 T o control the display of the border , you define a property cond itional expression for the column’ s Border p r operty .
Highlighting inform ation 288 Dat aWindow .NET When users run the DataW indow object, DataW indow Desig ner checks the value in the comp uted column called salary_plus_ben efits to see if it is greater than 60,000. If it is (true), DataW indow Designer displays the value with the Shadow b ox border .
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 289 Modifying p roperties cond itionally at runtime “Modifying prope rties a t runtime” on page 286 described how you can us e conditional expressions that are evaluate d at runtime to highlight informatio n in a DataW indow object.
Modifying properties conditionall y at runtime 290 Dat aWindow .NET For complete information abo ut what the valid values are for all properties of contr ols in the Dat aW i ndow ob ject, see the discu ssion o f DataW indow object properties in the DataW indow Object Refer ence or online Help.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 291 5 Click the button next to th e Brush C olor pro perty on th e G eneral page. 6 In the Modify Ex pression dialog b ox, enter the following expression fo r the Brush.
Modifying properties conditionall y at runtime 292 Dat aWindow .NET 2 On the Font page in the Properties v iew , click the button next to the Escapement pr operty . 3 Enter the number 4 50 in the Mod i fy Exp res sio n dialog b ox an d click OK. The value entered for font escapemen t is in tenths of degrees, so the number 45 0 means 45 degrees.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 293 T o make these controls display in bold with two asterisks if th e employee is not from Massachusetts: 1 Select one of the controls, then u se Ctrl + Click to select the other three controls.
Modifying properties conditionall y at runtime 294 Dat aWindow .NET Tip Y ou can use under lines, itali cs, strike through, bo rders, and colors to highlight informatio n . Example 4: changing the size and location of control s The follow ing Dat aW indow object sh ows city and state columns enclosed in a rectangle and u nderlined.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 295 T o change pro perties of the rectan gle and the line for rows with the state column equal to Ne.
Supplying property values 296 Dat aWindow .NET V alid values of propertie s are shown in p arenthes es in the Prope rties view w herever p ossible. For ex ample, the d rop-down list showi ng border selections includes the correct number for specify ing each border in par entheses after the name of the border (ShadowB ox (1), Underline (4 )).
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 297 Background.Color Description S etting for the backgroun d color of a contro l. In the painte r Background Co lor on the Gen eral page or Font page i n the Propert ies view .
Supplying property values 298 Dat aWindow .NET The follo wing is a portio n of the result ing DataW i ndow object. Noti ce that the employ ee ID, first name, an d last name h ave a gray backg round if t he employee uses th e day care benefit: Border Description The typ e of border f or the con trol.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 299 The following is a p ortion of the resulting Data W indow object. Notice that the status On Leave d isplays with a Shadow box border: About the valu e L and the v alue On Le ave The status colum n uses an edit style.
Supplying property values 300 Dat aWindow .NET Brush.Hatch Description Setting for the fill pattern of a graphic control. In the p ainter Brush Hatch on the Gener al page in the P roperties vi ew . Va l u e A number that specifies the pattern that fills the control.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 301 The following statement is fo r the Brush.Hat ch property of the rectangle. If the month o f the start date matches the cu rrent month or t he next one, B rush.
Supplying property values 302 Dat aWindow .NET Font.Escapement (for rotating controls) Description The angle of rotation from the baseline of the text. In the p ainter Escapement on the Fon t page in the Properties view . Va l u e An integer in tent hs of degrees .
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 303 How to position c ontrols that are rotate d Make the controls movab le. T o do so, display each control and se lect the Moveable check box in the Position page.
Supplying property values 304 Dat aWindow .NET Font.It alic Description A number that s pecifies whether the text should be italic. In the p ainter Italic on the Font page in the Properties vi ew . Va l u e V alues are: 0 —Not italic 1 —Italic Exampl e The following statements are specified fo r the F ont.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 305 Font.Strikethrough Description A number that speci fies whether t he text shou ld be cross ed out. In the painte r Strikeout on the Font pag e in the Pr oper ties view .
Supplying property values 306 Dat aWindow .NET Font.Underline Description A number that s pecifies whether the text should be underlined. In the p ainter Underline on the Font page in the Properties view . Va l u e V alues are: 0 —Not underli ned 1 —Underlined Exampl e The following statement, wh en applie d to the Font.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 307 Format Description The display format fo r a column. In the painte r Format on the Format page in the Prop erties view . Va l u e s A strin g specifying t he display f ormat.
Supplying property values 308 Dat aWindow .NET Pen.Color Description The color of the line or the outline of a graphic control. In the p ainter Pen Color on the General page in th e Prop ert ies v iew . Va l u e A num ber th at sp ecifi es th e color of the line or outline.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 309 The following statement is f or the Pen.Co lor property of the line around the edge of the r ectangle. If the mont h o f the start date matches the current month or the next one, Pen.
Supplying property values 310 Dat aWindow .NET Pen.Wid t h Description The wi dth of the line or the ou tline of a graphic cont rol. In the p ainter Pen W idth on the Gener al page in t he Properties vi ew . Va l u e An integ er in the unit of measure specified for the DataW indow object.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 31 1 Exam ple The following condi tion, entered for t he Pointer pr opert y of every con trol in a row of expense d ata, changes the po inte r to a column eve ry time the value in the expens e column exceeds $100,000.
Supplying property values 312 Dat aWindow .NET The st atus column mu st be retrie ved The status column must be included in the data source even thou gh it d oes not appear in the DataW indow object itself. The Design view includes the text con trol at th e ri ght- hand end of the detail line.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 313 Exam ple The following statement causes a rectangle to be located 6.25 0 inches from the left if the state co lumn for the row ha s the value NY . Otherwise, the rectangle is 4.
Specifying colo rs 314 Dat aWindow .NET Exampl e For info rmati on, see “Example 4: c hanging the size and l ocation of con trols” on page 294. Y1, Y2 Description The d i stance of each end of the specified line from the top of the band in which the line is located.
CHAPTER 10 Highlighting Information in DataW indow Objects Data Win dow De si gne r User’s Gu ide 315 Sample nu meric calcula tion T o create cyan, you use blue an d green, bu t no red.
Specifying colo rs 316 Dat aWindow .NET.
Data Win dow De si gne r User’s Gu ide 317 CHAPTER 1 1 Using Nes ted Report s About thi s chapter This chapter prov ides infor mation about creati ng repo rt s that have other repor ts nested in th em. Conten ts About repo rts an d Dat aWindow object s A report is the same as a nonupd atable DataW indow object.
About nested reports 318 Dat aWindow .NET Often, t he information in t he nested report dep ends on informa tion in the repo rt in which it is placed (the base report). Th e nested report and the base report ar e related to each other by some common data.
CHAPTER 11 Using Nested Reports Data Win dow De si gne r User’s Gu ide 319 The d iffere nce between nested a nd compos ite report s There are two important dif ferences betw een nes ting usin g the Composite s tyle and nestin g a report within a base r eport.
Creating a report using the Composite presentation style 320 Dat aWindow .NET The wizard displays all reports (Dat aW indow objects) that are in the current pro ject’ s library search path. 3 Click the reports you want to include in the composite rep ort and then click Next .
CHAPTER 11 Using Nested Reports Data Win dow De si gne r User’s Gu ide 321 Notice that you are in print pr eview (which is read-only). Working with compo site report s Many of th e options availa ble for working with reports, s uch as Rows>Filter , Rows>Im port, and Rows>Sort, are disabled for a composi te report.
Placing a nested report in another report 322 Dat aWindow .NET • Select Design>Data Source to go to the Select painter . • Select Design>Retrieval Ar guments from the men u bar in the Select painter . • Define a retrieval argument in the Specify Retrieval Arguments dialog box.
CHAPTER 11 Using Nested Reports Data Win dow De si gne r User’s Gu ide 323 5 Select Insert>Control>Report fro m the menu bar . 6 In the Design view , click where you want to place the repo rt. The Select R eport dial og box dis plays, listi ng defined r eports (DataW i ndow objects) in th e curren t project’ s library search path.
Placing a nested report in another report 324 Dat aWindow .NET 1 1 I n the Preview view , you can see what your rep ort looks like: Placing an unrelated nes ted report in another report When you place an unrelated nested report in a base repo rt, the entire nested repor t appear s with each row of th e bas e repor t.
CHAPTER 11 Using Nested Reports Data Win dow De si gne r User’s Gu ide 325 Wo rking with nested report s When you u se nested repo rts either i n composit e repor ts or in other b ase reports, several en hancements and options ar e available.
Working with nested reports 326 Dat aWindow .NET 3 Check the new width in th e Preview view . When you Print preview a DataWindow that con tains a nested N-Up repor t with ne wspaper column s across th e page, you mi ght find that blank p ages display (and print) when the nested r eport in the detail band fills the page.
CHAPTER 11 Using Nested Reports Data Win dow De si gne r User’s Gu ide 327 4 Select File>Close from the menu bar . Y ou are prom pted to sav e your changes . 5 Click OK. Y ou return to the composite report or to the base rep ort that includes the nested report.
Working with nested reports 328 Dat aWindow .NET Why re trieva l argu ments are effic ient Some DBMSs h ave the ability to bind inpu t variables in the WH ERE clause of the SEL ECT s tatement. When you use retrieval ar guments, a DBMS with th is capability sets up placeholders in the WHERE clause and compiles the SELECT statement once .
CHAPTER 11 Using Nested Reports Data Win dow De si gne r User’s Gu ide 329 The Ar guments bo x lists ar guments defined for t he nested rep ort and provides a way for you t o specify how information from the base r eport will supply the valu e of the ar gument to the nested repor t.
Working with nested reports 330 Dat aWindow .NET ❖ T o spe cify criteri a to relate a n ested rep ort to it s base report: 1 Select the nested repo rt and then sel ect the Criteria page in the Prop erties view .
CHAPTER 11 Using Nested Reports Data Win dow De si gne r User’s Gu ide 331 Note that all bands in the DataWindow also have an Autosize Height option. The option is off by default and must be on for the Autosize Height option for the nested repo rt to work properly .
Working with nested reports 332 Dat aWindow .NET Usin g the T rail Footer optio n (c ompos ite only ) The T rail Footer option controls the placemen t of the footer f or the last page of a nested report in a composite report . By default, this op tio n is on.
Data Win dow De si gne r User’s Gu ide 333 CHAPTER 12 W orking with Crosst abs About thi s chapter This chapter d escribes how to build crosstabs. Conten ts About crosst abs Cross tabulation is a useful techn ique for anal yzing data.
About crosstabs 334 Dat aWindow .NET T able 12-1 : The Printe r table in the EAS Demo DB This information can be s ummarized in a crosstab. Here is a crosstab that shows unit sales b y printer for eac.
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 335 The first-quarter sales of Co smic printers displays in the first data cell. (As you can see from the data in the Printer table shown before the crosstab, i n Q1 Simpson so ld 33 units, Jo nes sold 5 u nits, and Perez sold 26 units—to taling 64 units.
About crosstabs 336 Dat aWindow .NET T wo types of crosstabs There are two typ es of crosstabs: •D y n a m i c • Static Dyna mic cr osst abs W ith dynamic crosstabs, Da taW indow Designer builds all th e columns and rows in the cr osstab dynamically when you run the crosstab.
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 337 Creating crosst abs ❖ T o create a crosst ab: 1 Select File>New from the menu bar . The New di alog box di splays. 2 Select the DataW indow tab. 3 Select the Crosstab presentation style, then click OK.
Associating data with a crosstab 338 Dat aWindow .NET Associating data with a crosst ab Y ou associate crosstab columns, r ows , and cell values with colu mns in a databas e table or other data source.
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 339 Dyna mic cros stab example The process is illustrated using the followin g dynamic crosstab.
Associating data with a crosstab 340 Dat aWindow .NET Columns tha t use c ode t ables If you specify columns in the database that us e code tables, wh ere data is stored with a data value but displayed with more meanin gfu l displ ay values , the crosstab uses the column’ s display values, not th e data values.
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 341 ❖ T o specify an ex pression for columns, row s, or va lues: 1 In the Crosstab Defi ni ti on dialo g box (or wizar d page), dou bl e-cli ck th e item in the Columns, Ro ws, or V alues bo x.
Associating data with a crosstab 342 Dat aWindow .NET In the Design view , the crosstab looks like this : Notice that in the Design view , DataW indow Designer shows the quarter entries using the symbolic notation @qu arter (with dynamic cr osstabs, the actual data values are n o t known at def initi on time).
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 343 Specifying more than one row or colu mn T ypically yo u specify one database column as the Colu mns definition and one database colu mn for the Rows definiti on, as in the printer cr osstab.
Previewing crosstabs 344 Dat aWindow .NET Previewing cro sst abs When you hav e defined the cros stab, you can see it with data in the Preview view . ❖ T o preview the cr osst ab: 1 Select V iew>Preview from the menu bar to display the Preview view .
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 345 The rest of this s ection covers topics either uniq ue to crosstabs or especially important when working with crosstabs: .
Enhancing crosstabs 346 Dat aWindow .NET Modifying the data associated with the crosstab When you initially define the crosstab, you ass oci ate the crosstab r ows and columns w ith columns in a database t able or other data sourc e. Y ou can change the associated data any time in the Crosstab Definition dialog box.
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 347 Exam ple For example, if you want the product column to be labeled Printer Model , double-cli ck product in the Crosstab Definition d ialog box and specify printe r_mo del in the New Name dialog box.
Enhancing crosstabs 348 Dat aWindow .NET This is a crosstab that has been en hanced to show averages and maximum values for each co lumn. This is the Desig n view: This is the crosstab at runtime: ❖ T o def ine a ro w summ ary: 1 Select Insert>Con trol > Computed Field fro m the menu bar .
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 349 Using crosst ab functions There are nine s pecial functions you can use only in cros stabs: CrosstabAvg , CrosstabAvgDec , CrosstabCount , CrosstabMax , Cros stabMaxDec , Cro sstabMin , CrosstabMinDe c , CrosstabSum , and CrosstabS umDec .
Enhancing crosstabs 350 Dat aWindow .NET Here CrosstabSum(1) returns the total of sum( units fo r cros stab) for the corres pondin g row . CrosstabSum(2) re tur ns th e to tal fo r sum( unit s * 1.2 for cr osstab ) . For more information For complete inf ormatio n about defini ng computed fields, s ee Chapter 5, “Enhancing Dat aWindow Objects.
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 351 The first step is to determine the expressi on that, given a sala ry , returns the next smaller sal ary that is a multiple of $10,000 .
Enhancing crosstabs 352 Dat aWindow .NET This is the result in the Design view: This is the crosstab at runtime: Y ou can see, for example, that 2 people in departmen t 400 and 5 in dep artment 500 earn between $20,0 00 and $30 ,000. Displ aying blank value s as zer o In the preceding cros stab, several of the cells in the grid are blan k.
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 353 ❖ T o display blank val ues in a crosst ab as zero: 1 Select the column you want to modify and click the Form at tab in the Proper ties view . 2 Replace [General] in the Format box with ###0;# ##0;0;0 .
Enhancing crosstabs 354 Dat aWindow .NET For example, in the following scr eenshot, the four values fo r Quarter (Q1, Q2, Q3, and Q4) are displayed in the Design view: At runtime, no m atter what values ar e in the database for the column, the crosst ab sh ow s only t he values th at we re s pecified when the cross tab was defined.
CHAPTER 12 Working with Crosstabs Data Win dow De si gne r User’s Gu ide 355 Exam ple In the following cr osstab, an expres sion has been specified for Units: The expressi on is for the F ont.
Enhancing crosstabs 356 Dat aWindow .NET.
Data Win dow De si gne r User’s Gu ide 357 CHAPTER 13 W orking w ith T reeV iews About thi s chapter This chapt er descr ibes how to build and use Da taW indow objects in DataW indow Designer using the TreeV iew pres entation style.
TreeView presentation style 358 Dat aWindow .NET Exampl e This samp le T reeV i ew DataW indow uses the depart ment and em ployee t ables in the EAS De mo DB database and has two T reeV iew levels. The first level is the department n ame. The second level is the city wher e each employee resides.
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 359 Creating a new T reeView Dat aWindow Y ou use the T reeV iew wizard and the DataW indow painter to create a T reeV iew DataWin dow. T reeView creation process A T reeV iew DataWin dow has multiple levels, each of which is a node in the T reeV iew .
Creating a new TreeView DataWindow 360 Dat aWindow .NET Multiple columns and multiple T reeView levels Y ou can specify more than o ne column, but all co lumns apply to T reeV iew level one. At this point, you can define only one T reeV iew level. Y ou define additional levels later .
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 361 8 Modify the default color an d border settings if needed, and then click Next. 9 Review the T reeV iew DataWin dow characteristics. 10 Clic k Finis h. The DataW indow painter Design view displays.
Creating a new TreeView DataWindow 362 Dat aWindow .NET If you s elected the Grid S tyle check box , vertical and horizon tal grid lines displ ay: Here is the sample T reeV iew DataW indow object in t.
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 363 What you can do All of the techniques available in a tabular DataW indow ob ject , such a s moving contro ls and specifying d isplay formats, are av ailable for modi fying and enhanci ng T reeV iew DataW indow ob jects.
Selecting a tree node and navigati ng the tree 364 Dat aWindow .NET In the sam ple DataW ind ow shown i n “Exam ple” on page 358, the second level has a single column, the em ployee_city column. 4 Click OK. The new T reeV iew level and a T railer band for that level are created in the T reeV iew Design view .
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 365 Sorting rows in a T reeView Dat aWindow ❖ T o sort the rows within levels in a T reeView Dat aWindow: 1 Select Rows>Sort from the menu bar . 2 Drag the columns that y ou want to so rt the rows on from th e Sour ce Data box to th e Columns box.
TreeView DataWindow Design view 366 Dat aWindow .NET T reeView Dat aWindow Design view The Design view for the T reeV iew DataW indow diff ers from the traditional Design view for mos t DataW indow pres entation styles.
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 367 • When there is no tree node icon specified, a s haded square icon in the detail band and in each T reeV iew level band represents where the connecting line ends. The position of all the icon s change s when y ou change the ind ent value.
Setting properties for the TreeView DataWindow 368 Dat aWindow .NET Setting general T reeView properties Y ou set most T reeV iew DataW indow propertie s on the Gener al page in t he DataW indow Pr operties v iew .
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 369 Setting T reeView level properties In the Properties view , you can specify expanded and collapsed icon s for each T reeV iew level. Y ou access the Properties v iew by clicking the bar identifying the band for that level in the Design view in the DataW indow painter .
Setting properties for the TreeView DataWindow 370 Dat aWindow .NET 2 Use the DataWindow T reeV iew Level p roperties view that displays to edit the properties fo r the level you selected.
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 371 Setting detail band properties Y ou can specify an icon for the rows in the detail ba nd by clickin g the detail band in the DataWind ow painter to displ ay the Pr operties view .
TreeView DataWindow samples 372 Dat aWindow .NET Tr ee V i e w Dat aWindow s The T reeV iew DataW indows are d_sales_r eport and d_sa les_r epor t2 . Each T reeV iew DataW indow has three T reeV iew levels : • The first level (level 1) is the sales representati ve's name.
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 373 Using the Dat a Expl orer Y ou can click on any T reeV iew level in the Data Explorer . If you click a company name in the T reeV iew DataW indow on the left (for example, Able Inc.
TreeView DataWindow samples 374 Dat aWindow .NET Dat a Explore r Tr ee V i e w Dat aWindow Here is the T r eeV iew DataW indow used in the Data Explorer . One T reeV iew Dat aWi ndow The Data Explorer uses one T reeV i ew Dat aW indow , but Da taW indows that are not T reeV iew DataW indows also suppo r t the Data Explorer ’ s functionality .
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 375 Dat a Linker sample What the D ata L inker does When yo u first r un the Dat a Linker , no data dis plays on the ri ght side of the window .
TreeView DataWindow samples 376 Dat aWindow .NET For example, if y ou click first on C ather ine Pickett, then on A von Inc., then on 2073, an d last on Baseball Cap, the d ata in each of the related DataW indows displays on the right. Y ou can also update the data in each of the DataW indows.
CHAPTER 13 Working with TreeViews Data Win dow De si gne r User’s Gu ide 377 Data Linker T reeVi ew Data Window Here is the T reeV iew DataW indow used in the Data Linker sample.
TreeView DataWindow samples 378 Dat aWindow .NET.
Data Win dow De si gne r User’s Gu ide 379 CHAPTER 14 Exporting and Importing XML Dat a About thi s chapter The row dat a in a DataW indow can be exp orted and i mported in th e Extensib le Markup Languag e (XML). This chapter descri bes how to create and use templates that control the exp ort and import of data in XML format.
About XML 380 Dat aWindow .NET An XML documen t is made up of declarations, elemen ts, comments, character references, and processing instructions, indi cated in th e document by explicit mark up.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 381 XML Schema provides an alternat ive mecha nism for describing an d validating XML data.
About XML 382 Dat aWindow .NET T o change this into well-formed XML, you need to add all the missin g end tags: <table> <tr> <td>Dog</td> <td>Cat</td> <td>Mou.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 383 • Event-based APIs u se callbacks to r epor t events, such as the start and end of elements, to the calling applicatio n, and the application handles th ose events.
The Export/Import Template view for XML 384 Dat aWindow .NET The Export /Import T emplate view for XML Y ou define and edit templates for export and import in the Export/Import T emplate view for XML in the DataW indow painter. The view uses a tree view to represent the template.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 385 T able 14-1: I cons used i n the Export/Imp ort T empla te view Creating templates T o create a template, select th e New menu item or the New D efault menu item from the pop-up menu in the Export/Imp ort T empl ate view .
The Export/Import Template view for XML 386 Dat aWindow .NET Creati ng new defa ult templ ates The New Default menu item creates a template with the same contents as the New menu item, as well as a flat st ructur e of child elemen ts of the Detail Start element.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 387 Saving templates T o save a new template, select Save from the pop-up men u in the Export/Import T emplate view , and give the template a name and optionally a comment that identifies its us e.
The Export/Import Template view for XML 388 Dat aWindow .NET The Detail section contains the row da ta, and is generated iteratively f or each row in the DataW indow object. The Det ai l S tart elem ent A line across the Export/Impo rt T emplate v iew separates the Header section from the Detail section.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 389 Header section The Header section can con tain the items listed in T a ble 14 - 2 .
Editing XML templ ates 390 Dat aWindow .NET Editing XML tem plates Using temp lates for dat a import If you u se a templat e created for dat a export, DataW indow expressio ns, text, comments, and p rocessing instructio ns ar e ignored when data is imported.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 391 If an element has no attributes, you can edit its tag in the Export/Import T emplate view by selecting it and lef t- c licki ng th e tag or pressing F2. Literal text nodes can be edited in the same way .
Editing XML templ ates 392 Dat aWindow .NET Exampl e This is an XML declaration that specifi es XML version 1.0 , UTF-16LE encoding, and th at the document can stand alone: <?xml version="1.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 393 An external syst em iden tif ier with a public identifier: <!DOCTYPE d_test PUBLIC "-//MyOrg//DTD Test// EN" "http://www.mysite.org/mypath/mytest.
Editing XML templ ates 394 Dat aWindow .NET Controls Adding a DataW indow control reference opens a di alog box co ntaining a l ist of the columns, computed fields, report con trols, and text controls in th e docu ment.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 395 Attributes Controls or exp ressions can also be r e ferenced for element attribute v alues. Select Edit/Add Attribut e fro m the pop-up menu for elements to edit an existing attribute or add a new one.
Editing XML templ ates 396 Dat aWindow .NET Comp os ite repo rt s For composite reports that use the Composite presentation style, the default template has elements that ref erence each of its nested repo rts.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 397 CDA T A secti ons Y ou can export the n ame of a column in a CDA T A section using the synt ax <![CDA TA[ columnna me ]]> . Y ou can export the value o f a column using th e synta x <![CDAT A[~t colu mnname ]]> .
Exporting to XML 398 Dat aWindow .NET Processing instructions Processing instruction s (PIs) enable you to provide information to the application that uses the p rocessed XML.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 399 Default export fo rmat If you have n ot created or assigned an expo rt template, DataW indow Design er uses a defaul t export format. This is the s ame format use d when you create a new default export tem plate.
Exporting to XML 400 Dat aWindow .NET When you o pen a DataW indow, the Expo rt/Import T emplate view disp lays the template specified in the DataW indow’ s Use T emplate property . (If the view is not visible in the current layout, select V iew >Export/Import T emplate>XML from t he menu bar .
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 401 For example, cons ider a group DataW indow object that includ es the columns sales_orde r_id and sales_ order_order_ date .
Exporting to XML 402 Dat aWindow .NET <ShipDate>2005-09-14</ShipDate> </Item> </Order> <Order id="2002"> <OrderDate>2002-03-18</OrderDate> <Item .
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 403 In the template show n in the pr eviou s illustration, sales are grouped by customer ID, then by order ID. The cust omer group header has attributes for the custom er ’ s ID and firs t and last nam es.
Exporting to XML 404 Dat aWindow .NET Formatting the exported XML By default, the XML is exported without formattin g . If you want to view or verify the exported XML in a text ed itor , ch eck the I nclude W hitespace ch eck box or set the Expo rt.XML.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 405 Exam ple: i nter nal meta data For example, if yo u select XMLDTD! an d MetaDataInternal!, the header and first row o f the export ed XML would look like this for a simpl e grid DataW indow for the contact table in the EAS Demo DB.
Exporting to XML 406 Dat aWindow .NET <title>ma</title> <street>1280 Washington St.</street> <city>Emeryville</city> <state>MI</state> <zip>94608</zip> <phone>5105551309</phone> <fax>5105554209</fax> </dtdexternal_row> The DTD is in dtdexterna l.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 407 The example shows the head er and th e first row of the generated XML: <?xml version="1.0" encoding="UTF-16LE" standalone="no"?> <Contacts> <xs:schema xmlns:po="http://www.
Importing XML 408 Dat aWindow .NET Selecting templates at ru ntime T wo DataW indow pr operties, E xport.XML.T emplateCoun t and Export.XML.T em plate[ ].Name, enable you to provide a list of temp lates from which the user of the appli cation can select at runtime.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 409 Importing with a temp late If the XML do cument or st ring from w hich you w ant to impor t data do es not correspond to the DataW indow column de finition, or if yo u want to import attribute values, you must use a template.
Importing XML 410 Dat aWindow .NET Remo ve tab char acter s When you s elect a column name i n the DataW indow expression dialog box, tab characters are added before and after the name. Y ou should remove these characters bef ore saving the expr ession.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 41 1 Using export te mplates for im port If you have al ready defi ned an expo rt te mplat e for a DataW indow object, you can use it as an import template, but only the mapping of column names to element attribute nam es is u sed for import.
Importing XML 412 Dat aWindow .NET • The name element ha s two children, emp_fname and emp _lname, that contain column references to tho se columns. The template exports and imports the dep t_id DataW indow column usin g the attribute of the emp loyee elemen t.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 413 The exported XML can be r eimpor ted into the DataW indow co lumn s dept_id , emp_i d , emp_fname , and emp_ln ame .
Importing XML 414 Dat aWindow .NET Elemen ts with non-t ext con tent If the element has no text content, but do es contain comment s, processing instructions, o r any other content, it is not regarded as an empty element and is skip ped for impor t.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 415 Exam ple 2 In this example, the elements are not contained in rows, but they still match the DataW indow object.
Importing XML 416 Dat aWindow .NET Example with empty element s Exampl e 4 This example uses the same DataW indow object, but there are two emp ty elements in the XML document. Th e firs t has no con tent, and the second h as an attribute but n o content.
CHAPTER 14 Exporting and Importing XML Data Data Win dow De si gne r User’s Gu ide 417 Y ou can also use the Imp ort.XML.T race and Import.XML. T raceFile DataW indow object propert ies. If you use ImportClipb oard or ImportString to import the data, you must specify XML! as the importtype argumen t.
Importing XML 418 Dat aWindow .NET Exampl e: templa te impo rt The following trace log shows a template impo rt of the department table. The template used is named t_1 . Notice that the DataWi ndow column de pt_id is referenced twice, as both an attr ibut e and a column.
Data Win dow De si gne r User’s Gu ide 419 CHAPTER 15 W orking w ith Graph s About thi s chapter This chapt er describ es how to build and use grap hs in DataW indow Designer . Conten ts Abou t gra phs Often t he best way to display in formation i s graphicall y .
About graphs 420 Dat aWindow .NET Part s of a graph Here is a column graph created in DataW indow Designer that contains mo st major parts of a gra ph. It sh ows qu arterl y sal e s of thr ee prod u cts: Stel l ar , Cosmic, and Galactic print ers : How dat a is represented Graphs di splay dat a points.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 421 Organization of a graph T able 15-2 lists the parts of a typical grap h. T able 15-2: O rganization of a graph T ypes of gra phs DataW ind ow Designer p rovides many types of grap hs for you to choose from .
About graphs 422 Dat aWindow .NET Area, bar , column, and line graphs Area, bar , column, and line graphs are co nceptually very si milar . They differ only in how t hey physically represent th e data values—wheth er they use areas, bars, columns, or lines to represent the values.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 423 Scatter graphs Scatter graphs sh ow xy data poi nts. T ypically you u se scatter gr aphs to sh ow the relations hip between two set s of numeric values. Non -numeric values, su ch as string and DateT ime datatypes, do not display correctly .
About graphs 424 Dat aWindow .NET Three-dimensi onal graphs Y ou can also create 3-dimen sional (3D) gr aph s of area, bar , column, line, and pie graphs . In 3D g raph s ( except f or 3 D pie gr aphs ), series are p lotted alon g a third axis (the Series axis) instead of along the Categor y axis.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 425 Using gr aphs in Dat aWindow ob jects Graph s in Data Win dow obj ec ts are dynam ic Graphs in DataW indow objects are tied directly to the data that is in th e DataW indow object.
Using graphs in DataWindow objects 426 Dat aWindow .NET For mor e information , see “Associating dat a with a graph” on page 428. The Design view now co ntains a representation of the graph: 5 Specify the graph's proper ties in the Properties view .
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 427 Changing a graph's pos ition and size When you firs t place a graph in a DataW indow object, it is in the foreg round— it sits above the bands in the DataWindow object.
Using graphs in DataWindow objects 428 Dat aWindow .NET 3 Select the settings f or the following options on th e General property page: T able 15-5 : Size and p osition settin gs on the Genera l prope.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 429 Spec if ying which rows to include in a graph The Rows drop-do wn list allows you to specif y which rows of data are graphed.
Using graphs in DataWindow objects 430 Dat aWindow .NET Using disp lay valu es of dat a If you ar e graphing colum ns that use code tables, when data is stored with a data val ue but d isplayed t o users with more meaningful display val ues, by default the grap h uses the column's d ata values.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 431 Y ou can select column n ames from the drop -down list: There is a set of da ta points for each di f fer ent value of the co lumn you specif y here.
Using graphs in DataWindow objects 432 Dat aWindow .NET Examples This section shows how to specify the data for seve ral different graphs of the data in the Printer table in the EAS Demo DB. The table records qu arterly unit sales of three printers by three sales rep resent atives.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 433 The Quarter column serves as th e category . Because the Quarter column has four values (Q1, Q2 , Q3, and Q4), th ere will be four categories along the Category axis.
Using graphs in DataWindow objects 434 Dat aWindow .NET Graphi ng uni t sales o f each pr inte r T o graph total quarter ly sales of each pr inter , retrieve all the columns into a DataW indow object .
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 435 Here is the resultin g graph: Graphing unit sales by represent ative and tot al sal es T o graph q uarterly sa les m ade b y.
Using graphs in DataWindow objects 436 Dat aWindow .NET Here is the resulting graph: Notice that DataW indow Designer uses the literal “T otal” supplied in the Categor y box in t he Graph Data wind ow as a valu e in the Catego ry axis.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 437 Here is the resultin g graph. DataW in dow Designer uses the literals you typed for the series as the series labels in the legend: Using overlays It is often useful to call special attention to one of the series in a graph, particular ly in a bar or column graph.
Using graphs in DataWindow objects 438 Dat aWindow .NET Here is the resulting graph: T o graph unit s ales of prin ters by quar ter and ov erlay the lar gest s ale made in each quarter , change the V .
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 439 Using the Graph presen t ation style Instead of em beddi ng a gr aph in a DataW indow obj ect, you can use t he Graph presentation style to create a DataW indow object that is only a grap h—the underlyin g data is no t displa yed.
Defining a graph's properties 440 Dat aWindow .NET Defining a grap h's properties This section describes properties of a g raph. T o define the p roperties of a grap h, you use the grap h's Propertie s view . For general inf ormation abou t the property pages, see “Using the gra ph's Properties view” on page 426.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 441 S pec ifying the ty pe of graph Y ou can change the graph type at any time in the development environment. (T o chang e the type at runtime, mo dify a graph's Grap hT ype property .
Defining a graph's properties 442 Dat aWindow .NET Sorting data for series and categories Y ou can specify how to sort the d ata for series and categ ories.
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 443 ❖ T o specif y text prop erties for th e title, label s, axis va lues, and le gend of a graph: 1 Select Properties from the graph's pop -up menu and then select the T ext page in the Properties v iew .
Defining a graph's properties 444 Dat aWindow .NET 2 Specify the rotation you want in t he Escapement box using ten ths of a degree (45 0 means 45 degrees). Changes you make here are sho wn in the model graph in th e Design view and in the Preview view .
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 445 T o accomplish this, the display expressio ns were modified for the title and pie graph lab els: Specifying overlap and spacing W i th bar and column chart s, you can s pecify the pr operties in T abl e 15-8.
Defining a graph's properties 446 Dat aWindow .NET Specifying axis properties Graphs hav e two or three axes. Y ou sp ecify the axes' properties in the Axis page in the graph's P roperties view .
CHAPTER 15 Working with Graphs Data Win dow De si gne r User’s Gu ide 447 T able 15 -1 1: Propertie s for scaling on numeric axes Using ma jor and minor div isions Y ou can divide axes into divi sions. Each d ivisio n is identifi ed by a t ick mark, which is a short lin e that intersects an axis.
Defining a graph's properties 448 Dat aWindow .NET Repres enting divisi ons w ith gri d and drop lines Y ou can specify lines to represent the divi sions as desc ribed in T able 15-12 and illustrated in F i gure 1 5 -1.
449 PA R T 3 Appendixes This part co ntains informa tion ab out the rules for naming objects in DataWin dow Desig ner , the ex tended attr ibute system tables, and starting Da taWindow Design er from a comm and line.
450.
Data Win dow De si gne r User’s Gu ide 451 APPENDIX A Identifi ers About thi s chapter Y ou use identifiers to name objects. This chapter des cribes v alid identifiers.
Reserved words 452 Dat aWindow .NET Exampl es Here are some valid identifiers: first_quarter_summary EMPLOYEE_LABELS EmployeeSalarySummary Employee_by_# Here are some invalid identifiers: 2nd-quarter .
Data Win dow De si gne r User’s Gu ide 453 APPENDIX B The Extended At tribute System T ables About thi s appendi x This appendix describes each column in the extended attribute system tables.
The extended attribute system tables 454 Dat aWindow .NET What to do with t he t ables Y ou can open and l ook at these ta bles in the Dat abase painter just like other tables.
APPENDIX B T he Extended Attribute System Tables Data Win dow De si gne r User’s Gu ide 455 About font pitch and family Font pitch and family is a number obtained by adding togeth er two co nstant s.
The extended attribute system tables 456 Dat aWindow .NET T able B-4: T he PBCatFmt table T able B -5: The PBCatVld ta ble T able B-6: T he PBCatEdt table 17 pbc_init Initial value 18 pbc_cmnt Column .
APPENDIX B T he Extended Attribute System Tables Data Win dow De si gne r User’s Gu ide 457 Edit style typ es for the PB CatEdt ta b l e T able B-7 shows the edit st yle types available for the PBCatEdt table.
Edit style types for the PBCatEdt tabl e 458 Dat aWindow .NET RadioButton edit st yle (code 86) T ab le B-10 shows a s ample row i n the PBCatEdt table for a RadioButto n edit style.
APPENDIX B T he Extended Attribute System Tables Data Win dow De si gne r User’s Gu ide 459 DropDownList Box edit style (code 87) T able B -12 sh ows a sample row in the PBC atEd t tab le for a DropDownListBox edit styl e. T able B-13 shows the meani ng of the val ues in T able B-12.
Edit style types for the PBCatEdt tabl e 460 Dat aWindow .NET DropDownDataW indow edit style (cod e 88) T ab le B-14 shows a s ample row i n the PBCatEdt table for a DropDown DataW indow edi t style. T able B-15 shows the meaning of the values in T able B-14.
APPENDIX B T he Extended Attribute System Tables Data Win dow De si gne r User’s Gu ide 461 Edit edit style (code 89) T able B-16 sh ows a sa mple row in the PBCatEdt table for an Edit edit style. T able B-1 7 shows the mean ing of the values in T able B- 16.
Edit style types for the PBCatEdt tabl e 462 Dat aWindow .NET T able B-16: Samp le row in PBCatEd t for an Edit edit style T able B -17: Va lues used i n Edit edi t style samp le Name Edit T ype Cntr .
APPENDIX B T he Extended Attribute System Tables Data Win dow De si gne r User’s Gu ide 463 Edit Mask edit style (code 90) T able B-18 sh ows a sa mple row in the PBCatEdt table for an EditMask edit style. T able B-19 shows the meaning of the v alues in T a ble B-18.
E d i t s ty l e typ e s f o r th e P BC a tE d t ta b l e 464 Dat aWindow .NET Range Character representat i on (in decimal) of sp in control rang e. The min value a nd max val ue are tab -delimited . Examp le: "1[ta b]13" mean s min = 1, m ax = 1 3 SpinInc Character representati on (i n decimal) of spin increm ent.
Data Win dow De si gne r User’s Gu ide 465 APPENDIX C St arting Dat aWindow Design er from the Comma nd Line About thi s chapter This chapter d escribes how to us e command-line ar guments to start Data W i ndow Desig ner .
Starting DataWindow Designer from the command line 466 Dat aWindow .NET Openi ng an obje ct or creatin g a new object Y ou can als o add one or more of the fol lowing opt ional switches to the command line to open a specific object or create a new one.
Dat aWindow D esigner Us er ’s Guide 467 Symbol s + operator 207 @ used in cros stabs 34 1 used in v alidation rules 259 Numerics 24-ho ur times 237 A accelerator ke ys and CheckBox edit style 244 a.
Index 468 DataWi ndo w .NET border s in Da taWind ow objec ts 181 in grap hs 441 Border s drop-dow n toolbar in DataWindo w painter 154 breaks, i n grou ped Data Window objects 2 70 brush.
Index Dat aWindow D esigner Us er ’s Guide 469 comments including in SQL statement s 9 3 modif ying in Libra ry pa inte r 4 3 comment s in XML export templa te 397 compiling on imp ort 48 regener a .
Index 470 DataWi ndo w .NET pre s en tin g in D at aW indow ob je ct s 238 retr iev i n g an d up da tin g 188 retr ievin g in Data Wi nd ow ob je cts 159, 160 saving in extern al files 91, 1 68 savin.
Index Dat aWindow D esigner Us er ’s Guide 471 contr ol ling upda tes in 191 creating new 110 custom bu tto ns that add compu ted fields 209 data sour ce , modifyi ng 18 3 data source s 110 data, st.
Index 472 DataWi ndo w .NET generating SQL statemen t 8 5 spec ifyi ng an oute r jo in 84 st ore d pro ced ur es 137 supporte d 54 DDE application , usin g as data sourc e for DataWind ow object 111 d.
Index Dat aWindow D esigner Us er ’s Guide 473 working with in Database painter 240 working with in DataWindow painter 242 elevati o n, in 3D gra phs 4 41 encodin g declaration 391 Equality Required.
Index 474 DataWi ndo w .NET graphs about 419 addi ng to D ataWin dow obje cts 213 addi ng to r eports 213 auto sizing te xt 443 changin g positio n of 42 7 data types of ax es 446 default positioni ng.
Index Dat aWindow D esigner Us er ’s Guide 475 droppi n g from tab les 79, 80 propert ies 80 initial values, for c olumns 260 initializati on files about 32 chan ging path 33 editin g 17 InkPictu re.
Index 476 DataWi ndo w .NET List vi ew about 36 sortin g 37 usin g dr a g an d dr o p 38 local Ada ptive Serve r Anywhere da t abases 60 log files about 59 saving 60 logg ing expo rtin g ta ble synta .
Index Dat aWindow D esigner Us er ’s Guide 477 runni ng 9 selecting 3 9 Obje cts vi ew 56 onlin e books 29 onlin e Help, usin g 29 Open dialog box 9 openin g Data Mani pulati on view 86 data bas e v.
Index 478 DataWi ndo w .NET Powe rBar about 21 addi ng cus tom bu ttons t o 25 cont rolling display of 22 displayin g ava ila bl e butto ns 24 using 6 Powe rTip s assigni ng text in cust om butt ons 2.
Index Dat aWindow D esigner Us er ’s Guide 479 Q queries def ining 145 modify ing 147 modify in g comme n ts 43 naming 14 7 previewi ng 146 runni ng from toolba r 27 saving 14 6 Query data so urce 1.
Index 480 DataWi ndo w .NET S Save As dial o g box 16 8 Save Rows As di alog bo x 91 saving data in DataWi ndow objects 185 data in e xternal files 168 data in HTML Table format 169 DataWi ndow o bjec.
Index Dat aWindow D esigner Us er ’s Guide 481 expo r tin g to an ot her DBM S 72 for views, di sp laying 83 gene rating t hrough Quick Se lect 112 gene ra tin g thr o ug h SQL Se le ct 121 importin.
Index 482 DataWi ndo w .NET text f iles expo r tin g ob je ct s to 46 importing SQL statem ents from 95 text pat tern s, ma tching in vali d a tion r ules 2 59 text pr operti e s in Da taWind ow objec.
Index Dat aWindow D esigner Us er ’s Guide 483 dockin g 13 droppi ng 85 floa ting 13 in Lib rary pa i nter 36 movin g 11 removi ng 14 resizing 11 restori ng layo ut s 15 saving layo uts 14 title b a.
Index 484 DataWi ndo w .NET.
Un punto importante, dopo l’acquisto del dispositivo (o anche prima di acquisto) è quello di leggere il manuale. Dobbiamo farlo per diversi motivi semplici:
Se non hai ancora comprato il Sybase 2 è un buon momento per familiarizzare con i dati di base del prodotto. Prime consultare le pagine iniziali del manuale d’uso, che si trova al di sopra. Dovresti trovare lì i dati tecnici più importanti del Sybase 2 - in questo modo è possibile verificare se l’apparecchio soddisfa le tue esigenze. Esplorando le pagine segenti del manuali d’uso Sybase 2 imparerai tutte le caratteristiche del prodotto e le informazioni sul suo funzionamento. Le informazioni sul Sybase 2 ti aiuteranno sicuramente a prendere una decisione relativa all’acquisto.
In una situazione in cui hai già il Sybase 2, ma non hai ancora letto il manuale d’uso, dovresti farlo per le ragioni sopra descritte. Saprai quindi se hai correttamente usato le funzioni disponibili, e se hai commesso errori che possono ridurre la durata di vita del Sybase 2.
Tuttavia, uno dei ruoli più importanti per l’utente svolti dal manuale d’uso è quello di aiutare a risolvere i problemi con il Sybase 2. Quasi sempre, ci troverai Troubleshooting, cioè i guasti più frequenti e malfunzionamenti del dispositivo Sybase 2 insieme con le istruzioni su come risolverli. Anche se non si riesci a risolvere il problema, il manuale d’uso ti mostrerà il percorso di ulteriori procedimenti – il contatto con il centro servizio clienti o il servizio più vicino.