Sie sind auf Seite 1von 828

Type the text for the HTML TOC entry Type the text for the HTML TOC

entry Type the text for the HTML TOC entry Impromptu Administration Guide

ADMINISTRATION GUIDE

IBM(R) COGNOS(R) Business Intelligence Series 7


IBM(R) Cognos(R) Impromptu(R)

ADMINISTRATION GUIDE

Product Information
This document applies to IBM Cognos Impromptu Version 7.4 and may also apply to subsequent releases. To check for newer versions of this document, visit the Cognos Software Services Web site (http://support.cognos.com).
(R) (R) (R)

Copyright
Copyright 2008 Cognos ULC (formerly Cognos Incorporated). Cognos ULC is an IBM Company. Portions of Cognos ULC software products are protected by one or more of the following U.S. Patents: 6,609,123 B1; 6,611,838 B1; 6,662,188 B1; 6,728,697 B2; 6,741,982 B2; 6,763,520 B1; 6,768,995 B2; 6,782,378 B2; 6,847,973 B2; 6,907,428 B2; 6,853,375 B2; 6,986,135 B2; 6,995,768 B2; 7,062,479 B2; 7,072,822 B2; 7,111,007 B2; 7,130,822 B1; 7,155,398 B2; 7,171,425 B2; 7,185,016 B1; 7,213,199 B2; 7,243,106 B2; 7,257,612 B2; 7,275,211 B2; 7,281,047 B2; 7,293,008 B2; 7,296,040 B2, 7,318,058 B2; 7,325,003 B2; 7,333,995 B2. Cognos and the Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated) in the United States and/or other countries. IBM and the IBM logo are trademarks of International Business Machines Corporation in the United States, or other countries or both. Other company, product, or service names may be trademarks or service marks of others. While every attempt has been made to ensure that the information in this document is accurate and complete, some typographical errors or technical inaccuracies may exist. Cognos does not accept responsibility for any kind of loss resulting from the use of information contained in this document. This document shows the publication date. The information contained in this document is subject to change without notice. Any improvements or changes to the information contained in this document will be documented in subsequent editions. U.S. Government Restricted Rights. The software and accompanying materials are provided with Restricted Rights. Use, duplication, or disclosure by the Government is subject to the restrictions in subparagraph (C)(1)(ii) of the Rights in Technical Data and Computer clause at DFARS 252.227-7013, or subparagraphs (C) (1) and (2) of the Commercial Computer Software - Restricted Rights at 48CFR52.227 as applicable. The Contractor is Cognos Corporation, 15 Wayside Road, Burlington, MA 01803. This document contains proprietary information of Cognos. All rights are reserved. No part of this document may be copied, photocopied, reproduced, stored in a retrieval system, transmitted in any form or by any means, or translated into another language without the prior written consent of Cognos.

Table of Contents
Introduction 21 PART 1: Administering Impromptu 23 Chapter 1: Managing Catalogs 25 Create a Catalog 27 Change the Catalog Type 28 What is a Personal Catalog? 28 What is a Distributed Catalog? 28 What is a Shared Catalog? 28 What is a Secured Catalog? 29 Catalog Attributes 29 Managing Catalog Access 30 Controlling Catalog Access Using a Catalog Lock 30 Open a Master Distributed Catalog 30 Add Tables to a Catalog 31 Add Columns to a Catalog 31 Add the Same Table Twice to a Catalog 32 Sort Tables in a Catalog 32 Verify and Update Tables 33 Remove Tables and Columns 33 Qualify Catalog Content 34 Generate a Content Overview Report 34 Generate Default Reports 35 Chapter 2: Work with Folders and Folder Items 37 Create a New Folder 37 Copy and Paste Folders 38 Move Folders and Items in Folders 38 Remove Folders and Items in Folders 39 Rename Folders and Items in Folders 39 Sort Folders and Items in Folders 39 Generate a Folder from a Report 40 Synchronize Catalog Changes to Reports 40 Chapter 3: Work with Joins 41 Create an Equijoin 42 Create a Non-equijoin 42 Create an Outer Join 43 Create a Self Join 44 Create a Compound Join 44 Create a Complex Join 44 Create Joins Automatically When Creating a Catalog 45 Create Joins Automatically After Creating a Catalog 46 Test and Troubleshoot Joins 47 Change Joins 49 Remove Joins 49 Chapter 4: Working with Stored Conditions and Calculations 51 Building Expressions 51 Store a Condition or Calculation in a Catalog 53 Store a Summary in the Catalog 53 Administration Guide 3

Use a Stored Condition in a Calculation 54 Use a Stored Calculation in a Report 54 Use a Stored Condition as a Filter 55 Use a Stored Condition in Conditional Formatting 55 Change a Stored Condition or Calculation 55 Chapter 5: Working with Prompts 57 Create a Catalog Prompt 57 Modify a Catalog Prompt 59 Use a Catalog Prompt in a Report 59 Remove a Catalog Prompt from a Report 59 Create a Report Prompt 59 Modify a Report Prompt 60 Chapter 6: User Profiles and Data Access Requirements 63 Analyze User Requirements 63 Create a User Class 65 Edit a User Class 66 Remove a User Class 67 Use Access Manager to Control Security 67 Chapter 7: Techniques for Controlling User Access 69 Control Access Using Password Authentication 69 Assign or Change a Password for a User Class 69 Remove a Password from a User Class 70 Store a Database Password for a User Class 70 Prompt a User Class for a Database Password 70 Test User Access 71 Control Access to Objects 71 Control Access to Tables or Columns 71 Control Access to Folders and Items in Folders 72 Control Data Access Using Filters 73 Control Access Using a Catalog Lock 73 Control Access to Impromptu Functionality 74 Control Editing of the Catalog Structure 75 Control Creating and Editing Reports 75 Control the Ability to Enter SQL Directly 76 Control the Ability to Define User Classes 76 Chapter 8: Manage the Impact on the Network and Database 77 Use the Bulk Fetch Capability 77 Control the Retrieval of Large Text Items 77 Control the Number of Rows Retrieved 78 Control the Number of Tables Retrieved 78 Control Sorting on Non-Indexed Columns 79 Control the Creation of Outer Joins 79 Suppress Duplicate Rows of Data 79 Control the Creation of Cross-Product Queries 80 Control the Time a User Class Can Run Queries 80 Restrict the Time a User Class Is Connected to the Database 81 Adjust the Client/Server Balance 81 Assign Weights to Tables 82 Use Snapshots or Thumbnails 82 Chapter 9: Audit Impromptu Performance 85 Chapter 10: Work with HotFiles 89 Create a HotFile 90 Change or Update a HotFile 90 Add a HotFile to Your Catalog 91

4 IBM(R) Cognos(R) Impromptu(R)

Create a Catalog of Only HotFiles 91 Use a HotFile in Your Report 91 Use HotFiles as Lookup Tables 92 Share HotFiles by Including Them in Your Catalog 92 Join Multiple Databases Using HotFiles 92 Create and Use a HotFile for a Multiple Query Report 92 Chapter 11: Work with Stored Procedures 95 Create a Stored Procedure Report 96 Insert Parameters in a Stored Procedure Call 96 Hide Prompts for Stored Procedure Values 97 Chapter 12: Use SQL 99 View the Existing SQL for the Query 99 Create a Query By Writing Your Own SQL 99 Change a Query By Writing Your Own SQL 99 Generate Efficient SQL for Summary Level Reports 100 Chapter 13: Automating and Updating Impromptu 103 Standardizing Reports and Templates 103 Using Inheritance 104 Automating Tasks with Macros 105 Using the Impromptu Type Library 107 Manage the Size of Impromptu Reports 107 Create a Database Definition 109 Create a Database Definition for DB2 109 Create a Database Definition for a HotFile 111 Create a Database Definition for Informix 111 Create a Database Definition for Microsoft SQL Server via OLE DB 112 Create a Database Definition for ODBC 112 Create a Database Definition for Oracle 114 Create a Database Definition for Sybase Adaptive Server Enterprise 114 Copy a Database Definition 117 Remove a Database Definition 117 Select a Different Database for a Catalog 118 Connect to the Database 118 Chapter 14: Create and Customize a Chart 119 Choosing a Chart Type 119 Create a Chart 121 Change the Chart Type 123 Format a Chart 123 Add Chart Titles 124 Format Chart Titles, Axis Titles, Data Labels, and Legend Text 125 Format the Chart, Plot, and Legend Area 126 Change the Axis Labels and Scale Settings 126 Change the Grids Settings 128 Format Data Items 128 Hide or Show Data Labels in a Chart 129 Add and Format a Chart Legend 129 Show TrendLines 131 Correlation Chart 132 Chapter 15: Impromptu Chart Changes 135 Chapter 16: Impromptu Chart Controls 141 Formatting Dialog Box Controls 141 Grids and Scales Dialog Box Controls 142 Properties Dialog Box Controls 148 Titles Dialog Box Controls 155

Administration Guide 5

Trendlines Dialog Box Controls 155 Chapter 17: Product Sample Listing 157 Catalogs 157 Description 157 Location 157 Main Reports 157 Description 157 Location 160 Secondary Reports 161 Description 161 Location 161 Discovering Impromptu Reports 161 Location 162 Standard Templates 162 Description 162 Location 162 PowerPrompts Applications 162 Description 163 Location 163 OLE Automation (Macros) 164 Description 164 Location 164 User Defined Functions 164 Description 164 Location 165 Chapter 18: Integrating Impromptu with Other IBM Cognos Products 167 Use Architect with Impromptu 167 Import Impromptu Metadata into Architect 168 Export Catalogs from Architect 168 Integrate with Impromptu Web Reports 168 Preparing Your Reports for the Web 169 Security Interaction With Impromptu Web Reports 169 Integrate with IBM Cognos Query 169 Drilling Through to IBM Cognos Query 169 Importing Queries From IBM Cognos Query 170 Integrate with PowerPlay 170 Drilling Through from PowerPlay 171 Creating PowerCubes 172 Publish Reports to Upfront 172 Create NewsBox on Publish to Upfront 173 Data Formats and Locale Settings 174 Creating Accessible Reports 174 Enabling Accessibility Support 174 Design Considerations for Accessible Reports 175 Chapter 19: Troubleshooting and Best Practices 177 Unable to Identify Catalog Contents 177 PART 2: Creating Reports with Impromptu 179 Chapter 20: View a Report 181 View an Existing Report 181 View the Details of a Value in a Report 182 Change the Page Layout View of a Report 183 Chapter 21: View a Report with a Web Browser 185 Chapter 22: Print a Report 187 Preview a Report 188 6 IBM(R) Cognos(R) Impromptu(R)

Set Up the Printer 188 Print a Wide List Report on a Single Page 189 Print a List Report With Repeating Columns 190 Chapter 23: Export a Report 193 Export a Report to Other Applications 194 Add Report Navigation 195 Render a Report in Excel Format 196 Attach a Report to Email 196 CSV File Format 196 Chapter 24: Use Annotations 199 Chapter 25: Create a Report 201 Open a Catalog 202 Upgrade a Catalog or Report 203 Use the Report Wizard to Quickly Create a List Report 203 Use the Report Wizard to Quickly Create a Crosstab Report 204 Use a Template to Quickly Create a Report 205 Import a Query from IBM Cognos Query 207 Use a Report in Another Report 207 Create a Crosstab Sub-Report 208 Create Accessible Reports 208 Retrieve Data from the Database 209 Multiple Instances and Versions of Impromptu 209 Change the Number of Instances of Impromptu 210 Chapter 26: Add or Remove Data 211 Add Data to an Existing Report 211 Remove Data from a Report 212 Chapter 27: Group, Sort, or Associate Data in a Report 215 Group Data 217 Sort Data 218 Associate Data to a Grouped Data Item 219 Chapter 28: Filter or Find Data 221 Quickly Filter Data Using the Filter Button 222 Quickly Filter Data Using the Filter Drop-down Button 223 Filter a Report Using a Filter Stored in the Catalog 224 Filter Using Crosstab Titles 225 Find Specific Data in a Report 226 Copy, Cut, and Paste in the Expression Editor 227 Chapter 29: Work with Summaries 229 Create a Summary 230 Add a Total to a List Report 232 Use a Summary Stored in the Catalog 233 Move a Summary to Another Location 233 Chapter 30: Insert Text, Pictures, and Other Report Variables 235 Insert Text 235 Insert a Static Picture 236 Insert Page Numbers 238 Insert a Report Variable 239 Chapter 31: Hide, Show, Group or Resize Parts of a Report 241 Hide Part of a Report 242 Show Part of a Report 242 Unhide Part of a Report 242 Group Parts of a Report 243 Resize Part of a Report 244 Administration Guide 7

Stack Parts of a Report 244 Chapter 32: Format a Report 247 Apply a Template to an Existing Report 247 Add a Page Header or Footer 248 Adjust Margins 249 Align Parts of a Report 249 Position Part of a Report Using Snap to Grid 250 Chapter 33: Format Data 253 Justify Data 258 Enhance Data Display 259 Using the Currency Symbol List 259 Maintain Currency Symbols 260 Data Formats and Locale Settings 262 Number and Currency Data Type Formatting 262 Chapter 34: Add a Border Around Part of a Report 263 Add Color or a Pattern to Part of a Report 263 Change the Font 264 Apply a Style to Part of a Report 265 Chapter 35: Format a List or Crosstab Report 267 Hide or Show Grid Lines 267 Select Parts of a List Report 268 Move a Column 269 Change a Column Title 270 Change the Width of a Column 270 Change the Height of a Row 271 Add a Group or List Header or Footer 272 Change the Height or Width of a List Header or Footer 273 Keep Details and Group Headers (or Footers) Together 273 Insert a Page Break in a List Report 274 Select and Format Parts of a Nested Crosstab Report 274 Set the Default Format for Crosstab Columns 276 Chapter 36: Reporting While Disconnected From the Database 277 Create a Local Copy of the Report Data 278 Refresh a Local Copy of the Report Data 279 Remove a Local Copy of the Report Data 280 Chapter 37: Drill Through to IBM Cognos Query 281 Select the IBM Cognos Query Server 281 Set Up Drill-Through Access to IBM Cognos Query 282 Chapter 38: Prepare a Report for Impromptu Web Reports 283 Prepare a Report for Impromptu Web Reports 283 Create Burst Reports 285 Package HotFiles 285 Notify the Report Administrator 286 Chapter 39: PowerPrompts Developer Studio 287 Chapter 40: Report Specifications 289 File Searching 290 Command Line Switches 291 -m macro-filename 291 macro-filename 291 report-name 291 Chapter 41: Configuration Files 293 ini File Format 293 Function Definition Table (FDT) Files 294 8 IBM(R) Cognos(R) Impromptu(R)

Cognos.ini 294 Cern.ini 294 [IBM Cognos Locations] 294 Impromptu.ini 295 [Data Attributes] 296 [Default Directories] 297 [Startup Options] 298 [Query Options] 302 [Object Attributes] 304 [Styles] 304 [Graph Default Colors] 306 [Query Statistics] 306 [MRU Files] 307 Use Type Libraries 307 Chapter 42: Get Help on Basic and Advanced Topics 309 Chapter 43: Troubleshooting 311 Cannot Access the Datasource 311 Cannot Open a Catalog Created with Architect 312 Cannot Open a Catalog with Current User Class or Version of Impromptu 312 Cannot Connect to the SQL Server Database 313 Cannot Connect to the MS SQL Server 313 Cannot Find the Report or One of Its Components 313 Unable to Connect to the Database 314 PART 3: Mastering Impromptu Reports 315 Chapter 44: Report Data 317 Getting the Results You Want 317 Specify the Catalog for Your Reports 317 Group Automatically 318 Define Filters 318 Detail and Summary Filters 318 Create Filters 319 Use Filter Expressions 319 Filter Without Changing Your Summaries 320 What You Can Do Using Filters 321 Tips for Filters 325 Use Prompts to Select Report Data 325 Type-in Prompts 325 Picklist Prompts 326 When to Use the Types of Prompts 329 Using the Prompt Manager 329 What You Can Do Using Prompts 333 Format Report and Catalog Prompts 334 Summaries 336 Summarize Data 337 Create a Summary 340 Changing a Summarys Association 341 Create or Copy a Summary 342 Change a Detailed Data Item into a Summary 343 Calculated Fields 344 Create Calculated Fields 344 What You Can Do Using Calculations 346 Highlight Data 352 Create Styles 352 Conditionally Format Data 354 Conditionally Hide and Show Report Objects 356 Administration Guide 9

Chapter 45: Report Formats 359 Formatting Techniques 359 Data Formats and Locale Settings 359 Customize Data and Objects 359 Define Report Layouts with Templates 361 Set a Default Template 362 Customize the Templates Preview Image 362 Set the View for Templates 363 Create Effective Templates 363 Create Placeholders 365 Modifying Existing Placeholders 367 Create Calculated Placeholders 367 Insert Placeholders 368 Create Complex Layouts with Frames 369 The Parent/Child Relationship 370 Designate a Primary Frame 371 Insert a Frame 371 Select a Frame 373 Assign Names to Frames 373 List Frames 374 Form Frames 375 Chart Frames 378 Text Frames 379 Picture Frames 380 Chapter 46: Complex Reports 383 Present Complex Data 383 Crosstab Reports 383 Quickly Change a List Report into a Crosstab Report 384 Build Crosstabs from a List Query 384 Add Summaries to Crosstabs 386 Create Calculated Columns 388 Filter Data in Crosstab Reports 389 Swap Rows and Columns 390 Change a Crosstab to a List Report 390 Work With Sub-Reports 390 Create Reports Containing Sub-Reports 392 Edit Sub-Report Queries 392 Link Sub-Reports 393 Use Drill-Through Reports 394 Test Drill-Through Reports 397 Present Results with Other Applications 398 Using OLE to Present Impromptu Reports 398 Embed Objects In Impromptu 401 Embed Impromptu Objects in Other Applications 403 Link Impromptu Reports in Other Applications 404 Using HTML to Create Reports on the Web 405 Add Report Navigation 405 Align Report Objects in Impromptu 406 Eliminate Overlapping Objects in a Report 407 Avoid Multiple Scrollbars in HTML Report Output 408 Improving Performance 408 Save Reports as HTML 408 HTML Files 409 Distributing HTML Report Output 410 Export a Report in Excel Format 410 Exporting Reports with Multiple List Frames to Excel 411

10 IBM(R) Cognos(R) Impromptu(R)

Avoiding Multiple Worksheets on Export to Excel 411 Align Report Objects Before Export to Excel 411 Eliminate Overlapping Objects in Excel Reports 412 Add Worksheet Names Before Export to Excel 412 Change the Worksheet Order Before Export to Excel 412 Group Report Objects to Export Them to the Same Excel Worksheet 413 Rendering Headers and Footers in Excel Report Output 413 Export a Report to Excel with Images in the Header and Footer 413 Using Summaries in Excel Report Output 414 Using Data Scoping to Enhance Excel Report Output 414 Export a Text Field with Leading Zeroes to Excel 414 Export a Numeric Field with Null or Missing Values to Excel 415 Export a Form Frame within a List Frame To Excel 415 Chapter 47: Data and Databases 419 Choose Your Data Source 419 How Impromptu Retrieves Data 419 Take Advantage of a Cache Query 420 How Databases are Attached to Catalogs 420 Your Copy of the Database 420 Local Snapshots 421 Thumbnails 421 Use HotFiles 421 Chapter 48: About Catalogs 425 What Can You Do with Catalogs? 425 Use Catalogs 425 How Catalogs Open 427 Create a Personal Distributed Catalog 427 What Can You Change? 428 Rename Folders and their Contents 429 Create Catalog Folders 429 Move Folders and their Contents 430 Store Filters in Catalogs 430 Change a Predefined Filter Condition 431 Store Calculated Data Items and Summaries in Catalogs 431 Create and Store Prompts in Catalogs 432 Add User Classes 433 Chapter 49: Optimize Performance in Impromptu 435 Create Efficient Reports 435 The Difference Between Queries and Reports 435 Client/Server Balancing 436 Which Client/Server Options are Most Efficient? 437 Who Sets the Client/Server Balancing Option? 437 Summaries 437 Retrieve Summary Data Items 437 Put Summaries in Footers 437 Sorting on Database Summaries 438 Associating Summaries with Data Items 438 Choosing an Optimal Summary Strategy 438 Filters 442 Changes to the Filter 442 Database Summaries 442 Impromptu Functions 443 Non-Indexed Columns 443 Impromptu Functions 443 If/Then/Else and Lookup Statements 443

Administration Guide 11

Functions 443 Report Formatting Commands 444 Scan Data for Best Fit 444 Fit to Page 444 Use Alternative Data Sources 444 Test Your Queries Using Thumbnails 444 Improve Performance Using Snapshots 444 Improve Performance Using HotFiles 445 How Outer Joins Affect Your Work 445 What is an Outer Join? 446 When Not to Use Outer Joins 446 Outer Joins Examples 446 Limit the Data 447 Minimize Connection Time 447 Create Separate Accessible Reports 447 Manage the Size of Impromptu Reports 448 Chapter 50: Customize Impromptu 449 Customize Menus 449 Set Up a Launch Menu Command 450 Customize Toolbars and Buttons 450 Show or Hide Toolbars 450 Create a Custom Toolbar 450 Customize Toolbar Buttons 451 Set Up a Launch Button 451 Distribute Custom Menus and Toolbars 452 PART 4: Using Macros with Impromptu 453 Chapter 51: Introduction to Impromptu OLE Automation 455 Rendition ID 456 OLE Automation and Impromptu Registry Keys 457 Chapter 52: Run a Macro 459 Run a Macro in Impromptu Using a Command, Menu Command, or Toolbar Button 459 Run a Macro in Impromptu at Startup 459 Run a Macro in Impromptu Using a Command Line Option 460 Run a Macro in Impromptu Before Opening a Report 460 Chapter 53: Objects 461 Application Object 462 Catalog Object 464 CatalogLevel Object 465 Column Object 466 Database Object 467 DatabaseConnection Object 469 DatabaseDefinition Object 469 Expression Object 470 FolderItem Object 471 PublishExcel Object 472 PublishHTML Object 473 PublishPDF Object 474 QueryItem Object 475 ReportDocument Object 476 SchemaLevel Object 479 SelectedFrame Object 480 StoredProcedure Object 481 Table Object 482 TableLink Object 483 12 IBM(R) Cognos(R) Impromptu(R)

UserClass Object 484 Chapter 54: Collections 487 CatalogLevels Collection 488 Columns Collection 489 Databases Collection 490 DatabaseConnections Collection 490 DatabaseDefinitions Collection 491 DeniedCatalogs Collection 492 DeniedColumns Collection 493 DeniedFolderItems Collection 494 DeniedSchemas Collection 495 DeniedSelectValues Collection 496 DeniedTables Collection 497 FilteredColumns Collection 498 FilteredTables Collection 498 Folders Collection 499 Items Collection 500 QueryItems Collection 501 SchemaLevels Collection 501 SelectedFrames Collection 502 Tables Collection 503 TableLinks Collection 504 UserClasses Collection 505 Chapter 55: Methods 507 Activate Method 510 Add Method (CatalogLevels, SchemaLevels, UserClasses) 511 Add Method (Tables) 512 Add Method (Columns) 513 Add Method (Databases) 515 Add Method (TableLinks) 516 Add Method (DeniedCatalogs, DeniedColumns, DeniedFolderItems, DeniedSchemas, DeniedSelectedValues, DeniedTables) 517 AddExternalHotfile Method 518 AddFolder Method 519 AddItem Method (Use parameter) 520 AddItem Method (Column parameter) 522 AddTable Method 523 AppendEx Method (No Prompt) 524 Token Table 526 Prompt Syntax 529 ApplyTemplate Method 533 ChangeUserClass Method 534 Clear Method 535 ClearTOCColumns Method 536 Close Method 536 CloseCatalog Method 536 CloseReport Method 537 Commit Method 538 ConnectDatabase Method 539 CopySpecialToClipboard Method 540 CopyTo Method 541 CopyToClipboard Method 542 CreateAlias Method 542 CreateCatalog Method 543 CreateEmptyCatalog Method 544 CreateFilterFor Method 545 Administration Guide 13

CreateSnapshot Method 546 CreateStoredProcedure Method 547 DatabaseConnected Method 547 Delete Method 548 DisconnectDatabase Method 548 DistributedUpdate Method 549 Execute Method 549 Export Method 550 ExportASCII Method 551 ExportData Method 552 ExportdBASE Method 553 ExportExcelWithFormat Method 554 ExportHotFile Method 555 ExportSQL Method 555 ExportText Method 556 ExportTransformer Method 557 FileSetPrinter Method 558 GenerateReport Method 559 GetAppVersionInfo Method 560 GetDataValue Method 561 GetErrorNumber Method 562 GetFilterFor Method 569 GetNextQueryError Method 569 GetParameter Method 576 GetSelectedText Method 576 InsertQualificationLevel Method 577 Interactive Method 578 MoveTo Method 579 OpenCatalog Method 579 OpenCatalogEx Method 581 OpenDrillDownReport Method 583 OpenReport Method 584 OpenReportExA Method 585 OpenReportNoExecute Method 586 Print Method, PrintOut Method 587 Publish Method 588 PublishXML Method 589 QueryDialog Method 590 QueryItems Method 591 Quit Method 592 ReExecute Method 592 Remove Method 593 RemoveFilterFor Method 594 RemoveQualificationLevel Method 595 Reset Method 596 RetrieveAll Method 597 RetrieveRows Method 597 Save Method (Catalogs) 598 Save Method (Reports) 598 SaveAs Method 599 SetProcedure Method 600 Title Method 602 TOCAddColumn Method 603 UpdateCatalog Method 604 UseDatabase Method 604 Visible Method 605

14 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties 607 ActiveCatalog Property 611 ActiveDocument Property 612 ActiveUserClass Property 612 AllSelectedFrames Property 613 Application Property 614 CanAddOrModifyFolders Property 616 CanAddOrModifyUserClasses Property 617 CanCreateNewReports Property 617 CanDirectEnterSQL Property 618 CatalogLevels Property 619 CatalogName Property 620 CatalogOpened Property 620 Columns Property 621 Condition Property 622 ConnectionString Property 623 Count Property 623 CreatorUserClass Property 624 CrossProductPermission Property 625 CSVExportOptions Property 626 DatabaseConnected Property 627 DatabaseConnections Property 628 DatabaseDefinitions Property 629 DatabaseItem Property 629 Databases Property 630 DBObject Property 631 Definition Property 632 DeniedCatalogs Property 632 DeniedColumns Property 633 DeniedFolderItems Property 634 DeniedSchemas Property 635 DeniedSelectValues Property 635 DeniedTables Property 636 Description Property 637 EncryptedPassword Property 638 ErrorDocument Property 639 ExportMetaTags Property 639 ExportOptions Property 640 Filename Property 641 FilteredColumns Property 642 FilteredTables Property 643 FolderItem Property 644 FolderPath Property 645 Folders Property 646 Formula Property 647 FormulaEx Property 647 FormulaExB Property 652 FromPage Property 655 FullName Property 656 HasTextBlobLimit Property 656 IsDistributed Property 657 IsExternal Property 658 IsKey Property 659 IsLocked Property 660 IsSynonym Property 661 Item Property 662 Items Property 663 Administration Guide 15

LeftTable Property 663 MasterCatalogFilename Property 664 MasterName Property 665 MasterTable Property 666 MaxQueryExecutionTime Property 667 MaxRowsRetrieved Property 668 MaxTablesPerReport Property 669 MaxTextBlobCharacters Property 670 MetaDataItem Property 670 MetaDataPath Property 672 MinimizeConnectTime Property 673 Modified Property 674 Name Property 675 NameSpace Property 676 NonIndexSortingPermission Property 677 OuterJoinPermission Property 678 Parent Property 678 Path Property 680 PlainTextPassword Property 680 PublishHTML Property 681 PublishPDF Property 682 QualificationLevel Property 683 QueryExecutionTimeWarnAfter Property 684 QueryItem Property 685 QueryProcessing Property 686 ReadIsolationLevel Property 687 ResultType Property 687 RightTable Property 688 RowsRetrievedWarnAfter Property 689 SchemaLevels Property 690 SelectDistinctPermission Property 691 SelectedFrames Property 692 SQL Property 693 SuppressTOCDuplicates Property 693 TableLinks Property 694 Tables Property 695 TablesPerReportWarnAfter Property 696 TOC Property 697 TOCByPageNumber Property 697 ToPage Property 698 Type Property 698 UniqueID Property 700 UseQueryWarnings Property 701 UserClasses Property 702 UserName Property 703 Value Property 703 Version Property 704 Weight Property 705 WindowState Property 706 Chapter 57: Sample Macros 709 Annotation Sample 709 Add Catalog Prompts Sample 711 Drill-Through Report Sample 712 Open Report Sample 713 Scheduled Job Sample 714 Catalog Content Sample 715

16 IBM(R) Cognos(R) Impromptu(R)

Copy Rows To Notepad Sample 716 Create Catalog Sample 717 Create Empty Catalog Sample 718 Excel Options Upgrade Sample 719 Insert Qualification Levels Sample 720 Products (Publish as HTML) Sample 721 Sales By Country (Publish as HTML) Sample 722 PART 5: Using Expressions with Impromptu 723 Chapter 58: Expressions 725 Building Expressions 725 Functions 726 Summaries 726 Values 726 Operators 727 How to Create Prompts 727 Chapter 59: Functions 729 Access Security Functions 729 Catalog-User-Profile 729 User-Classes 730 User-Name 730 Date and Time Functions 731 Add-Days 732 Add-Months 733 Add-Years 733 Age 733 DateDayDiff 734 Datetime-to-Date 734 Date-to-Datetime 734 Date-to-Days-from-1900 734 Date-to-String 735 Day 735 Day-of-Ymd-Interval 735 Daysint-to-Ymdint 735 Days-from-1900-to-Datetime 736 Days-to-End-of-Month 736 First-of-Month 736 Hour 736 Last-of-Month 737 Make-Datetime 737 Minute 737 Month 738 Month-of-Ymd-Interval 738 Months-Between 738 Number-to-Date 739 Number-to-Datetime 739 Phdate-to-Date 739 Pre50-Months-Between 739 Second 740 Time-to-Zero 740 Today 740 Year-of-Ymd-Interval 740 Year 741 Years-Between 741 Ymdint-Between 741 Ymdint-to-Daysint 742

Administration Guide 17

Numeric Functions 742 Absolute 742 Ceiling 743 Floor 743 Integer-Divide 743 Mod 744 Number-to-Characters 744 Number-to-String 744 Number-to-String-Padded 744 Power 745 Round-Down 745 Round-Near 746 Round-Up 746 Round-Zero 747 Sqrt 747 Text Functions 748 Char_Length 749 Characters-to-Integer 749 Decrypt 749 Encrypt 750 First-Word 750 Left 750 Lower 750 Match-Pattern 751 Octet_Length 752 Pack 752 Position 752 Reverse 753 Right 753 Sound-of 753 Spread 753 String-to-Integer 754 String-to-Number 754 Substitute 754 Substring 754 Trim-Leading 755 Trim-Trailing 755 Upper 755 Chapter 60: Summary Functions 757 Average 758 Count 758 Maximum 758 Minimum 759 Moving-Average 759 Moving-Total 759 Percentage 760 Percentile 761 Quantile 761 Quartile 762 Rank 762 Running-Average 763 Running-Count 763 Running-Difference 764 Running-Maximum 765 Running-Minimum 765 Running-Total 766

18 IBM(R) Cognos(R) Impromptu(R)

Standard-Deviation 766 Tertile 767 Total 768 Variance 768 Chapter 61: Constants and Operators 769 Arithmetic, Logical, and String Operators 769 Arithmetic Operators (+, -, *, /, Div, -(x) ) 770 And Logical Operator 770 Or Logical Operator 770 Not Logical Operator 770 String Operator (+) 771 Comparison Operators 771 Between 771 Comparison Operator Symbols 771 Contains 772 Exists 772 In 772 Is Missing 772 Is Not Missing 773 Like 773 Starts With 773 Chapter 62: Components 775 All 775 Any 776 Auto 776 Dataset 776 Default 776 Descending 777 Distinct 777 For 777 If / Then / Else 777 Lookup 778 Null 778 Prefilter 778 Prompt 778 Replace With (->) 778 Report 779 Sort-by 779 Glossary 781 Index 799

Administration Guide 19

20 IBM(R) Cognos(R) Impromptu(R)

Introduction
The Impromptu Administration Guide shows you how to design, create, and maintain an Impromptu environment that meets the needs of your users. It explains the importance of analyzing user requirements creating catalogs organizing folders making joins creating calculations, conditions, and prompts setting up user classes and security auditing and optimizing performance automating tasks The last part of the document explains how to use Database Definition Manager to set up database access. Additional reference chapters list the samples included with Impromptu, tips for integrating with other IBM Cognos products, and troubleshooting information. The document concludes with a glossary of terms and an index. For more information about using this product, visit the Cognos Software Services Web site (http://support.cognos.com). For information about education and training, click the Education link from this site. This document is available as online help and an online book. Our documentation includes user guides, tutorial guides, reference books, and other materials to meet the needs of our varied audience.

Online Help
All information is available in online help. Online help is available from the help button in a Web browser, or the Help menu and help button in Windows products. You can also download the online help from the Cognos Software Services Web site (http://support.cognos.com). The environments.html file accessible from the /support/products part of this Web site lists the operating systems, browsers, Web servers, directory servers, database servers, and OLAP servers currently supported by IBM Cognos products.

Books for Printing


The information in each online help system is available in online book format (PDF). However, the information from a given help system may be divided into more than one online book. Use online books when you want to print a document or when you want to search the whole document. You can print selected pages, a section, or the whole book. You are granted a non-exclusive, non-transferable license to use, copy, and reproduce the copyright materials, in printed or electronic format, solely for the purpose of providing internal training on, operating, and maintaining the IBM Cognos software. An annotated list of other documentation, the Documentation Roadmap, is available from the Windows Start menu or the Impromptu Help menu. You can also read the product readme files and the installation guides directly from IBM Cognos product CDs.

Administration Guide 21

Introduction

22 IBM(R) Cognos(R) Impromptu(R)

PART 1: Administering Impromptu

Administration Guide 23

24 IBM(R) Cognos(R) Impromptu(R)

Chapter 1: Managing Catalogs


A catalog is a file containing the information that Impromptu users need to create reports. Catalogs are central to the operation of Impromptu, and creating a catalog is one of your key tasks as an administrator. A properly-created and maintained catalog results in a reporting environment that makes sense to your users, and makes administering Impromptu easier for you. Catalogs store metadata associated with the database structure including the name and location of the database names of the columns in the selected tables join relationships between tables In addition, a catalog contains folders, conditions, and calculations that you design and create. The folders, conditions, and calculations that you define in your catalog provide report users with a logical view of the physical data (in the database) that the catalog accesses.

What You Can Do


As an administrator, you can create different types of catalogs: personal distributed shared secured As the creator of a catalog, you can change the catalog type select the tables to include define the join relationships between the tables change the names or locations of the folders You can also open a master distributed catalog add tables and columns to a catalog add the same table twice to a catalog sort tables verify and update tables remove tables and columns limit the scope of data for the catalog; see "Control Access to Objects" (p. 71) use keys; see "Control Editing of the Catalog Structure" (p. 75) and "Create Joins Automatically When Creating a Catalog" (p. 45) qualify catalog content; see "Qualify Catalog Content" (p. 34) add calculations, conditions, or prompts; see "Store a Condition or Calculation in a Catalog" (p. 53) and "Create a Catalog Prompt" (p. 57) generate content overview reports generate default reports

How Many Catalogs Should You Create?


Impromptu can handle many catalogs. If you have an extremely large amount of data and many tables in your database, then defining more than one catalog might make sense. In this case, a single catalog could be difficult to use. It might take too long to load and navigate the catalog, and join maintenance might become involved.

Administration Guide 25

Chapter 1: Managing Catalogs More catalogs mean more administration and maintenance, though, and as a rule it is advisable to have only one catalog per application per physical location. Impromptus user classes and security features make it easy to manage a wide variety of user requirements with a single catalog.

What Effect Does a Catalogs Size Have?


As you include more tables, folders, and security restrictions in a catalog, it becomes larger. The size of a catalog can determine the type of catalog you choose to create. With a distributed catalog, the larger the master distributed catalog the longer it takes to copy the personal distributed catalog to the user machine, the more traffic there is on the network, and the longer it takes to synchronize the master and personal catalogs. There are no internal limits to the size of a catalog; that is, it can contain any number of tables. But large catalogsanything approaching 1 MB in sizecan be inefficient, especially on slower machines. As a catalog increases in size: maintenance time increases it takes longer to load the catalog, which increases the minimum time taken to run a report organizing folders for easy use by users becomes more difficult user class security becomes more involved join definition becomes more complex, with more chance for join loops distributed catalog synchronization takes longer It is difficult to provide an ideal size for a catalog, or a maximum number of tables in a catalog. It is best to add incrementally and check performance at each step, testing it on a typical end user machine for a real world feel.

Things to Consider Before Creating a Catalog


Before starting to create a catalog, you should be able to answer these questions: 1. What information do you want to include in the catalog? For example, do you want to see data for a particular division of your company? If you are interested in creating reports that present only marketing information, then you probably need to access only the tables in the database that contain marketing data. 2. Do you want to create a catalog that contains all the tables from the database, or only selected tables? Including all the tables is easier, because you do not have to specify the individual tables to include. But if you include tables that arent needed, processing efficiency might decrease, and it might be more difficult for users to find information they need. As a rule, include only those tables that must be accessible to users. Some database tables are used strictly for linking other tables. They should be included in the catalog for join purposes, but excluded from the folders. The range of tables to include in any one catalog should always be based on user and reporting requirements. 3. What table joins do you want to set up? When you create a catalog, you can join tables so users can retrieve data from more than one table at a time. Do you want Impromptu to create the joins for you automatically? Do you want to use keys and/or same-named columns for the automatic joins? If you do not want Impromptu to create the joins for you, do you know the joins you want to create? Although you can edit joins at any time, before starting to create a catalog you should have a join strategy in mind.

Some Catalog Tips


Here are some tips to keep in mind when creating and maintaining catalogs: Advise users to save their personal distributed catalogs with the same name as the master. This will minimize confusion that can arise when users have many catalogs in their directory and need to determine which master catalog is being referenced.

26 IBM(R) Cognos(R) Impromptu(R)

Chapter 1: Managing Catalogs The more folders a catalog has, the larger it is. Avoid repeating folders as subfolders in many different folders. Each copy of the folder increases the size of the catalog. This must be balanced with the need to make the catalog valuable to the user and the need to ease the administrative burden. Denying access to a lot of folders for a large number of user classes increases the size of the catalog. When a user has access to a folder, no overhead is added, but denying access increases catalog size. You should monitor this feature closely.

Create a Catalog
Before you can create a catalog, you must have access to the data in the database, and you must define a logical database so that Impromptu can access the data. For more information about defining database connections, see "Create a Database Definition" (p. 109). Once you create a database definition, you can create the type of catalog that best meets the needs of your intended users: personal, distributed, shared, or secured. During catalog creation, you must add tables from the database and define the join relationships. Impromptu automatically creates a default set of folders based on the tables that you add from the database. You can also define Impromptu keys that provide additional information for joining tables. Once you have done this, you must define folders, folder items, and any calculations and conditions that you require.

Steps
1. From the Catalog menu, click New. 2. In the File name box, type a file name for the catalog. Note: Impromptu automatically adds the extension .cat to catalog names and stores catalog files in the same folder as your Impromptu application. Specify your own default catalog folder using the File Locations tab (Options command, Tools menu), to override this setting. 3. In the Description box, type a description of the catalog. Note: A catalog description is optional. 4. In the Catalog type box, click the type of catalog you want to create: personal, distributed, shared, or secured. 5. In the Name box, select the database the catalog will access. Note: If the database definition does not exist, then you must create it. Click Databases if you want to add a new database definition, and then click OK to return to the New Catalog dialog box. 6. Select the tables you want to include in the new catalog by using one of the following options: Click Select tables and select the database tables that you want to include in the new catalog. Click Include all tables. Impromptu creates your catalog with all the database tables, builds, default joins, and creates two user classes: Creator and User. For more information, see "Add Tables to a Catalog" (p. 31). 7. Click OK. 8. If you are using a database that requires a user ID and password, in the Database User ID and Database Password boxes (Catalog Login dialog box), type your user ID and password. 9. In the Joins dialog box, define any necessary table joins, and then click OK. For more information, see "Work with Joins" (p. 41). 10. In the User class box (Catalog Login dialog box), select the Creator user class, and then click OK. Note: You should make a backup copy of the catalog after you create your catalog, and before you change it further. 11. Continue to develop your catalog by adding folders; see "Create a New Folder" (p. 37) and "Copy and Paste Folders" (p. 38) moving folder items; see "Move Folders and Items in Folders" (p. 38)

Administration Guide 27

Chapter 1: Managing Catalogs adding conditions or calculations; see "Working with Stored Conditions and Calculations" (p. 51) 12. If you created a distributed, shared, or secured catalog, then place the catalog in a physical location accessible by your users.

Change the Catalog Type


When designing catalogs, it is best to set the catalog type based on users reporting needs. For example, if youre creating a catalog for users accessing canned reports and who will never change the reports, create a secured catalog. If youre creating a catalog for users who want to add their own custom folders, create a distributed catalog and set up the appropriate user classes. If necessary, you can change one catalog type to another by changing certain attributes within the catalog. For example, if youve developed a personal catalog and later want to enable access by other users, you can change the personal catalog into a shared or distributed catalog.

What is a Personal Catalog?


A personal catalog is a catalog that you do not intend to make accessible to other Impromptu users. You can create personal catalogs to access databases from which you require personal reports. Personal catalogs are for individual use only and there are no security considerations. Only the creator of the catalog can access the data referenced by the catalog.

What is a Distributed Catalog?


A distributed catalog consists of an original master distributed catalog that the administrator controls and maintains, and one or more local catalogs (personal distributed catalogs) that are created when users open the master distributed catalog. Distributed catalogs are useful to maintain a certain level of control over the catalog, but allow catalog users to create their own local copies of the catalog. Once users have created their own personal distributed catalog, they can modify it to meet their own specific reporting needs. You can enable your users to modify their personal distributed catalogs by assigning them privileges to modify folder structures and add conditions and calculations. With a distributed catalog, you can enable the Folders and User Profiles commands so that your users can organize the contents of their personal distributed catalog by creating new folders create conditions and calculations to store in their catalog disconnect from the LAN and continue to work with their personal distributed catalog connect and disconnect from the database create user classes, set passwords, and control the user environment manage the impact on the network and database Impromptu maintains a link with the master distributed catalog and automatically updates the linked personal distributed catalogs with changes to the master. This enables users to change the contents of their personal distributed catalog, while ensuring that changes to the master are applied to their personal distributed catalogs. Note: Users cannot change the names or locations of the folders that the administrator adds to the catalog.

What is a Shared Catalog?


A shared catalog is generally stored on a LAN to provide access for all users. When you open a shared catalog, you are working with the same copy of the catalog as all other users. The creator of a shared catalog can change and grant privileges to specific users that enable them to organize the contents of the catalog by creating new folders, editing folders you've created, and changing their location work with conditions and calculations stored in the catalog 28 IBM(R) Cognos(R) Impromptu(R)

Chapter 1: Managing Catalogs connect and disconnect from the database

Note: No more than 20 users can be simultaneously connected to a read-write shared catalog. This is a limitation of Microsoft's implementation of compound files. As a workaround, you could use a distributed catalog. However, there are situations where distributed catalogs will not work well (for example, getting an updated copy of a large master distributed catalog with a slow dial-up access). You could also make the shared catalog read-only as another workaround. You may negate some user privileges if you do this. The same problem occurs for reports for the same reason.

What is a Secured Catalog?


A secured catalog is a read-only catalog that only the Creator can change. Use secured catalogs to deploy "canned" reports for audiences that have no need to customize their reports. Users cannot change a secured catalog, and they cannot create or change any of the reports based on the catalog. Users can only view, run, export, and print reports. In addition, users can connect to and disconnect from the database.

Catalog Attributes
The following table outlines the default attributes of each catalog type. You can add new user classes and modify existing ones. Use the descriptions in this table to determine the catalog type that meets your user's needs: Catalog Type Personal Attributes Has only the Creator user class with full privileges. You can: create and edit reports edit folders add and modify user classes create type-in SQL reports Has a Creator and a User user class. The Creator user class has full privileges. The User user class can: create and edit reports add and modify user classes Distributed Has a Creator and a User user class. The Creator user class has full privileges. The User user class can: create and edit reports edit folders add and modify user classes Only this type is designated as a Distributed catalog in the Catalog Properties dialog box. Secured Has a Creator and a User user class. The Creator user class has full privileges. The User user class can view reports, but it can't create reports, change reports, or make changes to the catalog.

Shared

Administration Guide 29

Chapter 1: Managing Catalogs

Managing Catalog Access


If you change a personal catalog to any other catalog type, it is likely that it will contain only the Creator user class (although Personal catalogs can contain multiple user classes). To grant others access to the catalog, you must add other user classes. By default, Impromptu adds a user class named User automatically. For more information, see "Create a User Class" (p. 65). It is unusual to change a shared, distributed, or secured catalog to a personal catalog. You can do so only by deleting all user classes other than the Creator user class. If you change a shared, secured, or distributed catalog to another catalog type, you must change the governor settings for all user classes other than the Creator. For more information, see "Control Editing of the Catalog Structure" (p. 75) and "Control Creating and Editing Reports" (p. 75).

Steps
1. To change a distributed catalog, click the Properties command from the Catalog menu, and then click or clear the Make this a distributed catalog check box. This change is in addition to any changes required for user classes. 2. If you change a distributed catalog into either a shared or a secured catalog, you must inform the catalog users. Their local copies of the distributed catalog are no longer linked to a master distributed catalog. 3. If you change a shared or secured catalog into a distributed catalog, inform the catalog users that they will be prompted to save their own local copy of the catalog.

Controlling Catalog Access Using a Catalog Lock


Locking a catalog is another method of controlling catalog access. A locked catalog restricts access to the Creator user class. When a member of the catalog Creator user class attempts to open a locked catalog, they must provide password authentication before opening it. A catalog lock is specified by the administrator and exists in addition to the common logon authentication required by IBM Cognos products and the catalog logon authentication. If a user who is not a member of the Creator user class attempts to open a locked catalog, they are prompted for the usual catalog logon credentials only. For more informaton, see "Control Access Using a Catalog Lock" (p. 73).

Open a Master Distributed Catalog


Only the Creator user class can change the master distributed catalog. When any user class other than the Creator user class opens a master distributed catalog, Impromptu makes a copy of the catalog. This copy is known as a personal distributed catalog. By default, every time a personal distributed catalog is opened, Impromptu automatically updates it with changes to the master distributed catalog. Catalog users can change their default settings so that they must manually update their personal distributed catalogs. You can have only one catalog open at any one time. To open a different catalog, you must first close the current catalog. You should disconnect personal distributed catalogs used in Impromptu Web Reports from the master distributed catalog. For more information about preparing reports for Impromptu Web Reports, see the Impromptu User online help.

Steps
1. 2. 3. 4. From the Catalog menu, click Open. Click the catalog and click Open. From the User class box, click the user class to which you have access. If required, type your catalog password. Note: Impromptu asks you to name your copy of the catalog.

30 IBM(R) Cognos(R) Impromptu(R)

Chapter 1: Managing Catalogs 5. In the Database User ID and Database Password boxes (Catalog Login dialog box), type your user ID and password if you are using a database requiring a user ID and password. 6. In the File name box, type a name for your personal distributed catalog and click OK.

Add Tables to a Catalog


A table in a database is a portion of the database containing one kind of information organized into rows and columns. You can add one or more tables from the active database to a catalog. When you add a table, a folder is automatically created. When the database metadata changes, you can update tables in the catalog instead of re-creating the catalog. You can attach filters to tables or columns to filter out data before showing the report. These filters are automatically added to the report's own filter when the report is executed. You cannot have any reports open when you add tables to a catalog. Adding and removing tables and columns can cause existing reports to fail. Validate existing reports and regenerate them to ensure they work correctly.

Steps
1. From the Catalog menu, click Tables, and then click the Edit tab. Note: If you add tables when you create a new catalog, the Tables dialog box appears automatically. 2. In the Database tables box, select the table or tables to add to the catalog. 3. Click Add. 4. In the Create joins box, select one of the following options to specify how to create table joins: To open the Edit tab (Joins dialog box) where you can create the table joins, click Manually. This is the default. To join the tables using the columns that are defined as keys, click Using key only. To create no table joins, click None. You can manually create them later. To join the tables using the columns that are defined as keys or the first column that is named the same in each table, click Using key or First matching column. Note: Impromptu matches tables using keys. If one table has a key and the other table does not, Impromptu searches for a column with the same name and data type as the key. If there are no keys in either table, Impromptu matches columns based on the first matching name and data type that it finds. For more information, see "Work with Joins" (p. 41). 5. If you are using keys, define keys for the tables. Note: You do not need to define keys if your database has indexed columns. 6. Qualify the tables to control how tables are qualified for SQL queries, and click OK.

Add Columns to a Catalog


You can add one or more columns from the active database to a catalog. You can add columns when you create a new catalog to an existing catalog if changes to the database affect the catalog if your catalog requirements change

Steps
1. From the Catalog menu, click Tables, and then click the Edit tab. 2. In the Database tables box, double-click the database owner and table containing the column or columns to add. Administration Guide 31

Chapter 1: Managing Catalogs Note: Your database may not have a database owner. 3. Select the column or columns to add to the catalog. 4. Click Add. A folder for the table is created in the Catalog tables box. The folder contains only the column or columns you selected. 5. In the Create joins box, select one of the following options to specify how to create the table joins. To open the Edit tab (Joins dialog box) where you can create the table joins, click Manually. This is the default. To join the tables using the columns defined as key, click Using key only. To create no table joins, click None. You can manually create them later. To join the tables using the columns defined as keys or the first column that is named the same in each table, click Using key or First matching key. Note: Impromptu matches tables using columns that have been defined as keys. If one table has a key and the other table does not, then Impromptu looks for a column with the same name and data type as the key. If there are no keys in either table, Impromptu matches columns with the same name and data type. For more information, see "Work with Joins" (p. 41). 6. If you are using keys, define keys for the tables. Note: You do not need to define keys if your database has indexed columns. 7. Qualify the tables if you want to control how tables are qualified for SQL queries, and click OK.

Add the Same Table Twice to a Catalog


You can create a table alias to add a second copy of a table to the same catalog. The second copy of the table is added with a different name. You can create table aliases to relate values within a single table. For example, if all the employee data is in one table in the database, you can find out which employee works for which manager by adding the table, then adding an alias of the table, and finally creating a self-join between the table and alias. use in a filter expression. This enables you to create a view of part of the data in a table. For example, you can create a view for managers of the Employee table by aliasing the Employee table under the name of Managers, and then use a filter expression on the Managers table to create the view.

Steps
1. 2. 3. 4. 5. From the Catalog menu, click Tables, and then click the Edit tab. In the Database tables box, click the table to add to the catalog. Click Alias. Type the alias name and click OK. Click OK.

Sort Tables in a Catalog


You can sort tables to better manage large catalogs. Tables can be sorted alphabetically in ascending or descending order or restored to the original sort order.

Steps
1. From the Catalog menu, click Tables. 2. Click a table, then click the sort icon at the top of the appropriate list box. To sort the database tables, click a table in the Database tables box. To sort the catalog tables, click a table in the Catalog tables box. 32 IBM(R) Cognos(R) Impromptu(R)

Chapter 1: Managing Catalogs 3. From the drop-down list, click to sort the items in ascending order (a to z) to sort the items in descending order (z to a) to restore the default order 4. Click OK.

Verify and Update Tables


If the database has changed, you can ensure that the catalog contains the most up-to-date information by: Verifying that the owners, tables, and columns in the open catalog still exist in the database. If an owner, table, or column is not in the database, you can rename or remove it from the catalog so the catalog matches the new database information. Updating a table in a master distributed catalog with the most current database information. You need to update the tables in the master distributed catalogs if the table definition in the database changes. You cannot have any reports open when you verify or update tables.

Steps to Verify the Tables in a Catalog


1. From the Catalog menu, click Tables. 2. In the Catalog tables box, click the table or tables to verify. 3. Click Verify. Note: If the table or a column within the table is no longer in the database, an X appears over the table icon. 4. Remove or rename the table or column in the table to fix the error, and click OK. For more information, see "Remove Tables and Columns" (p. 33).

Step to Update a Table with the Current Database Information


From the Catalog menu, click Update Catalog. Note: If Impromptu cannot find the source catalog, you are be prompted to locate and select the source catalog in the Update: Source Catalog Not Found dialog box.

Remove Tables and Columns


A table is a portion of the database containing a set of information systematically arranged into rows and columns. A catalog identifies the tables in the database you can access using Impromptu. You remove tables and columns from an existing catalog if changes to the database affect it, or if your catalog requirements change. When you remove a table or column, Impromptu prevents you from using invalid data by automatically removing all associated folders, folder items, conditions, joins, and calculations. You cannot have any reports open when you remove tables and columns.

Steps to Remove a Table from a Catalog


1. From the Catalog menu, click Tables, and then click the Edit tab. 2. In the Catalog tables box, click the table or tables to remove. 3. Click Remove. Note: When you click Remove, Impromptu lists the columns and governor restrictions for the table you are removing as well as the tables that are joined to the table that you are removing. 4. Click OK to remove the selected items, and click OK again.

Steps to Remove a Column from a Catalog


1. From the Catalog menu, click Tables, and click the Edit tab. Administration Guide 33

Chapter 1: Managing Catalogs 2. In the Catalog tables box, double-click the database owner and the table containing the column or columns to remove. Note: Your database may not have a database owner. 3. In the Catalog tables box, select the column or columns to remove. 4. Click Remove. Note: When you click Remove, Impromptu lists the columns you are removing, their governor restrictions, and any joins for those columns. 5. Click OK to remove the column, and click OK again.

Qualify Catalog Content


You can qualify tables in SQL queries to ensure your users access the correct tables. You can use unqualified table names to control how selected tables are qualified in SQL queries. You can qualify tables with information on database, owner, table, and column. By default, tables are fully qualified. You can set up an annotation server to help users identify their tables and columns. For more information, see "Unable to Identify Catalog Contents" (p. 177). You can remove the qualifiers for table names at any time.

Examples
You have a catalog of sales data, containing one table called sales, that you are testing before releasing it to your end users. You qualify the table as <test>.<yourname>.<sales>, identifying the table as belonging to the test database and to the yourname owner. When you are ready to release the catalog, you remove the database and owner qualifiers to identify the table only as sales. The Great Outdoors Company has acquired a small operation that manufactures one of its product lines. When the two sets of data are combined at the database level, the data will contain many of the same names as your data at headquarters. You can maintain one catalog for the two regions by qualifying the tables for the different locations, so that the users will access the correct tables even though they are named the same.

Steps
1. From the Catalog menu, click Tables, and then click the Qualification tab. Note: If your database does not support qualified tables, the Qualification tab is unavailable. This tab is enabled for only the Creator. 2. In the Catalog tables box, click the table to qualify. 3. To add qualifiers to the table, click Qualify more. Note: Each time you click Qualify more, another qualifier is added to the table, starting with the lowest level available to the selected table. The levels of qualifiers from the lowest to highest level are column (lowest level), table, owner, and database (highest level). 4. To remove qualifiers from the tables, click Qualify less. Note: Every time you click Qualify less, another qualifier is removed from that table, starting with the highest level applied to the selected table. 5. Click OK when you finish qualifying tables.

Generate a Content Overview Report


You can generate a content overview report on the contents of the current catalog. The report is saved as an ASCII text file. A content overview report describes catalog information, such as the catalog name and location information about the database, such as the database's logical name, the physical name, and the type of database

34 IBM(R) Cognos(R) Impromptu(R)

Chapter 1: Managing Catalogs database tables and columns folders in the catalog and the items in each folder table joins information about user classes, such as the name and access privileges of each user class

You can use this report to track your catalog as you create or edit it. You can also give users a hard copy so that they can see changes to the catalog. You can only generate a content overview report for a catalog that you created.

Steps
1. From the Catalog menu, click Content Overview. 2. In the Files name box, type a name for the report. Note: If you do not specify an extension, Impromptu automatically adds the extension .icr. 3. From the Save as type box, do one of the following: To save a content report, click Content Report (*.ICR). To save a different file type, click All files (*.*). 4. Click the drive and directory where you want to store the report. 5. Click Options, and click one of the following: To include information about the table joins, click Table join expressions. To include the tables and columns, and their associated conditions, click Tables and columns. To include folders and folder items, including conditions and calculations, click Folder hierarchy. To include information about user classes, click User class information. 6. Click OK, and then click Save.

Generate Default Reports


You can generate default reports for selected tables, and then use the reports as the starting point for creating custom reports.

Steps
1. 2. 3. 4. 5. 6. 7. From the Catalog menu, click Generate Reports. In the Tables box, click a table. Click Generate. If the template on which you want to base the report appears in the FastFind tab, double-click the template. Click Browse to find a template in another location. Repeat steps 2 to 5 to generate a report for another table. Click Close. The report is assigned the name of the table from which it was generated, and an .imr extension is added to the name. From the File menu, click Open to view the report.

8.

Administration Guide 35

Chapter 1: Managing Catalogs

36 IBM(R) Cognos(R) Impromptu(R)

Chapter 2: Work with Folders and Folder Items


When you create a catalog, each table in the catalog appears as a folder containing the table's columns. You can also store conditions, calculations, and catalog prompts in folders. Folders enable you to organize data items logically, according to users needs, rather than based on how tables and views are physically stored in the database. This logical rendering of information enables report users to access information without knowing about the tables, indexes, and joins that comprise a typical corporate database.

What You Can Do


You can modify and organize the folders and items in the folders. You can create new folders and show the contents of a folder copy folders and folder items and paste them in new locations move and remove folders and folder items rename folders and folder items sort folders and folder items generate a folder from a report use folder items to synchronize catalog changes to reports

Who Can Modify and Organize Folders and Folder Items?


If the user is using a Catalog that they created Personal distributed catalog, and you have enabled the user to use the Folders command Then the user Can create, modify, and organize folders and folder items in the catalog. Can create, modify, and organize folders and folder items in the catalog. The user cannot modify and organize folders you create. Personal distributed catalog, and you have prevented the user from using the Folders command Shared catalog, and you have enabled the user to use the Folders command Shared catalog, and you have prevented the user from using the Folders command Secured catalog Cannot create, modify, and organize folders and folder items. Can create, modify, and organize folders and folder items in the catalog. Cannot create, modify, and organize folders. Cannot create, modify, or organize folders.

Create a New Folder


Folders are an important administrative tool because they enable you to logically organize data items based on users needs, rather than on how physical tables are structured in the database. You can reorganize the contents of your catalog by creating new folders that reflect the different needs of your business.

Administration Guide 37

Chapter 2: Work with Folders and Folder Items For example, while the GOSales database contains tables such as OrderDetails, SalesStaff, and Sales_Branch, your sales managers are interested in Sales Orders and Locations. To make it easier for users to find the data they need, you can reorganize the folders into a "business view" that is meaningful. You create a Locations folder to hold the SalesStaff and SalesBranch information. You can generate a folder containing a table that you want added from the database to your catalog. When you select a table, Impromptu creates a folder with the name of the table and adds it to your folders list. If a folder exists with the same name, Impromptu adds a number to distinguish it from the existing folder. There should be a balance between the number of levels of subfolders in a catalog and the number of items in any one folder. If there are too many items in a folder, users must scroll through lists of items to find what they need.

Steps
1. Close any open reports. 2. From the Catalog menu, click Folders. 3. Click Folder. To create a new folder inside an existing one, open and select the existing folder before clicking Folder. 4. In the Name box, type the name of the new folder, and click OK.

Copy and Paste Folders


You can copy folders and paste them in new locations. You can reorganize the contents of your catalog to make it more intuitive. Changes to the original folder do not affect copies of the folder.

Steps
1. Close any open reports. 2. From the Catalog menu, click Folders. 3. To copy a folder or item in a folder, do one of the following: To copy a folder, click the folder and click Copy. Click the folder that you want the copied folder to appear above, click Paste, and then click OK. To copy an item in a folder, select the item and click Copy. Click the folder into which you want to copy the item. Click Paste, and click OK.

Move Folders and Items in Folders


You can move folders and items to new locations that are more intuitive. To move folders or folder items, cut and then paste them. Your reports should still work. If you copy and paste folders or folder items and then delete the original items, your reports based on that catalog may fail. You can control how reports are synchronized to a changed catalog. For more information, see "Synchronize Catalog Changes to Reports" (p. 40).

Steps to Move Folders


1. 2. 3. 4. 5. 6. Close any open reports. From the Catalog menu, click Folders. Click the folder you want to move. Click Cut. Click the folder you want the folder to appear above. Click Paste and click OK.

Steps to Move Items in Folders


1. Close any open reports.

38 IBM(R) Cognos(R) Impromptu(R)

Chapter 2: Work with Folders and Folder Items 2. 3. 4. 5. From the Catalog menu, click Folders. In the Catalog folders box, select the item you want to move, and click Cut. Select the folder into which you want to move the cut item. Click Paste and click OK.

Remove Folders and Items in Folders


You can remove folders and items in folders. Folder items can include conditions, calculations and prompts. Removing tables or columns can cause existing reports to fail. You can control how reports are synchronized to a changed catalog. For more information, see "Synchronize Catalog Changes to Reports" (p. 40).

Steps
Close any open reports From the Catalog menu, click Folders. Click the folder or item you want to remove. Click Cut. Note: If you remove something by mistake, click Undo to reverse the Cut command. 5. Click OK. 1. 2. 3. 4.

Rename Folders and Items in Folders


You can rename folders and items to make their names more intuitive. For example, suppose you have a Date column name in every table, but it means something different in each case. It might be the Order Date in the Orders table, the Product Release Date in the Products table, and the First Order Date in the Customers table. In this case, to eliminate the possibility of confusion, use different names in the various folders to identify exactly what each date represents. Renaming tables or columns can cause existing reports to fail. You can control how reports are synchronized to a changed catalog. For more information, see "Synchronize Catalog Changes to Reports" (p. 40).

Steps
1. 2. 3. 4. 5. 6. Close any open reports. From the Catalog menu, click Folders. Click the folder or item you want to rename. Click Edit. In the Name box, type a new name or edit the current name and click OK. Click OK and click OK again.

Sort Folders and Items in Folders


You can sort folders and folder items to better manage large catalogs. Folder and folder items can be sorted in ascending or descending alphabetical order or restored to the original sort order.

Steps
1. 2. 3. 4. Close any open reports. From the Catalog menu, click Folders. Click a folder or folder item, then click the sort icon at the top of the Catalog folders list box. From the drop-down list, click to sort the items in ascending order (a to z) to sort the items in descending order (z to a) Administration Guide 39

Chapter 2: Work with Folders and Folder Items to restore the default sort order When you select a folder and the folder is open, Impromptu sorts only the folders and folder items immediately beneath the selected folder. It does not sort items in any nested folders. the folder is closed, Impromptu sorts the folder and folder items at the same level in the folder hierarchy. 5. Click OK.

Generate a Folder from a Report


You can generate a folder with a set of columns and conditions from a report. This is a quick way to create and test calculations. For information about creating conditions and calculations, see "Working with Stored Conditions and Calculations" (p. 51).

Steps
1. Close any open reports. 2. From the Catalog menu, click Folders. Note: If you want to store the new folder in a specific folder, open the folder. 3. Click Generate. 4. In the Generate Folder dialog box, click Report, and then click OK. 5. Click the report containing the columns and conditions you want, and click Open. Note: To add more reports, repeat steps 3 to 5. 6. Click OK.

Synchronize Catalog Changes to Reports


When you open an Impromptu report using a modified or different catalog than the one the report was created with, Impromptu attempts to update the report item references to match the folder items. Matching occurs as follows: match on the unique, internal ID if the internal ID is not found, match on the full folder path and folder item name Matching on the first folder item with the same name as the report item is not attempted. It can be useful to match on the first folder item with the same name as the report item if you reorganized the catalog folder structure and want the report to use the new references. To enable matching in this way, you must add the Allow Lazy Path Matching=T setting to the [Startup Options] section of the Impromptu.ini file. If you add this setting, ensure that all folder items in your catalog have unique names.

40 IBM(R) Cognos(R) Impromptu(R)

Chapter 3: Work with Joins


Joins relate the data in one table to the data in another table in the same database, enabling you to retrieve data from more than one table at a time. For example, you may want to see the purchases made by each customer, but the information about purchases is stored in the Sales table and the information about customers is stored in the Order table. You create joins between these two tables so you can create reports that use columns from each of these tables. A join can have several columns linked together. The relationship between the columns is called a link. You can create different types of joins manually. This is the default setting. create joins automatically when creating a catalog by using keys or the first matching column; see "Create a Catalog" (p. 27). create joins automatically after a catalog has been created. To sort a list of joins, click a join, then click the Sort icon at the top of the list box. Select one of the Sort commands. You can sort joins in ascending or descending alphabetical order or you can restore the original sort order. When deciding what joins to make, you might want to consider alternatives to some joins. For example, instead of trying to manipulate joins, you might want to create more simple reports that users can drill between, or to create sub-reports. If you create an incorrect join, reports show unexpected or incorrect results. Correct joins ensure that no cross-product queries are created. Once you specify all the joins, all reports automatically reflect these joinseven reports created before the joins were specified.

Choosing the Appropriate Joint Type


When you create a catalog, Impromptu prompts you for join information. Impromptu creates equijoins by default. You can create these types of joins: Type of Join Equijoin Non-equijoin Operator = Equal <> Not Equal To < Less Than > Greater Than <= Less Than or Equal To >= Greater Than or Equal To Self join Outer Join Compound Join Complex Join Any of the above Not applicable Not applicable Not applicable "Create a Self Join" (p. 44) "Create an Outer Join" (p. 43) "Create a Compound Join" (p. 44) "Create a Complex Join" (p. 44) See this description "Create an Equijoin" (p. 42) "Create a Non-equijoin" (p. 42)

Administration Guide 41

Chapter 3: Work with Joins

Create an Equijoin
An equijoin retrieves all the rows from one table that have matching rows in another table. For example, the linked columns of a databases Products and Orders tables are the two columns for Product Number. An equijoin between these tables would match up equal values in the two Product Number columns, then retrieve rows from both tables that contain these values. All of the possible combinations of these rows could then be reported on. Impromptu creates equijoins by default when Impromptu automatically creates joins. You can also create equijoins manually.

Steps
From the Catalog menu, click Joins, and then click the Edit tab. In the Join paths box, click the table to which you want to add a join. In the Available tables box, click the other table in the join. Click Add. Decide whether you are going to create the equijoin as a diagram or expression. In the View as box, click Diagram. Or, to create an equijoin by defining an SQL expression, click Definition and create the join expression using the Join components and Join definition boxes. 7. Click the column in each table you want to link. 8. Click Add Link. Note: If you link more than four columns in a table join, Impromptu automatically shows the links as an expression. 9. Click OK when you have completed adding the links. 1. 2. 3. 4. 5. 6.

Create a Non-equijoin
A non-equijoin retrieves all the rows from one table that meet the criteria in another table. The criteria are based on expressions you define using the following operators: <> < > <= >= Not Equal To Less Than Greater Than Less Than or Equal To Greater Than or Equal To

Example
To create a Sales Representative report showing which representatives sold more than a given representative, you could compare the values in the sales amount columns with a non-equijoin. You would use the greater than (>) operator, together with a self join (see "Create a Self Join" (p. 44).)

Steps
1. 2. 3. 4. 5. 6. 7. From the Catalog menu, click Joins, and then click the Edit tab. In the Join paths box, click the table to which you want to add a join. In the Available tables box, click the other table in the join. Click Add. Decide whether you are going to create the non-equijoin as a diagram or expression. In the View as box, click Diagram. Click the column in each table you want to link.

42 IBM(R) Cognos(R) Impromptu(R)

Chapter 3: Work with Joins 8. Click Add Link. Note: If you link more than four columns in a table join, Impromptu automatically shows the links as an expression. 9. From the box between the two columns, select a non-equijoin operator to make the table join a non-equijoin, and then click OK. You can create a non-equijoin by defining an SQL expression. Follow the same procedure as creating a non-equijoin by diagram except click Definition instead of Diagram to create the join expression using the Join components and Join definition boxes. Impromptu show joins as definitions for joins with more than four columns linked together.

Create an Outer Join


An outer join retrieves rows from two or more tables even if there are no matching rows. An outer join can be a left, right, or full outer join. The side of the outer join determines which rows are reported on, even if there is no match. To determine whether to create a left or right outer join, you must know the relationship between the two tables you are joining. The outer join goes on the master side (which returns all rows), not the detail side. A full outer join retrieves all the rows from both tables, as if you combined a left outer join with a right outer join. To enable outer join processing, in the Access tab of an open report (Query dialog box, Report menu), ensure that the Include Missing Table Join Values (Outer Join) check box is selected. If Impromptu is required to assist a database that provides less than complete support for the SQL-92 definition of outer join processing, this can slow performance. When defining outer joins, please refer to your vendor documentation.

Example
For each customer there may not always be a sale. Sales information is stored in one table and Customer information in another table. When Impromptu retrieves the data from both tables, it shows the customer record even if a customer has not bought an item.

Steps
1. 2. 3. 4. 5. From the Catalog menu, click Joins, and then click the Edit tab. In the Join paths box, click the table to which you want to add a join. In the Available tables box, click the other table in the join. Click Add. In the View as box, click Diagram or Definition, and do one of the following: Goal Action

click both Outer Join check boxes To retrieve all records from both tables and merge records where matches are found (a full outer join) To retrieve all records from the table on the left, matched or not, and the matching values from the table on the right (a left outer join) as a diagram, click the Outer join check box on the left as a definition, click the Outer Join check box on the top as a diagram, click the Outer join check box on the right as a definition, click the Outer join check box on the bottom

To retrieve all records from the table on the right, matched or not, plus the matching values from the table on the left (a right outer join) 6. Click OK.

Administration Guide 43

Chapter 3: Work with Joins

Create a Self Join


Use self joins to add two or more references to the same table in a catalog, so you can compare data in a column to other data in the same column, and thereby understand how they are related. To create a self join, you create an alias table based on a source table, so you have two tables with the same contents but different names. You then join the alias table to its source, either with an equijoin, a non-equijoin, or an outer join.

Example
Your employee data is in one database table called Employees, and you want to find out which employees work for which manager. You add the Employees table to the catalog and then alias the Employees table to add it a second time. You call the aliased table Managers and create a join between the Employees table and the Managers table. You create a report showing which employees work for each manager.

Steps
1. Add a table to the catalog, and then add the same table again using an alias. For more information, see "Add the Same Table Twice to a Catalog" (p. 32). 2. From the Catalog menu, click Joins, and then click the Edit tab. 3. In the Join paths box, click the table to which you want to add a join. 4. In the Available tables box, click the table alias. 5. Click Add. 6. Create an equijoin, non-equijoin, or outer join for the tables, and click OK. To create an equijoin, see "Create an Equijoin" (p. 42). To create a non-equijoin, see "Create a Non-equijoin" (p. 42). To create an outer join, see "Create an Outer Join" (p. 43).

Create a Compound Join


A compound join is a join containing several columns joining two tables. Compound joins are useful where multiple columns generate a unique key to join to another table. Sometimes a relational database has a unique key, which is a combination of two or more columns. A compound join can be used in combination with a non-equijoin, a self join, or an outer join.

Example
You join the Customer table and the Outlet table by linking city and state. You type the following:
CUSTSITE.CUST_NO=ORDER.CUST_NO and CUSTSITE.SITE_NO=ORDER.SITE_NO

Steps
1. 2. 3. 4. 5. 6. From the Catalog menu, click Joins, and then click the Edit tab. In the Join paths box, click the table to which you want to add a join. In the Available tables box, click the other table in the join. Click Add. In the View as box, click Definition. In the Join component box, double-click the join components to add them to the join expression. Separate each table join with "and" or "or". Note: In the Join components box, double-click the Database component to add columns to your join expression. 7. Click OK.

Create a Complex Join


A complex join uses an expression to join two tables. 44 IBM(R) Cognos(R) Impromptu(R)

Chapter 3: Work with Joins They are not used frequently, although they can be used in conjunction with a non-equijoin or outer join. Use a complex join, for example, when your organization acquires another organization, and you must consolidate information for the two organizations.

Example
You need to join the product code in the Sales table to the product code in the Products table. However, the product code in the Sales table is four digits long while the product code in the Products table is the same four digits plus two more digits for the branch code. You use a complex join to link these columns.
Sales.prod_code = Substring (Products.prod_code, 1,4)

Limitations Associated with Complex Joins


Complex joins cannot use summary calculations. You can use only simple expressions within a complex join. When defining complex joins, be aware of the interaction between Impromptu and the database. If you use internal expressions and functions that are calculated by Impromptu rather than the database, this could slow computer performance.

Steps
1. 2. 3. 4. 5. 6. From the Catalog menu, click Joins, and then click the Edit tab. In the Join paths box, click the table to which you want to add a join. In the Available tables box, click the other table in the join. Click Add. In the View as box, click Definition. In the Join components box, double-click the join components to add them to the join expression. Note: In the Join components box, double-click the Database component to add columns to your join expression. 7. Click OK.

Create Joins Automatically When Creating a Catalog


When you create a catalog, you can create joins automatically using keys or the first matching column. Impromptu keys do not have to correspond to database keys. Define Impromptu keys for the tables if you want to use keys to join tables, and if the columns are not indexed in the database.

Example
You define Cust-id as the key of the Customer table because there can be only one customer number for each customer.

Steps to Define a Join Using a Specific Key or Column


1. 2. 3. 4. From the Catalog menu, click Tables, and then click the Edit tab. In the Database tables box, click the tables to add to the catalog. Click Add. In the Create joins box, click one of the following options to specify how to create the table joins: To join tables using the keys you define, click Using key only. To join tables using the keys you define or the first column with the same name and data type, click Using keys or first matching column.

Administration Guide 45

Chapter 3: Work with Joins If both tables have keys defined, Impromptu joins the tables using keys. If one table has a key, Impromptu looks for the first column with the same name and data type in the second table. If neither table has a key, Impromptu looks for the first column in each table with the same name and data type. 5. Click OK. 6. Ensure that the joins created by Impromptu are valid.

Steps to Define New Keys for a Table


1. From the Catalog menu, click Tables, and then click the Edit tab. Note: If you are defining keys while creating a catalog, the Tables dialog box appears as part of creating a catalog. 2. In the Catalog tables box, double-click a table to open it. 3. Click the column or columns you want to define as keys. Note: Impromptu shows a key icon next to the selected column name. 4. Double-click the table to close it. 5. Repeat steps 2 to 4 to define keys for other tables. 6. Click OK when you have defined all of the keys.

Steps to Change or Remove a Key


1. From the Catalog menu, click Tables, and then click the Edit tab. 2. In the Edit tab (Table dialog box), do one of the following: To remove a key for the table, click the column that is defined as a key, click Key and then click OK. To change a key for the table, remove the current key, then select the new column to be defined as a key, click Key, and then click OK. Note: Impromptu inserts a key next to the column name.

Create Joins Automatically After Creating a Catalog


You can create a catalog without defining any table joins, and then later create joins automatically. At any point, you can see exactly which joins are already defined for an existing table.

Steps to View Existing Joins


1. From the Catalog menu, click Joins, and then click the Edit tab. 2. In the Join paths box, click the table you want to view, and then click Show Joins. 3. In the Join paths box, click the table joins to see how individual table columns are joined.

Steps to Create New Joins


1. 2. 3. 4. 5. From the Catalog menu, click Joins, and then click the Edit tab. In the Join paths box, click the table to which you want to add a join. In the Available tables box, click the other table in the join. Click Generate. In the Create table joins for new tables box, click one of the following options: To join tables by the keys you define, click Using keys only. To join tables by the keys you define or the first column with the same name and data type, click Using keys or the first matching column. If both tables have keys defined, Impromptu joins the tables using keys. If one table has a key, Impromptu looks for the first column with the same name and data type in the second table. If neither table has a key, Impromptu looks for the first column in each table with the same name and data type. 6. Click OK to accept your table join setting, and then click OK again. Note: By default, Impromptu joins these tables with an equijoin.

46 IBM(R) Cognos(R) Impromptu(R)

Chapter 3: Work with Joins

Test and Troubleshoot Joins


You can test table joins to identify the tables Impromptu uses when creating reports, and to locate problems that might cause unexpected reporting results. Test results are displayed in either a diagram format or as an expression. You can use the Analyze feature to find unjoined (orphan) tables or circular loops in your join structure. After you receive the diagnosis (No Spanning Tree, Isolated Tables, or Loop message), you may be able to resolve the problem by creating an alias or by editing the join.

Performance Considerations
If the joins between tables are not specified, a cross-product report is generated. These types of reports should be avoided. They take a long time to generate, and can display meaningless results. Joining multiple tables using any matching columns can result in powerful reporting capabilities, but may have performance costs. You might want to restrict joins to those between primary and foreign keys only.

Steps to Test Your Join Strategy


1. From the Catalog menu, click Joins, and then click the Test tab. 2. In the Available tables box, click the tables you want to test, and then click Add. The Join strategy box shows the table joins, including intermediate tables Impromptu uses to create reports based on the selected tables.

Steps to Analyze and Correct Joins


1. From the Catalog menu, click Joins, and then click the Analyze tab. 2. Select the table join you want to analyze. 3. You can correct found problems by doing one of the following: To delete the entire table join, click Remove Join. To create an alias for the table join, click Create Alias. To edit the table join, click Edit Join. When you correct a problem, the next problem automatically appears. To skip a table join problem, click Next to show the next problem. To move to the beginning, click Restart to show the first problem. When you have resolved all table join problems, the Exception box shows an "End of List" message. 4. Click OK.

Resolving No Spanning Tree or Isolated Table Problems


If the message displayed in the Analyze tab is
Exception: NO SPANNING TREE There is no single spanning tree for all tables

or
Exception: ISOLATED TABLE There are no paths defined for this table

then there are single tables, or groups of joined tables, that are not linked to the other tables in the join structure. In the case of No Spanning Tree, a join is missing between groups of joined tables. In the case of an Isolated Table, an orphan table exists. Before you can include information from the unjoined groups or orphaned tables in reports, you must complete the join structure. To solve No Single Spanning Tree and Isolated Table join problems, you can: Join the isolated table(s) with the rest of the join structure. This is usually recommended. Leave the join structure as is. It might not be necessary to join the isolated table, because some reports only require information from a single table.

Administration Guide 47

Chapter 3: Work with Joins

Resolving Loop Problems


If the message displayed indicates that there is a loop in a join structure, then two or more tables are linked together in multiple ways, providing more than one pathway for accessing tables in the database. The culprit in the case of a loop join is often a lookup table, because it is joined to many tables in the catalog. Loop joins can cause the joins generated to be less than optimal, decreasing performance. They might also cause you to receive unexpected results. To solve loop join problems, you can: Leave the join structure as is. Impromptu automatically tries to use the shortest route in joining multiple tables. Leaving the loop structure unchanged may be an acceptable option if the shortest route is the most efficient. But the structure of the database might work against this option, depending on the type of data and the use of indexes. Remove a table from the catalog. This solution requires a re-evaluation of the amount of data that will be included in the catalog and the reporting capabilities possible with the catalog. Remove one or more joins (see the example below). Review your data first, to determine which join is unnecessary. Removing the wrong join might result in duplication of data in a query, and inefficient data retrieval. Create alias tables with separate joins defined for each alias table (see the example below). This strategy requires additional maintenance in both defining the joins and maintaining the folders. In addition, it may result in additional folders which can add to user confusion.

Solving a Loop Join: An Example


The figure below shows an example of a loop join in which tables A and C can be joined through either table B or table E. Table A Table B Table C

Table D

Table E

The result returned when going through table B might be significantly different from the one returned when going through table E. While both queries are valid, only one will return the result that you want. A query might be using the desired path until one additional field is added from a lookup table referenced by more than one of the tables in the original query. The query then contains a loop join, and may use the non-desired path.

Solution 1: Editing the Join Strategy


The figure below shows how the loop join was resolved by removing unnecessary joins. Table A Table B Table C

Table D

Table E

Now, tables A and C can only be joined through table B, and the desired path will be used.

Solution 2: Using Alias Tables


The figure below shows how the loop join was resolved using alias tables, represented in the figure with dotted borders.

48 IBM(R) Cognos(R) Impromptu(R)

Chapter 3: Work with Joins

Table Da Table Ea Table Db

Table A

Table B

Table C

Table D

Table E

Table Ec

We have aliased the lookup tables D and E in order to have one instance for each additional table to which the look-ups are joined. Once again, the only join path from A to C is now through B.

Solving a Reference Table Join Problem: An Example


Frequently, two non-related tables have a common reference table they both use. For example: the Employee table has a Country code that is also in a Country reference table the Supplier table has a Country code that is also in the Country reference table Because of this, a join strategy between these two tables might be established using this reference table as a means of joining the tables. This would be an incorrect join strategy. To correct it, you could add an alias table for the reference table, and change one of the joins for the two tables to the new alias table.

Change Joins
You may need to change the joins if the tables contain columns that should not be joined the database changes and you need to update the joins If you change a join, all reports use the new join. You can change the table joins at any time. You can change a join as a diagram change a join as an expression

Steps
1. From the Catalog menu, click Joins, and then click the Edit tab. 2. In the Join paths box, double-click the table you want to view. 3. In the Join paths box, select the table join you want to change. Impromptu shows the columns in each table and which columns are linked. 4. Click Diagram or Definition. 5. If you clicked Diagram, do one of the following: To change the join type, select two linked columns and click a different join type. To link additional columns, click two columns and click Add Link. 6. If you clicked Definition, select the part of the table join to change. In the Join definition box, click the join components to modify your expression. 7. Click OK.

Remove Joins
You can remove an entire table join or you can remove the link between two columns in a table join. Modifying or removing joins may change the SQL generated by existing reports. You need to confirm the SQL. Administration Guide 49

Chapter 3: Work with Joins

Steps
1. From the Catalog menu, click Joins, and then click the Edit tab. 2. In the Join paths box, select the table you want to view, and then click Show Joins. 3. In the Join paths box, do one of the following: To remove a join, select the table join in Joins paths that you want to remove, and then click Remove. To remove a link, select the table join you want to remove. In the Diagram view, click the Join Operator box for the columns that are linked together, and then click Remove Link. 4. To remove other table joins or links, repeat step 3. 5. Click OK.

50 IBM(R) Cognos(R) Impromptu(R)

Chapter 4: Working with Stored Conditions and Calculations


A condition (also called a filter or a filtering condition) is a business rule or calculation that evaluates to a true-false value. For example, this condition uses a tables Country column to filter data so that only North American data is included in a report:
Country in (United States, Canada, Mexico)

A calculation is an expression that uses existing data items to calculate a new data item. Use calculations to summarize data or perform calculations on data. For example, you can define a calculation that gives the discounted price for a preferred customer. Storing conditions and calculations in a catalog saves you and your users time, because you do not have to re-create frequently-used expressions for re-use in reports. You can define the same expression once, maintain it centrally, and re-use it in all of your relevant reports. For example, you can ensure that Low Margin figures always mean the same thing. This calculation uses the existing items of Price and Cost to calculate a value for Low Margin:
if ((Price - Prod Cost) <= 0.20 * Price) then (Low Margin) else NULL

If you change the stored calculation for Low Margin, all reports that use the Low Margin calculation are updated automatically. You can use filters to limit the data that certain user classes can see. You can also organize your conditions and calculations so they are easy to find. For example, create a folder called Exception Conditions to hold all conditions that track exceptions. For more information, see "Work with Folders and Folder Items" (p. 37).

Building Expressions
To create a calculation or condition, you define an expression using the syntax rules enforced by Impromptu. You select expression components from a list of available components that make sense in the given expression context. The components of an expression can include: Functions, Summaries, Values, Catalog Columns, and Operators.

Functions
The Functions folder in the Available Components box contains functions provided by Impromptu or by your database. These are pre-defined calculations, such as string, numeric, and date calculations, that are designed to operate on various data types.

Summaries
Summaries calculate additional data items by applying a mathematical procedure to selected data items in a report or catalog. They include: Average: Returns the average value of selected data items Count: Returns the number of selected data items Maximum: Returns the maximum value of selected data items Minimum: Returns the minimum value of selected data items Percentage: Returns the percent of the total value for selected data items Percentile: Returns the percentile value of selected data items Rank: Returns the rank value of selected data items Running-Average: Returns the running average value of selected data items

Administration Guide 51

Chapter 4: Working with Stored Conditions and Calculations Running-Count: Returns the running count of selected data items Running-Maximum: Returns the running maximum of selected data items Running-Minimum: Returns the running minimum of selected data items Running-Total: Returns the running total of selected data items Total: Returns the total of selected data items Standard Deviation: Returns the standard deviation of selected items

Summary results depend on the set of data that is summarized. For example, if a column of data is grouped in your report, then a different result will be created for each of those groups from the single application of a summary.

Values and Catalog Columns


Values include string, number, date, time, date-time, and interval. They can be entered into the expression in three ways: From the Value folder as a string, numeric or data. Values are typed directly into the expression once the type of value is determined. Remember to press Enter to complete the entry. From the catalog data, by referencing database columns directly. From the report data, by referencing items already in the report. When you select a string, Impromptu inserts two quotation marks and positions the cursor between them. You enter the string between the quotation marks. When you select a number, Impromptu inserts the number 0. You overwrite it with the number you want included in the expression. When you select date-time values, Impromptu inserts the current date and/or system time in quotation marks. You can overwrite it with other data values.

Operators
Operators specify what happens to the values on either side of the operator. There are four types: logical operators define a relationship between two parts of an expression (for example: and, not, or) arithmetic operators perform arithmetic operations on two parts of an expression (for example: +, -, *, /) string operators concatenate two character strings (+) comparison operators filter data by comparing one or more values that you enter against the values in the database (for example: like, =)

Expression Editing Permissions Depend on Catalog Type


Depending on the catalog type, your users may or may not be able to use all of the functionality related to conditions and calculations. If your users are using a Catalog that they created Then your users Can create, use, change, rename, and remove conditions.

Personal distributed catalog or a shared catalog Can create, change, rename, and remove and you have enabled them to use the Folders conditions. command Your users can use conditions you create in their filters, conditional formatting, and calculations. Your users cannot change, rename, or remove conditions that you create.

52 IBM(R) Cognos(R) Impromptu(R)

Chapter 4: Working with Stored Conditions and Calculations If your users are using a Then your users

Personal distributed catalog or a shared catalog Can use conditions you create in their filters, conditional formatting, and calculations. and you have prevented them from using the Folders command Your users cannot create, change, rename, or remove conditions. Secured catalog Cannot create, use, change, rename, or remove conditions.

Store a Condition or Calculation in a Catalog


It may be appropriate to store each condition in a separate folder in the catalog. Some examples of separate folders that can be used to store conditions are: Time periods. These could contain conditions for fiscal years, quarters, YTD, QTD, Year-over-Year, current month Year-over-Year, and so on. Geographic. These could contain conditions for individual locations, or geographic reporting roll-ups. Functional. These could contain summary filters on levels of the product hierarchy or distribution channels Calculations can be stored next to the data items used to create them.

Example
One of the complaints you have received about reports over the years is that there arent enough standards. Often reports do not agree from one region to the next. For example, a calculation of year-to-date sales and profit margins from Europe is calculated differently than the same figure for North America. This occurs because the managers for these regions use their own calculations to derive these values. As a result, a comparison of profit margins between the two regions is difficult. In the Great Outdoors catalog, to track levels of sales representative performance across regions, you create catalog conditions that isolate normal sales versus those that didnt close within a specified number of days: Sale Closed On Time, where the condition is Day(Closed Date - Order Date) <= 5 Sale Closed Late, where the condition is Day(Closed Date - Order Date) > 5

Steps
From the Catalog menu, click Folders. Click Condition or Calculation, as appropriate. In the Name box, type a name for the condition or calculation. Build an expression. For more information, see "Building Expressions" (p. 51) and the Expression Editor User Guide. 5. Click OK. Note: If you select a folder, the new expression appears before the selected folder. If you do not select a folder, the new expression appears at the end of the list. 6. Click OK. 1. 2. 3. 4.

Store a Summary in the Catalog


You can store a frequently used summary in the catalog so you do not have to re-create it in every report. You can store only summaries that already exist in a saved report in the catalog.

Administration Guide 53

Chapter 4: Working with Stored Conditions and Calculations To store a summary in the catalog, generate a folder based on the report containing the summary, and then delete all data items but the summary from the folder. You need to enable your users to use the Folders command.

Example
You routinely summarize the quantity of a product sold at the various levels of your operations. You store a Total (Qty) summary in the catalog to use it later in any report.

Steps
1. 2. 3. 4. 5. 6. 7. Close all open reports. From the Catalog menu, click Folders. Click Generate. Click Report, and click OK. Click the report containing the summary you want to add to the catalog and click OK. Open the new folder and click the data items you do not want to add to the catalog. Click Cut, and click OK.

Use a Stored Condition in a Calculation


You can use conditions in an if/then calculation to create a more complex calculation. For example, to convert American prices to Canadian currency without changing the original American prices, create this calculation:
if (North_American_Customer) then (Product_Price * 1.43) else (Product_Price)

In this calculation, "North American Customer " is a condition stored in the catalog.

Steps
1. Open a report. 2. From the Report menu, click Query, and then click the Data tab if you opened a list report the Crosstab tab if you opened a crosstab report 3. Click the calculation button. 4. In the Available components box, double-click If and then double-click Catalog Columns. 5. Select the condition you want to use and click OK. The selected condition appears in the Expression box. You can use the condition from the catalog on its own or you can add to the condition. 6. Click OK.

Use a Stored Calculation in a Report


You can use a calculation that is stored in a catalog in a report.

Example
You use a calculation that calculates the discounted price for a valued customer.

Steps
1. Open a report. 2. From the Report menu, click Query, and then click the Data tab if you opened a list report the Crosstab tab if you opened a crosstab report 3. In the Catalog box, select the calculation to use. 4. Click Add, and click OK.

54 IBM(R) Cognos(R) Impromptu(R)

Chapter 4: Working with Stored Conditions and Calculations

Use a Stored Condition as a Filter


You can use a stored condition as a filter in a report, for example to retrieve data that falls between two dates.

Steps
Open a report or template. From the Report menu, click Query, and then click the Filter tab. In the Available components box, click Catalog Columns. Select the condition you want to use and click OK. Note: The selected condition appears in the Filter Definition box. You can use the condition from the catalog on its own or you can add to the condition. 4. Click OK. 1. 1. 2. 3.

Use a Stored Condition in Conditional Formatting


You can use a condition stored in the catalog in conditional formatting, for example to show sales figures below quota in red.

Steps
1. 2. 3. 4. 5. 6. 7. In a report or template, select one or more report objects. From the Format menu, click Conditional Formats. Click Conditions. Click Add Catalog Condition. In the Catalog folders box, click the condition, and click OK. Click Close. From the Change style to box, select the style, or create your own style, and then click OK to associate your condition with a style. 8. Click OK.

Change a Stored Condition or Calculation


You can change a condition or calculation stored in the catalog at any time.

Example
You define a condition that sets a region to consist of certain states. If another state is added to the region, you add the new state to the condition once. All reports using the condition change to show the new state in the region.

Steps
1. 2. 3. 4. 5. 6. 7. Close any open reports. From the Catalog menu, click Folders. In the Catalog folders box, click the condition or calculation you want to change. Click Edit. Click the part of the expression you want to change. Change the expression and click OK. Click OK.

Administration Guide 55

Chapter 4: Working with Stored Conditions and Calculations

56 IBM(R) Cognos(R) Impromptu(R)

Chapter 5: Working with Prompts


A prompt is an expression that you set up, to enable users to specify selection criteria when generating their reports. Prompts help users quickly find the information they need from a report. For example, you can define a prompt that enables sales representatives to select customer sites by city. Or your prompt can ask your users to specify a date range for the data to be included in the report:
Enter the Start Date of the date range Enter the End Date of the date range

There are two kinds of prompts: picklist and type-in. For type-in prompts, the user types a value on which the report filter is based. Picklist prompts retrieve their values from a text file (file picklist), from a data item in another report (report picklist), or from a data item the catalog (catalog picklist). Cascading prompts are picklist prompts that use information from a previous prompt to determine which options to display in the picklist. You can view the hierarchy for any cascading prompt, including the definitions and data requirements at each level. For more information about creating cascading picklist prompts, see the PowerPrompts Reference online book.

What You Can Do


You can store a prompt in a catalog, add a prompt stored in the catalog to a report, and modify or delete any prompt in the catalog. You can use the Prompt Manager to create new prompts in a report re-order the prompts modify existing prompts in the report delete prompts from the report You can access the Prompt Manager using OLE automation. For more information, see the Impromptu Macro online help.

Example
You create a report listing current product inventory and price. The report is long and users have to scroll through all the data to locate specific price and stock information. To make the report more usable, you create a prompt to enable users to pick the name of the item whose price and stock data they want to see. You store the prompt in the catalog so all users can use the prompt.

Limitations
Impromptu does not allow circular prompt references: you cannot create a prompt using a data item from the report you are viewing. You can however, make a copy of your report, and create a prompt using the data item from the copied report. If you use the characters, '|' or ',' as prompts when opening a report, the report will fail. If you want to use these characters in prompts, precede them with the '%' character, for example, '%|' or '%,'.

Create a Catalog Prompt


You can create a catalog prompt, so you and your users can use it in any reports that are based on the catalog.

Administration Guide 57

Chapter 5: Working with Prompts For example, you can define a Start Date and End Date and prompt for the date range during report generation. The prompts you define are available to all your users, but users cannot delete or modify catalog prompts.

Steps
1. Open or create a catalog. 2. From the Catalog menu, click Folders. 3. Click Prompt. The Prompt Definition dialog box appears. 4. In the Name box, type the name of the prompt to appear in the Folders dialog box. 5. In the Message box, type the message users see in the Prompt dialog box when the report opens. 6. From the Type box, click the type of prompt you want to create. If you click Type in, the user types a value on which the report filter is based. You define the type of value in the Data type list box. In the Default value box, type a default value to use if the user does not type anything. Date, time and date-time values are initialized to zeros in the ISO date-time format. If you accept the initial values, then at run time, the default prompt value is set to the current date and time in the users locale. If you click File picklist, the user selects a value from an existing text file that contains one value on each line. Click Browse to specify the file to use for the picklist values. If you click Report picklist, the user selects a data item for filtering from an existing report. Click Browse to specify the report. Select the report data item from the list. If you want the user to select one data item in the prompt (for example, Store Name) but have a different item appear in the report (for example, Contact Person), select a data item and click Display to use it in the prompt, and then select a different item and click Use for the corresponding item to appear in the report. If you click Catalog picklist, the user selects a data item for filtering the report from the catalog; select the catalog data item from the Catalog Columns. If you want the user to select one data item in the prompt (for example, Store Name) but have a different item appear in the report (for example, Contact Person), select a data item and click Display to use it in the prompt, and then select a different item and click Use for the corresponding item to appear in the report. Note: The default maximum number of entries in a file picklist is 100. You can change the default value using the Picklist Limit property in Configuration Manager. For more information, see the IBM Cognos Configuration Manager User Guide. In the Order box, click Ascending, to sort a file picklist prompt in ascending order. 7. If you are defining a prompt for use in stored procedure reports, click Advanced and check the settings in the table below. Otherwise, go to step 8. For Database data type Use the default value Do the following Specify the data type of the stored procedure parameter. Select to use the default value specified for the Type In prompt. Use for stored procedure parameters that are constants; the user will not be prompted to provide any value. Specify (in bytes) the size of the stored procedure parameter. Specify the total number of digits on either side of the decimal point that can be represented by this prompt. Specify the order of magnitude of the number. For example, if the scale is two, the number 1234 is displayed as 12.34 (because the decimal point is moved two places to the left).

Size Precision Scale

58 IBM(R) Cognos(R) Impromptu(R)

Chapter 5: Working with Prompts 8. Click OK to create the prompt and return to the Folders dialog box. Tip: You can review existing reports to determine commonly used prompts that you want defined in the catalog.

Modify a Catalog Prompt


You may want to change the text that shows in a prompt when users open a report. You can also change the filter values that show in the prompt, so the users can filter the report on a new set of values.

Steps
1. 2. 3. 4. 5. Open or create a catalog containing a prompt. From the Catalog menu, click Folders. Click the prompt you want to change, and click the Edit button. Change the prompt as required. Click OK twice.

Use a Catalog Prompt in a Report


You can use prompts stored in the catalog in your reports. This enables you to re-use your most frequently used prompts without having to re-create them for every report.

Steps
Create or open a report that uses a catalog containing a prompt. From the Report menu, click Query. Click the Filter tab, and define an expression for the filter. Double-click Catalog Columns to open the Catalog dialog box. Click the prompt you want to insert, and click OK. Note: A prompt is identified by the question mark icon. 6. Finish defining the filter expression and click OK. 1. 2. 3. 4. 5.

Remove a Catalog Prompt from a Report


You can remove a catalog prompt you no longer need from your report. The Prompt Manager still shows the catalog prompt although it is not being used in your report.

Steps
1. 2. 3. 4. Create or open a report that uses a prompt from the catalog. From the Report menu, click Query. Click the Filter tab. Click the prompt expression and press Delete to remove only the prompt. Note: Click Clear to remove the entire filter expression, including the prompt.

Create a Report Prompt


You can create a prompt for the current report, including a stored procedure, if required. For more information, see "Work with Stored Procedures" (p. 95). You can drag and drop prompts to re-order them in the Prompt Manager. The report user sees the prompts in the resulting order.

Steps
1. Create or open a report. 2. From the Report menu, click Prompt Manager. 3. Click New.

Administration Guide 59

Chapter 5: Working with Prompts 4. In the Name box, type the name the prompt to appear in the Folders dialog box. 5. In the Message box, type the message users see in the Prompt dialog box when the report opens. 6. From the Type box, click the type of prompt you want to create. If you click Type in, the user types a value on which the report filter is based. You define the type of value in the Data type list box. In the Default value box, type a default value to use if the user does not type anything. Date, time and date-time values are initialized to zeros in the ISO date-time format. If you accept the initial values, then at run time, the default prompt value is set to the current date and time in the users locale. If you click File picklist, the user selects a value from an existing text file that contains one value on each line. Click Browse to specify the file to use for the picklist values. If you click Report picklist, the user selects a data item for filtering from a saved report. Click Browse to specify the report. Select the report data item from the list. If you want the user to select one data item in the prompt (for example, Store Name) but have a different item appear in the report (for example, Contact Person), select a data item and click Display to use it in the prompt, and then select a different item and click Use for the corresponding item to appear in the report. If you click Catalog picklist, the user selects a data item for filtering the report from the catalog; select the catalog data item from the Catalog Columns. Note: The default maximum number of entries in a file picklist is 100. You can change the default value using the Picklist Limit property in Configuration Manager. In the Order box, click Ascending, to sort a file picklist prompt in ascendinlg order. 7. If you are defining a prompt for a stored procedure report, click Advanced and check the settings in the table below. For more information, see "Insert Parameters in a Stored Procedure Call" (p. 96). Otherwise, go to step 8. For Database data type Use the default value Do the following Specify the data type of the stored procedure parameter. Select to use the default value specified for the Type In prompt. Use for stored procedure parameters that are constants; the user will not be prompted to provide any value. Specify (in bytes) the size of the stored procedure parameter. Specify the total number of digits on either side of the decimal point that can be represented by this prompt. Specify the order of magnitude of the number. For example, if the scale is two, the number 1234 is displayed as 12.34 (because the decimal point is moved two places to the left).

Size Precision Scale

8. 9. 10. 11. 12. 13.

Click OK to create the prompt and return to the Prompt Manager dialog box. Click OK. From the Report menu, click Query. Click the Filter tab and define an expression for the filter. In the Available components box, click Prompt Manager to show the defined prompts. Click the prompt you created, and click OK. Finish defining the filter expression and click OK.

Modify a Report Prompt


You can modify the name and other properties of a prompt you create in a report.

60 IBM(R) Cognos(R) Impromptu(R)

Chapter 5: Working with Prompts

Steps
1. 2. 3. 4. Create or open a report that containing a prompt. From the Report menu, click Prompt Manager. Click the prompt you want to modify, and click Edit. Changes the prompt as required and click OK twice.

Administration Guide 61

Chapter 5: Working with Prompts

62 IBM(R) Cognos(R) Impromptu(R)

Chapter 6: User Profiles and Data Access Requirements


If you had to create and maintain a different catalog for each group of users in your organization, your task as an administrator would be huge. But with Impromptu you can define different user classes for different communities who use the same catalog. When you set up user classes, you are creating gateways for different types of users, while retaining a single point of maintenance for yourself. As you create user classes below other user classes, the security settings are inherited. The combination of user class and inherited security means you can create a single catalog and a few reports. Impromptu automatically channels the right data to the right people, based on your security settings. For example, managers and their employees may use the same catalog, but only the managers can view employee salary data. By creating two user classes, one for the managers and one for the employees, you can ensure that the employee user class cannot view restricted salary information. You can share some of the administrator responsibilities by enabling one or more user classes to create subordinate user classes. For example, you could create a user class called Team Leaders, and allow the team leaders to create user classes for their team members. Note: If Access Manager is installed on your computer, then security could be controlled by Access Manager. For more information, see "Use Access Manager to Control Security" (p. 67).

Analyze User Requirements


Users are typically knowledge workers who need to generate a variety of reports. Depending on the privileges you assign them, and the type of environment you set up for them, they might or might not be able to print reports create their own reports customize their environment by modifying a catalog work with automated tasks or automate their own tasks provide limited administrative support to other users create reports accessible to disabled users To determine user requirements, you might want to interview representatives of different user groups to assess their levels of knowledge and technical expertise, and to determine their functional areas and hierarchical levels.

Determining User Classes


You can group users in many ways, including: by data requirements (for example, all managers requiring data on employee salaries) by departments or divisions within the organization (for example, the European sales region) by function (for example, an intermediate level administrator who administers a catalog for a functional group of users) When you create a catalog, the Creator user class is set up automatically. Users in this class have full control over the catalog. If the catalog you create is a shared, distributed, or secured catalog, an additional class named User is set up as a subset of Creator. The privileges of the users in this class depend on the type of catalog created.

Administration Guide 63

Chapter 6: User Profiles and Data Access Requirements Once you have created a catalog, you can define additional user classes. Create at least one user class based on the Creator user class, and then do one of the following: continue to base new user classes on the Creator user class use your new user class as the base or parent for each child class As you create new classes, you can set security by value and by field, and tailor the business view for each class. You can also edit and delete user classes, to accommodate re-organizations, activity changes, and personnel changes. User classes must be unique for each catalog; you cannot have two classes with the same name. Also, be careful when deleting user classes, because subclasses of the class you delete are also deleted.

Determining the Domain of Data


Once you know the user classes you need, you can determine the domain of data in your database to which each user class needs access. Knowing this will help you determine the type of Impromptu catalog to set up, the tables to include in the catalog, the joins to make between tables, and the folders and columns to include. When you have discussed the users requirements with them, and analyzed their needs, you can systematically break the requirements down into "What information does the user want, by what." What they want to see translates into data columns in Impromptu. The "WHAT they want BY" determines the column groupings they require.

Example 1: A Sales Analysis


The domain of data for a sales group might look like this: 1 Products Product lines Brands Products Stock Keeping Unit (SKU) 2 Time Years Quarters Months 3 Organizations Sales Divisions Sales Districts Sales Reps 4 Customers Sales Rank Customers 5 Indicators Units Ordered Number of Orders Order Value $ Revenue Discount Average Selling Price The columns in the table represent the information users will need: An additional report might be needed with customer details such as name, phone number, balance outstanding, and similar information.

Example 2: A Regional Breakdown


As database administrator, you must provide access to data for: senior sales managers regional sales managers country managers sales representatives sales outlets (customers)

64 IBM(R) Cognos(R) Impromptu(R)

Chapter 6: User Profiles and Data Access Requirements The reporting needs vary greatly from one class of user to the next. Senior sales managers want concise reports of sales figures on a regular basis, and some of them want the ability to create their own custom reports. The corporate head office needs reports on a company-wide basis, while regional offices want reports for their regions only. Each regional and country office has its own distinct reporting needs, and the sales policies and procedures vary from region to region. You set up the following user classes to meet these needs: Sr Sales Mgr Prod ReportsHas access to all data, with several special managerial-level folders set up to highlight pertinent sales trends and reports. This is a secured user class, meaning that report users cannot create or change reports. This meets the requirement for pre-packaged production reports for your senior managers. Sr Sales Mgr Ad Hoc ReportsThis user class is not secured, so report users can create new reports or change existing ones. Regional ManagerHas access to only the tables, folders, and data values that apply to his or her region. The regional manager acts as a regional report administrator, adding user classes as required and setting up folders to match the specific business view of his or her region. All user classes that a regional manager creates or modifies automatically inherit the security restrictions for that regional manager. Country ManagerInherits the restrictions that apply to a regional manager. Each regional manager imposes further restrictions on tables, folders, and data values for the countries within his or her region. Country Sales RepInherits the restrictions that apply to a country manager. Each country manager imposes further restrictions to the data for his or her sales representatives. As a result, each sales representative can see data for his or her customers, and is prohibited from seeing the sales records of other salespeople. OutletsHas access only to data about company products, excluding pricing and sales data. This is a secured user class, meaning that customers cannot alter the reports you provide them. This meets the requirement for electronically distributing an online brochure of your products while maintaining tight security.

Determining the Data Elements


You will need to determine how to map the elements defined in the domain of data to elements defined in the database, keeping in mind that: some elements may not be available some elements need to be derived some elements can be in more than one place, or have different names When doing this type of analysis, you might find it helpful to make a sketch of your database, showing the table joins you need to ensure that users can access the data they need.

Planning on Change
It is important to be as precise as possible when determining user requirements, but it is next to impossible to define them exactly. Requirements typically are not fixed; they change from day to day with changing business issues. Instead, when planning your Impromptu environment, keep in mind that you are documenting the domain of data that your users think they need, plus some representative standard reports based on this domain. As users become proficient with Impromptu, they will probably create their own reports, and take on more responsibilities. But you will likely still need to add or remove data items from the users domain of data.

Create a User Class


When you create a shared, secured, or distributed catalog, Impromptu automatically creates two user classes: Creator and User. From the Creator user class, you can create, change, and remove user classes. You can also create, change, and remove any subordinate user classes if your user class has the appropriate access. Administration Guide 65

Chapter 6: User Profiles and Data Access Requirements A member of the catalog Creator user class can lock a catalog. When a catalog is locked, members of the Creator user class must provide an additional password to open the catalog. Other user classes can open a locked catalog as read-only. Each child user class inherits the same set of privileges and restrictions as the parent user class on which it is based. User classes are shown as a parent-child hierarchy in the User Classes tab (User Profiles dialog box).

Limitations
Only the Creator user class can add or modify the user classes defined in a master distributed catalog. Child user classes can have fewer but not more, privileges than the parent user class.

Example
You set up a user class for the Sales department that lets them see only sales data. You then set up another user class in the same catalog for the Accounting department that lets them see only financial data. When the catalog is secured by a namespace, user classes in the catalog must also exist in the namespace.

Steps to Create a User Class


1. From the Catalog menu, click User Profiles, and then click the User Classes tab. 2. Click the user class on which you want to base the new user class. Note: You may need to double-click a user class to see the hierarchy of subordinate classes within this catalog. 3. Click Add. 4. In the Class name box, type a unique name for the new user class. 5. If you want to protect this catalog, type a password in the User class password box. 6. In the Verify box, type the password again to verify the password set in step 5, and then click OK. 7. Repeat steps 2 to 6 to create additional user classes and click OK. Click Cancel to close the User Profiles dialog box without creating the user class.

Steps to Allow a User Class to Create Other User Classes


1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. Select the Add/modify user classes check box, and click OK.

Edit a User Class


You can edit user classes. You can assign or change the password for the Creator user class. If you have appropriate access, you can edit the user class names and passwords. You cannot edit the user class that you are currently logged on with, unless you are logged on as a Creator user class.

Steps
1. From the Catalog menu, click User Profiles, and then click the User Classes tab. 2. In the User Class box, click the user class you want to edit. Note: You may need to double-click a user class to see its hierarchy of subordinate classes within the catalog. 3. Click Edit. 4. If you want to edit the user class name, type a new name for the user class in the Class name box.

66 IBM(R) Cognos(R) Impromptu(R)

Chapter 6: User Profiles and Data Access Requirements 5. If you want to assign or edit the password, type the new password in the User class password box. For more information, see "Assign or Change a Password for a User Class" (p. 69). 6. In the Verify box, type the password again, and then click OK, to verify the password edited in step 5. 7. Repeat steps 2 to 6 to edit other user classes, and click OK.

Remove a User Class


You can remove subordinate user classes that are no longer required. You cannot remove the Creator user class. Use caution when deleting user classes, as all subordinate classes (child) of the user class (parent) are automatically deleted.

Steps
1. From the Catalog menu, click User Profiles, and then click the User Classes tab. 2. In the User Class dialog box, click the user class you that want to remove. Note: You may need to double-click a user class to see its hierarchy of subordinate classes within the catalog. 3. Click Remove. 4. Repeat steps 2 and 3 to remove other user classes, and click OK.

Use Access Manager to Control Security


Impromptu comes with Access Manager, a set of tools you can use to control security for all your IBM Cognos products. You may want to use Access Manager with Impromptu catalogs to avoid forcing users to log on more than once when they move between applications. Access Manager also allows you to administer security for all your catalogs in one place instead of maintaining separate security structures for each catalog. To integrate with Access Manager, you must ensure that Access Manager is installed and configured properly on your computer.This includes specifying a default namespace for your computer. For more information, see the Access Manager documentation. the user classes in your catalogs match the user classes in your Access Manager namespace Access Manager uses LDAP technology: a list of users and user classes and the corresponding passwords and permissions are stored in a namespace on a directory server. When you log on to an IBM Cognos product, Access Manager prompts you for signon information. It then checks the namespace specified in the Catalog Properties dialog box, to determine whether you have the appropriate access privileges. If Access Manager finds your signon in the namespace, it determines which user classes you belong to and checks the catalog. If you belong to one user class that exists in the catalog, Access Manager logs you on using that user class. If you belong to more than one user class that exists in the catalog, Access Manager prompts you to pick a user class, then opens the catalog. If you use Access Manager to control security for more than one catalog, you must ensure that the user classes in all your catalogs are synchronized. Also, each catalog automatically contains a Creator user class. If you add a user to the Creator user class in Access Manager, that user will have access to all your catalogs. If you want restrict access available to the Creator user class, you can lock the catalog. For information about locking a catalog, see "Control Access Using a Catalog Lock" (p. 73).

Security When You Don't Specify a Namespace


If you dont specify a namespace, but you have Access Manager set up on your computer, Impromptu checks a default namespace first. If you arent listed in the default namespace, you can still log on using catalog security. You can also use Access Manager to add your operating system user name and password to the namespace so that you can log on to the catalog automatically.

Administration Guide 67

Chapter 6: User Profiles and Data Access Requirements Note: If Access Manager isn't on your computer, then security is in based in the catalog. For more information about catalog-based security, see "User Profiles and Data Access Requirements" (p. 63). For more information, see the Access Manager Administration Guide.

68 IBM(R) Cognos(R) Impromptu(R)

Chapter 7: Techniques for Controlling User Access


By default, all user classes have access to all data in the catalog. However, as a member of the privileged Creator user class, there are a number of ways to set up access security for your database. You can: assign passwords to user classes to restrict access to sensitive data, or to provide a more focused view of the information in the Impromptu database; see "Control Access Using Password Authentication" (p. 69). define access privileges at the column, table, or folder level, or for a specified filter value in the catalog; see "Control Access to Objects" (p. 71). identify which user classes can edit the catalog structure, create and edit reports, enter SQL directly, or define subordinate user classes. For more information, see "Control Access to Impromptu Functionality" (p. 74). To set user environment controls for a hierarchy of user classes, change the user class at the top of the hierarchy. Subordinate user classes inherit controls and settings from the user class at the top. Although a restriction for a user class is inherited by all child classes, when you grant a privilege for a user class, that privilege is not inherited by all its child classes. Any user class with the appropriate permissions may control the environment for subordinate user classes. For example, as a member of the Managers user class you have permission to control the environment for a subordinate Employees user class. For more information about defining user classes appropriate to your needs, see "User Profiles and Data Access Requirements" (p. 63).

Control Access Using Password Authentication


You can protect a catalog by assigning a password to a user class, which all user class members must enter to use the catalog. Passwords are case-sensitive, and can consist of alphanumeric characters and spaces. You can: create user classes that match the needs of your user community protect catalogs by assigning passwords to each user class accessing that catalog store database user IDs and passwords within the catalog

Assign or Change a Password for a User Class


When you set up a user class, you can assign it a password. Users in that class will be prompted when they attempt to use a catalog. To change a password, you edit the user class definition. If a user forgets the user class password, and for some reason you have no record of it, you as the Creator can create a new password. But if you forget the Creator password you cannot create a new one; you must recreate the catalog.

Steps
1. From the Catalog menu, click User Profiles, and then click the User Classes tab. 2. In the User Class dialog box, click the user class you want to modify. Note: You may need to double-click a user class to view its hierarchy of classes within the catalog. 3. Click Edit. 4. In the User class password box, type the new password, or change the existing password. 5. In the Verify box, type the password again to verify the password. Administration Guide 69

Chapter 7: Techniques for Controlling User Access 6. Click OK, and click OK again to close the User Profiles dialog box.

Remove a Password from a User Class


You can remove the password you have set for any user class. To remove a password, you edit the user class definition.

Steps
1. From the Catalog menu, click User Profiles, and then click the User Classes tab. 2. In the User Class box, click the user class you want to modify. Note: You may need to double-click a user class to view its nested hierarchy of classes within the catalog. 3. Click Edit. 4. In the User class password box, click the password and press the Delete key. 5. Click OK, and click OK again to close the User Profiles dialog box.

Store a Database Password for a User Class


You can maintain security and simplify login by suppressing the prompts for the database user ID and password. Impromptu does this by embedding the user ID and password within the user class profile. Impromptu stores user IDs and passwords in an encrypted format in the catalog. This allows users to access a database without knowing what user name or password is being used. If the database server has enabled password aging, and a password has expired, the catalog entry must be updated before the user can connect to the database again. If the password is embedded in the catalog, make sure that password aging is not applied. If password aging is applied, when a password expires the user will be unable to define a new password and unable to access the catalog. If you use password aging, place the password in the Database account.

Example
The Great Outdoors database is updated by sales staff as new orders are placed. On an average day, this can mean a few thousand transactions. You decide to allow managers to view data that is currently being updated by another user. This gives your sales managers the most up to date information possible. To remove the necessity for your managers to remember multiple user IDs and passwords for the information they need to access, you set the Senior Sales Manager user class so that it automatically attaches to the database with a specific user ID and password that Impromptu stores in the catalog. You do the same thing for customers who need access to the online company product brochure.

Steps
1. 2. 3. 4. 5. 6. From the Catalog menu, click User Profiles, and then click the Database tab. In the User class box, click the user class you want to modify. Click the Database logon option button. In the User ID box, type the database user ID. In the Password box, type the database password. In the Verify box, type the password again, and then click OK.

Prompt a User Class for a Database Password


By default, Impromptu prompts user classes to enter the user ID and password for the database each time they run a series of reports. The Database tab of the User Profiles dialog box is available only for databases that support certain options. If the tab is available, you can use it to:

70 IBM(R) Cognos(R) Impromptu(R)

Chapter 7: Techniques for Controlling User Access predefine database logon information set up a prompt for a password when a user class attempts to access the database

Steps
1. From the Catalog menu, click User Profiles, and then click the Database tab. 2. In the User Profiles dialog box, click the user class you want to modify. 3. Click the Prompt for database security option button, and click OK.

Test User Access


You can test the catalog for each of your user classes, checking to make sure that it meets users' requirements before giving it to them. You can then refine the catalog before users work with it. You can also easily change the catalog after giving it to your users. Your users will get the latest version of the catalog automatically.

Steps
To test how the catalog works for your users, change your user class to one of the user classes you created. 1. From the Catalog menu, choose User Class. 2. In the User class box, select one of your Manager user classes. Click OK. 3. Click the Catalog menu. Notice that commands that are unavailable to the Managers are grayed. For example, they cannot update the catalog or access the Tables or Joins selections. But they can set up user classes based on their own class, and they can organize Folders. 4. From the Catalog menu, click User Profiles. Click the Governor tab. Managers can view and change the user classes below them in the hierarchy, but cannot change their own access privileges. 5. Click OK. Return to the Catalog menu and change the user class to one of the lower level user classes. Look at the Catalog menu again. 6. Notice that the lower-level user class is more restricted than the Manager user class. Unlike managers, the lower-level user class cannot modify Folders or User Profiles.

Control Access to Objects


You can control access to sensitive or protected data by limiting the access of specific user classes. You can also re-instate user class access to data. You can use the Impromptu catalog (User Profiles) for this purpose, or Access Manager. For more information, see "Use Access Manager to Control Security" (p. 67) and "Security Interaction With Impromptu Web Reports" (p. 169).

Control Access to Tables or Columns


You can enable or prevent user class access to specific tables or columns in the catalog. When you control access to the entire table, access is prohibited to all of the table's columns. When access to a table is denied, any reference to that table in a report will result in a query execution error. You can also give a user class access to a table but not to a folder. Users in the class can then run a report that uses the table, but cannot change the report. If a user class is denied access to a column in a table, the user cant run existing reports accessing the column. If a user class is granted access to a column in a table, but denied access to the same column in a folder, the user can run an existing report showing the restricted column. The user cannot create a new report using that column, however, because it does not appear in the catalog. If access is denied at the parent level of a class hierarchy, then all child classes below that parent are automatically also denied access.

Administration Guide 71

Chapter 7: Techniques for Controlling User Access

Example
In order to secure product sales information from your customers, you set security by field so that the user class Outlets can see only the product information you want them to see. In this case, you want to grant them access to the following information: product number product name product type and line product picture To do this, you deny the Outlets user class access to all tables but Products. Within the Products table, you deny the Outlets user class access to all columns except Prod_No, Product, Prod_Type, Prod_Line, and Picture.

Steps
1. 2. 3. 4. 5. From the Catalog menu, click User Profiles, and then click the Table Access tab. In the User class box, click the user class you want to modify. In the Catalog tables box, double-click the appropriate table. Select the appropriate column, table, or database. Click Grant Access to enable access, or click Deny Access to prevent access, and then click OK. Note: An icon beside the name of the column, table, owner, or database indicates if access is denied.

Control Access to Folders and Items in Folders


You can enable or prevent user class access to specific folders or folder items in the catalog. This is useful because a catalogs folder structure is typically organized by business view, group, or perspective. Security by business view prevents users from seeing folders that contain sensitive data they are not allowed to see. For example, you can restrict members of a user class from accessing data from another department. Folder access can be granted or denied for each user class. If access is denied at the parent level of a class hierarchy, all child classes below that parent are automatically also denied access. When folder access is denied, the user does not see that folder when using the catalog to create or modify reports. You can also apply security governors to top-level folders, nested folders, or individual columns within those folders. By combining the controls available through User Profiles with those available through folder editing, you can achieve the exact folder presentation that you want for each user community.

Steps
From the Catalog menu, click User Profiles, and then click the Folder Access tab. In the User class box, click the user class you want to modify. In the Permission to box, click Access or Select Values as required. In the Catalog folders box, click the folders or items the user class can access or cannot access. Click Grant or Deny. Note: If you deny Select Values to a specific object (such as a folder), the user class cannot perform a select values operation, on any column in that folder or sub-folder. 6. Click OK. Note: An icon appears beside the folder name, indicating if access is denied to this folder. 1. 2. 3. 4. 5.

72 IBM(R) Cognos(R) Impromptu(R)

Chapter 7: Techniques for Controlling User Access

Control Data Access Using Filters


Using the Filters tab of the User Profiles dialog box, you can set up conditional expressions that will filter out unnecessary or sensitive data for a user class, giving you security by value. You can define a filter that provides a more focused view by limiting the scope of data retrieved from a table or column. Filters can also improve performance by limiting the number of records retrieved. All reports using the same filter automatically change when you modify the filter.

Example
To secure data for your regional managers, you set up a filter that grants them access to their own regional data only. When a user class creates a report using the Region table, they see only data for their region. The users do not have to manually filter out data when they create a report. Later, you can modify the filter so that new regions added to the Region table are automatically available to the applicable user class.

Steps to Create or Modify a Filter for a User Class


1. 2. 3. 4. 5. 6. 7. 8. 9. From the Catalog menu, click User Profiles, and then click the Filters tab. In the User classes box, click the user class for which you want to create or modify a filter. In the Catalog tables box, double-click the database component. Select the table for which you want to create or modify a filter. Click Edit. In the Available components box, double-click Catalog Columns. Click the column for which you want to create or modify a filter, and click OK. Build or modify a filter and click OK. Click OK.

Steps to Remove a Filter from a User Class


1. 2. 3. 4. From the Catalog menu, click User Profiles, and then click the Filters tab. In the User classes box, select the user class from which you want to remove a filter. In the Catalog tables box, double-click the database component. Select the table with the filter you want to remove. Note: Tables with associated filters show a filter icon beside their name. 5. Click Clear to remove the filter from the user class, and click OK.

Control Access Using a Catalog Lock


By default, the Creator user class has unrestricted access to a catalog and can restrict access to other user classes. Typically, this is how you want catalog access to be managed. However, there may be certain occasions when you want to restrict access even to members of the Creator user class. You can lock a catalog to further restrict its access to the catalog Creator user class. This added security will prevent all members of the Creator User Class in the Access Manager namespace from accessing this catalog. This security is important where you have multiple catalogs, each with different users who are Creators, and all users are members of the Creator User Class in the same Access Manager namespace. When a member of the catalog Creator user class attempts to open a locked catalog, they must provide password authentication to unlock the catalog before opening it. A catalog lock is specified by the administrator and exists in addition to the common logon authentication required by IBM Cognos products and the catalog logon authentication. If a user, who is not a member of the Creator user class, attempts to open a locked catalog, they are prompted for the usual catalog logon credentials only.

Lock a Catalog
Locking a catalog prevents a user from opening it using the catalog Creator user class, unless the user provides an additional password for authentication.

Administration Guide 73

Chapter 7: Techniques for Controlling User Access After you open a locked catalog using the necessary authentication, you can remove the lock on the catalog. For information about opening a locked catalog, see "Unlock a Catalog" (p. 74).

Steps
1. From the Catalog menu, click Lock Catalog. The Lock Catalog command is only enabled when: the catalog is opened by someone belonging to the Creator user class the catalog is opened in read and write mode 2. In the Lock Catalog dialog box, in the Password box, enter a password. 3. In the Confirm Password box, enter the password again. 4. Click Lock Catalog. When a catalog is locked and a user belonging to the Creator user class tries to open it, the user is prompted to enter a password before gaining access to the catalog. This password is requested in addition to the IBM Cognos Common Logon and the Catalog Logon passwords. Users that do not belong to the Creator user class are not prompted for the Open Locked Catalog password since they do not require Creator privileges.

Unlock a Catalog
Before you can unlock a catalog, you must first open it using the credentials the administrator specified when the lock was created. After you open the catalog, you can then change the status from locked to unlocked. For information about locking a catalog, see (p. 73).

Steps
1. From the Catalog menu, click Open. 2. Browse to the catalog and click Open. 3. If the IBM Cognos Common Logon dialog appears, enter a user id and password and click Log On. 4. In the Catalog Logon dialog box, in the User class box, click Creator, and click OK. If you are a member of the Creator user class that belongs to the catalog namespace, your password is supplied. 5. In the Open Locked Catalog dialog box, enter a password and click OK. The catalog opens. You can now permanently unlock the catalog, if you choose. 6. To remove the lock from the catalog, from the Catalog menu, click Unlock Catalog. 7. In the Unlock Catalog dialog box, click Unlock Catalog.

Control Access to Impromptu Functionality


You can define privileges for one or more user classes, to grant them access to a particular set of Impromptu features and functionality. Specific settings in the Governor tab of the User Profiles dialog box enable you to control processing capabilities by user class. The first block of settings-Sorting on Non-Indexed Columns through Cross-Product Queries (No Table Joins)-permit you to Allow, Warn, or Prevent various options. The warn and prevent message will appear when Impromptu detects the specified condition. The second block of settings determines whether the user can perform the following actions: Create/Edit Reports - See "Control Creating and Editing Reports" (p. 75). Edit Folders - If the Edit Folders checkbox is selected, users in the user class can append folders to the catalog structure and modify the folders. For shared and secured catalogs, this checkbox is cleared. See "Control Editing of the Catalog Structure" (p. 75). Add/Modify User Classes - If this option is selected, users in the user class can create new user classes. This means the users can share some of the Impromptu administrator tasks. For example, you can allow the Managers user class to create user classes for the Employees they manage. See "Control the Ability to Define User Classes" (p. 76). 74 IBM(R) Cognos(R) Impromptu(R)

Chapter 7: Techniques for Controlling User Access Direct Entry SQL - If this option is selected, users in the user class can edit Structured Query Language (SQL) in reports, and the Edit SQL button will be available in the Query dialog box. This is appropriate only for users who have a strong knowledge of SQL. Also, it reduces the portability of the catalog. In most cases this checkbox should be cleared. See "Control the Ability to Enter SQL Directly" (p. 76).

Example
You have two groups of users requiring access to the same catalog. However, one group needs view-only access to standard reports, while the other group needs edit access to the data structure, catalog structure, and reports.

Control Editing of the Catalog Structure


Any user class that can edit the catalog structure has complete read-write access to that catalog. Place catalogs in a read-only directory to prevent users from changing the catalog, even if they have permission to edit the Impromptu folders.

Distributed Catalogs
By default, only the Creator user class can modify the structure of a master distributed catalog. User classes can modify certain aspects of their personal distributed catalog structure. You can prevent a user class from editing the catalog structure.

Shared Catalogs
By default, only the Creator user class can edit the catalog structure of a shared catalog. While you edit the structure of a shared catalog, all other subordinate user classes cannot open the catalog. All user classes use the same copy of the catalog, and you cannot edit the folders until everyone using the shared catalog closes the catalog.

Secured Catalogs
By default, only the Creator user class can edit the catalog structure of a secured catalog.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. Select the Edit folders check box to enable access, or clear the Edit folders check box to prevent access, and then click OK.

Control Creating and Editing Reports


By default, all user classes can create and edit reports. You can prevent a user class from creating and editing reports, although the user class can run previously created reports. Use of this checkbox is appropriate if the user class will be doing ad hoc reporting. If they will only execute standard reports, clear this checkbox option (this is what the secured catalog does). Clear this box when you are changing an existing catalog to a secured catalog. You can restore reporting, editing, and creation capabilities at any time. User classes cannot create and edit reports for secured catalogs. Secured catalog users can only run previously created reports. However, report consumers can create drill-through links even if they do not have update privileges for a report. It is good business practice to place standard or shared reports in read-only folders so users cannot modify them. Users can then create their own reports while using your reports.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify.

Administration Guide 75

Chapter 7: Techniques for Controlling User Access 3. Select the Create/edit reports check box to enable access, or clear the Create/edit reports check box to prevent access, and then click OK.

Control the Ability to Enter SQL Directly


You can enable a user class to enter SQL directly to create queries if you need to have Impromptu run a complex query that cannot be generated automatically (such as CONNECT BY in Oracle) the query is used in, or created by, another application you are an expert in SQL and want to use your knowledge to create queries By default, only the Creator user class can enter SQL directly. If a user inadvertently sets direct SQL editing (Profile tab, Query dialog box), then that user can only update the report by typing SQL statements. The user must access all of Impromptus advanced reporting features such as sorting, grouping, and filtering, through SQL. For more information about entering SQL directly, see "Use SQL" (p. 99).

Disadvantages of Entering SQL Directly


The following are disadvantages of entering SQL directly: A poorly defined or not valid SQL query can be time-consuming to execute. Any restrictions you set in the User Profiles dialog box and the Access tab (Query dialog box) no longer apply, except for limits set on the number of rows retrieved and the length of time a user class can run queries. For example, a user has access to all the tables and columns in the catalog, including data the user may not have permission to see. Security-by-value conditions and filters are ignored. Catalog portability is reduced.

Steps
1. 2. 3. 4. From the Catalog menu, click User Profiles, and then click the Governor tab. In the User class box, click the user class you want to modify. Select the Direct entry SQL check box. Click OK.

Control the Ability to Define User Classes


You can allow mid-level managers to create user classes for their employees, if they have the Administrator version of Impromptu. You can also allow them to place restrictions on the activities of subordinate user classes. For example, they can limit access to sensitive data, or improve system performance by preventing actions that might be time-consuming or of little benefit. You can remove any user class except the Creator user class.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. Change the query restrictions or access privileges for one or more user classes, to meet the current requirements for your catalog. Note: The settings for user classes in a master distributed catalog are automatically inherited by each personal distributed catalog. 3. Cllick OK.

76 IBM(R) Cognos(R) Impromptu(R)

Chapter 8: Manage the Impact on the Network and Database


Performance can become an issue on a network supporting a large number of users who frequently retrieve large amounts of data. As the administrator, you can reduce performance issues by setting operational constraints for each user class. You can manage the impact on the network and database by controlling user actions such as the number of characters a user class can retrieve from large text items (BLOBs) the number of rows a user class can retrieve the number of tables that can be used by a report sorts on non-indexed columns the ability to create outer joins the display of duplicate rows of data in a report the creation of cross-product reports direct entry of SQL You can also manage the impact by defining runtime parameters. For example, specifying the retrieval of large results sets using bulk fetch to increase performance limiting the execution time of queries minimizing the time a user class is connected to the database balancing the client/server load assigning weights to tables specifying alternate data sources such as snapshots or thumbnails

Use the Bulk Fetch Capability


Impromptu attempts to retrieve more than one row of data at a time to reduce processing time. However, if Impromptu attempts to retrieve too many rows at once, your network traffic may increase. There are two fetch-related settings, which operate independently of one another, but Impromptu administrators can only change the first: rows retrieved per fetch call, if your database supports this feature. To change the default setting for this parameter, locate the following line in the [Query Options] section of the Impromptu.ini file, and increase the value from the default (n=100) to a higher number: bulk fetch rows=n rows fetched into the user buffer In Oracle implementations, increasing the value of the rows retrieved parameter (first option) may speed up data retrieval. See your database documentation for more information about the most efficient bulk fetch settings.

Control the Retrieval of Large Text Items


You can control the number of characters user classes can retrieve from large text items or binary large objects (BLOBs). If your database supports BLOBs, Impromptu truncates the BLOB to the size you specify.

Administration Guide 77

Chapter 8: Manage the Impact on the Network and Database The Creator user class can set the maximum volume of text a subordinate user class can retrieve. Members of any other user class can restrict only the volume of text retrieved for their subordinate user classes. You can also control the text BLOB limit at the query level by typing the limit in the Maximum Number of Characters to be Retrieved for Large Text Items box (Access tab, Query dialog box). For example, you set a general limit for retrieving large text items for all reports created by a user class, but you also set a different, more restrictive limit for any specific report run by the same user class. Impromptu lets you restrict data volumes using both the number of records and the size of BLOB fields. To have items span more than one page, the height must be set to dynamic.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. In the Maximum number of characters to be retrieved for large text items box, type a number from 1 to 65534 as the number of characters the user class can retrieve, and click OK. Note: To set unlimited retrieval, type a number larger than 65534 and click OK. Impromptu resets the box when there is no limit.

Control the Number of Rows Retrieved


The Creator user class can set the number of rows any subordinate user class can retrieve. All other user classes, with add/modify permission, can further restrict the number of rows subordinate user classes can retrieve. The Access tab (Query dialog box) can also control the number of rows retrieved at the query level. For example, you set a general limit for the number of rows retrieved for all reports created by a user class, but you set a different limit for a specific report run by the same user class. Impromptu counts rows as they are retrieved and issues a warning or stops at the pre-set number.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. In the Warn at box (under Data retrieval limits box), type or modify the number of rows retrieved when the user class is warned and then click OK. 4. In the Stop at box (under Data retrieval limits box), type or modify the maximum number of rows retrieved and then click OK.

Control the Number of Tables Retrieved


The Creator user class can control the number of tables a user class can retrieve for a report. Impromptu counts tables as they are retrieved and issues a warning or stops at the pre-set number.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. In the Warn at box (under Report table limits box), type or modify the number of tables retrieved when the user class is warned and click OK. 4. In the Stop at box (under Report table limits box), type or modify the maximum number of tables retrieved and then click OK.

78 IBM(R) Cognos(R) Impromptu(R)

Chapter 8: Manage the Impact on the Network and Database

Control Sorting on Non-Indexed Columns


Sorting data is faster if your database has indexed columns, or if you have defined columns as keys for tables. For example, LastName is the indexed column for the Customers table. Your users sort by only the LastName column to make data retrieval faster. By default, any user class can sort on non-indexed columns. You can improve Impromptu's data retrieval performance by preventing a user class from sorting on non-indexed columns warning a user class that sorting on non-indexed columns is time-consuming The Creator user class can set privileges for sorting on non-indexed columns for any subordinate user class. All other user classes, with permission to add or modify user class privileges, can set only more restrictive privileges for subordinate user classes. For example, if you have a user class called Manager with a subordinate user class called Employees, then the Manager user class can set privileges for the Employees user class.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want you want to modify. 3. In the Sorting on non-indexed columns box, do one of the following: To prevent a user class from sorting on non-indexed columns, click Prevent. To issue a warning message when the user class sorts on a non-indexed column, click Warn. To allow the user class to sort on non-indexed columns, click Allow. 4. Click OK.

Control the Creation of Outer Joins


Outer joins are a type of join that retrieves all of the rows from one table even when there are no matching rows in another table. This type of join can produce very large reports, slowing performance, but some users may need to use this feature. For example, the Sales group would probably want to report all orders by product, including those products that had no sales. The Creator user class can set privileges for creating outer joins for any subordinate user class. All other user classes, with permission to add or modify user class privileges, can set only more restrictive privileges for subordinate user classes.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. In the Outer joins box, do one of the following: To prevent a user class from creating an outer join, click Prevent. To issue a warning message when the user class uses an outer join, click Warn. To allow the user class to use an outer join, click Allow. 4. Click OK.

Suppress Duplicate Rows of Data


You can control how a user class displays duplicate rows of data in a report by: preventing a user class from displaying duplicate rows of data in a report warning a user that duplicate rows of data are suppressed allowing a user class to display duplicate rows of data in a report The Creator user class can set privileges for displaying duplicate rows of data for any subordinate user class. All other user classes, with permission to add or modify user class privileges, can set only more restrictive privileges for subordinate user classes. Administration Guide 79

Chapter 8: Manage the Impact on the Network and Database Suppressing duplicate rows in a report can slow processing. It will affect results on local processing such as RSUM.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. In the Eliminate duplicate rows (select distinct) box, do one of the following: To prevent the user class from displaying duplicate rows of data, click Prevent. To issue a warning message when the user class displays duplicate rows of data, click Warn. To allow the user class to display duplicate rows of data, click Allow. 4. Click OK.

Control the Creation of Cross-Product Queries


Cross-product queries retrieve data from tables which are not joined. They take a long time to generate, can show meaningless results, and may retrieve a large number of rows of data. You can control how a user class uses cross-product queries by enabling a user class to create cross-product queries preventing a user class from creating cross-product queries warning a user class that creating cross-product queries is time-consuming By default, no user classes can create cross-product queries. The Creator user class can set privileges for creating cross-product queries for any subordinate user class. All other user classes, with permission to add or modify user class privileges, can set only more restrictive privileges for subordinate user classes. For example, if you have a user class called Manager with a subordinate user class called Employees, then the Manager user class can set privileges for the Employees user class.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. In the Cross-product queries (no table joins) box, do one of the following: To prevent the user class from creating cross-product queries, click Prevent. To issue a warning message when the user class creates cross-product queries, click Warn. To enable the user class to create cross-product queries, click Allow. 4. Click OK.

Control the Time a User Class Can Run Queries


You can control the time a user class can run a query. Members of the Creator user class can set this time limit for any user class. All other user classes, with permission to add or modify user class privileges, can set only more restrictive privileges for subordinate user classes. Impromptu first gathers statistics on the report size, so you may have to run the report a few times to build up the statistical base. The database you use might have features for controlling execution time as well.

Steps
1. From the Catalog menu, click User Profiles, and then click the Governor tab. 2. In the User class box, click the user class you want to modify. 3. In the Warn at box (under Query execution time limits box), type or modify the time (in minutes) when you want to warn the user class and then click OK.

80 IBM(R) Cognos(R) Impromptu(R)

Chapter 8: Manage the Impact on the Network and Database 4. In the Stop at box (under Query execution time limits box), type or modify the time (in minutes) when you want to stop the user class and then click OK. 5. Click OK.

Restrict the Time a User Class Is Connected to the Database


You can restrict the length of time that a user class is connected to the database by using a temporary cache to store query results. Impromptu automatically disconnects from the database once the query is run, and automatically reconnects when you run another query. Normally, user classes are connected to the database from the time the user opens a catalog until they close the catalog or disconnect from the database.

Steps
1. From the Catalog menu, click User Profiles, and then click the Client/Server tab. 2. In the User class box, click the user class you want to modify. 3. Select the Minimize connection time to the database check box and click OK.

Adjust the Client/Server Balance


You can adjust the client/server balance so that queries are processed on only the server, with limited local processing, or with flexible processing.

Database Only
Use the Database Only option to process on the database server only. You might want to use this option when queries are very large, or when you want the Structured Query Language (SQL) generated by queries to be portable to other applications that access your database. In interactive queries, the Database Only option requires that the query is completely processed on the database server in one query submission. As a result, this option prevents building a query that involves both details and subtotals.

Limited Local Processing


Use the Limited Local Processing option when you want data passed from the database server to the PC, which handles processing locally. In interactive queries, the Limited Local Processing option attempts to perform as much of the processing on the database server as is possible through the use of multiple queries. Impromptu will then combine the results on the PC. For example, if you want last names changed to uppercase, and you put this condition in the footer of a query, Impromptu applies uppercase to the data as it is displayed. If you put the uppercase condition in the header, Impromptu retrieves all rows in the database and then applies the uppercase condition. Limited Local Processing wont work if you want to sort on a calculated column requiring local expressions, or if a filter is based on a calculated column. For example, you could not sort or apply a filter on a COUNT, SUM, AVE, MAX or MIN column. Note: By default, the standard templates provided by Impromptu are set to Limited Local Processing. If your reporting environment requires flexible processing, you can modify the settings in the templates for all new reports that you create.

Flexible Processing
With this option, depending on the database, the entire result set can be sent to the PC, where local sorts are performed. This option allows Impromptu to execute any query, but it can increase network traffic. When you are using a local database, the Report Query dialog box displays the message "local database, flexible processing assumed."

Administration Guide 81

Chapter 8: Manage the Impact on the Network and Database

Steps
1. From the Catalog menu, click User Profiles, and then click the Client/Server tab. 2. In the User class box, click the user class you want to want to modify. 3. In the Query processing box, click one of the following option buttons: To run queries completely on the server, click Database only. To run queries with limited local processing, click Limited local processing. To let Impromptu decide where to run queries, click Flexible processing. 4. Click OK.

Assign Weights to Tables


Table weighting specifies the order in which tables will be retrieved and joined. The more detailed the table, the bigger the weight that should be assigned. The objective is to get Impromptu to read the summary table first, and then join to successively more detailed tables. By assigning weights to your tables, you control which tables are preferred as intermediate tables in join strategies. Impromptu uses these weights when creating SQL queries by ordering the tables in the FROM clause, from the lightest to the heaviest. Smaller tables are always preferred. By default, tables are added into the catalog with the weight of 5. Outer joins, if used, will change the weighting order.

Example
A report with Customer (CUSTOMER table), Order_No (ORDER table), and Rep_Name (REP table) selects columns from the CUSTOMER table, then the ORDER table, and then the REP table, because that is the order they are referred to in a query. By assigning a weight of 20 to the order table, a weight of 10 to the Customer table, and a weight of 2 to the REP table, you determine a more efficient order of the tables in the FROM clause. The Rep table has been given a higher priority (1 being the highest priority). Due to this weighting, tables are selected in the order: REP-ORDER-CUSTOMER. Why? If direct joins between these tables exist, then data will be selected from the tables in the order based on table weight. However, in this case, there is no direct join between Rep and Customer. They have to be joined through the Order table. Impromptu creates the table joins in this order:
"Rep.Rep_no=Order.Rep_no and Customer.Order_no=Order.Order_no"

In many cases, weighting enables you to optimize queries. Some database optimizers override the weighting option in Impromptu. Advanced databases do a better job of optimizing queries and are unaffected by the order of the tables in the SQL.

Steps
1. From the Catalog menu, click Tables, and then click the Weighting tab. 2. In the Catalog tables (relative weight) box, click the table or tables with the weight you want to increase or decrease and do one of the following: To decrease the weight until the desired weight is reached, click Smaller. To increase the weight until the desired weight is reached, click Bigger. You can double-click the table to continue decreasing or increasing the weight. 3. Click OK.

Use Snapshots or Thumbnails


When Impromptu retrieves information directly from the database, it goes back to the database when you change a query. Selecting an alternative data source can make returning to the database unnecessary, reducing the cost of reporting over your corporate network. Impromptu supports the following alternate data sources: HotFiles; see "Work with HotFiles" (p. 89)

82 IBM(R) Cognos(R) Impromptu(R)

Chapter 8: Manage the Impact on the Network and Database snapshots thumbnails

Using Snapshots
A snapshot retrieves all the information for a report and stores it in a permanent cache on the PC. The data is stored along with the report format in the *.imr file. A snapshot can be used like a database. You dont need access to the database to use a snapshot. A report can be produced directly from the snapshot. Because you are not accessing the database, you cannot add columns to a snapshot or build a less restrictive filter. Snapshots are suitable for working disconnected from the LAN. Use snapshots when: You want to have all the data you need for your report in one file. When you work with a report that contains a snapshot, you can sort, group, calculate, add filters, and so on. You want to e-mail your report as a single file attachment. When you create a snapshot for a report, the snapshot is saved along with the report in the *.imr file. You can send the .imr file to someone who doesnt have access to your database but who has Impromptu. You want to open a report without access to the catalog. Using a snapshot is one way to work with your reports, even when you are not connected to the LAN; for example, when you are using a laptop.

Creating a Snapshot
Before you can create a snapshot, you must have a report open. To create a snapshot, you can: use the Snapshot button on the Standard PowerBar use the snapshot options in the Access tab of the Query dialog box use the Save As command from the File menu

Refreshing a Snapshot
If you created your snapshot to preserve historical data, you should not perform a refresh on it, because the data must be maintained intact, for archival puposes. However, if your purpose is to present an updated view of the data, you can refresh your snapshot using either of the following methods: use the Snapshot button on the Standard PowerBar use the Access tab of the Query dialog box

Scheduling Snapshots
You can schedule snapshots using IBM Cognos Scheduler. To do this, run a report and always save it as a snapshot to a different filename using the Report tab in the Scheduler. Saving a report as a snapshot and re-running it results in the data never being updated.

Using Thumbnails
Impromptu can retrieve a specified number of records from the database and store them in a temporary cache on the PC called a thumbnail. Impromptu attempts to use the thumbnail exclusively, and does not return to the database unless necessary. When you sort, group, apply restrictive filters, or add columns that are calculations based on existing columns, Impromptu performs these actions locally, without accessing the database. Unlike snapshots, thumbnails allow you to apply less restrictive filters and add one or more columns, and Impromptu will automatically go back to the original database to get new information. Thumbnails are suitable for testing purposes.

Administration Guide 83

Chapter 8: Manage the Impact on the Network and Database

84 IBM(R) Cognos(R) Impromptu(R)

Chapter 9: Audit Impromptu Performance


Impromptu can record information about the tasks you perform in a log file. You can use the information to monitor performance and make decisions about how to improve the efficiency of your Impromptu environment. Impromptu comes with a set of tools that you can use to configure your log file and export the information into a database. Then, you can run a sample Impromptu report on the information to audit Impromptu performance. There are two small applications that come with Impromptu that help you perform auditing: 1) Audit Configuration and 2) Audit File Processor. Use the Audit Configuration application to: enable auditing set the audit file location configure how much space audit files will take store the SQL statements Impromptu uses to get information Use the Audit File Processor application to: set the audit file load location set the audit data database; you can use any database that can be accessed through ODBC set whether audit files are deleted after loading create database tables add data from the audit files to the database tables Each session of Impromptu records all events in the audit file along with important context information about those events. For example, when you open a report while auditing is turned on, Impromptu records the name of the report and how long it took to open that report. Impromptu Web Reports has its own auditing application and cannot collect auditing data for Impromptu and vice versa. This is because the log files created are of different versions. Note: There is no support for Impromptu auditing on UNIX. A sample auditing catalog (Audit.cat) and a report (Auditing Report.imr) are included in the Impromptu samples. For more information on these two samples, see "Product Sample Listing" (p. 157).

Steps to Audit Impromptu Performance Using Log Files


1. Create a new data source. 2. Create a database file for that data source. If you are using an Access database file (.mdb), create that file using Access, not ODBC Administrator. Note: When creating the Access database, set security and user group settings because you will be prompted for them in the AuditFileProcessor application. 3. Check to see if AuditConfig.exe and AudifFileProcessor.exe are in your installation_location\Bin folder. If they are, skip to step #4. Otherwise, run the Custom Installation of Impromptu and select the Audit check boxes in the Component Selection dialog box. 4. Start the Audit Configuration application (AuditConfig.exe), enable auditing, and specify where to store the audit files. For instructions, see "Steps to Use the Audit Configuration Application" (p. 86). Note: Ensure that the directory location for your log files is write-enabled 5. Start Impromptu. 6. Open a report and make some general changes to create some events in your log files.

Administration Guide 85

Chapter 9: Audit Impromptu Performance 7. Close Impromptu. 8. Start the Audit File Processor application (AuditFileProcessor.exe), process the audit files, and store their data in the database file you created in step 2. For instructions, see "Steps to Use the Audit File Processor Application" (p. 86) and "Steps to Set Audit File Processor Options" (p. 86). 9. Start Impromptu and create a database definition using the data source you created in step 1. 10. Create a catalog using the database definition you created in the previous step. 11. Create your report or use one of the sample auditing reports.

Steps to Use the Audit Configuration Application


1. Select the Enable Auditing check box to enable auditing. Note: To turn off auditing, clear the Enable Auditing check box. 2. In the Location Root for Audit Files box, enter the root location of the audit files. 3. In the Maximum Size of Each File in (KB) box, type the maximum audit file size. When this size is exceeded, Impromptu creates a new file. 4. In the Maximum Size of Each Directory with Audit Files in (KB) box, type the maximum folder size. When this size is exceeded, the oldest audit file in this folder is deleted. 5. Select the Write SQL to Disk check box to save SQL in files. SQL logging files are written to a sub-folder of the root folder called SQL. 6. Select the Exit on Error check box to stop editing if an error occurs. 7. Select the Do Not Create Session Directories check box if you don't want session directories. Each time the auditing .dll is loaded, Impromptu creates a unique sub-folder of the root folder called SessionN, where N is a unique number, unless you select this check box. 8. Click OK to close the application and save changes. Note: The auditing log files are called AUDIT########.log, where ######## is a hexadecimal number. The files are stored in folders called Session########. If SQL auditing is enabled, SQL log files are stored in subfolders of the session folders. These subfolders are called SQL########.

Steps to Use the Audit File Processor Application


1. In the Input Audit Files Directory box, enter the root location of the audit files to process. 2. In the ODBC Data Source Name box, enter the ODBC data source name for the database to store the audit data. 3. Click Options to open the Options dialog box. You can set various processing options, such as deleting auditing files after they are loaded and stopping when an error is encountered. 4. Click Start. The Status box shows the number of audit files processed and the number of lines in the current file that have been processed. Note: To stop audit file processing, click Stop.

Steps to Set Audit File Processor Options


1. To create the audit database tables in the specified data source, click Create Tables. Note: You only have to create the tables once. 2. In the Input Audit Files Directory box, enter the root location of the audit files to process, if necessary. 3. In the ODBC Data Source Name box, enter the ODBC data source name for database to store the audit data. 4. To search for Session sub-folders under the specified path, select the Check Session sub-directories check box. 5. To delete audit files from the system disk as they are processed, select the Delete Audit Files check box.

86 IBM(R) Cognos(R) Impromptu(R)

Chapter 9: Audit Impromptu Performance 6. To play a system beep sound when processing a batch of files is finished, select the Beep on Finish check box. 7. To stop processing the audit files when an error is encountered, select the Stop on Error check box. 8. To open the ODBC Administrator dialog box, click ODBC Administrator. Tip: The location and ODBC name that appear automatically are set in the parent application.

Administration Guide 87

Chapter 9: Audit Impromptu Performance

88 IBM(R) Cognos(R) Impromptu(R)

Chapter 10: Work with HotFiles


A HotFile is a flat sequential file. It acts as a separate local data table that can be added to your catalog or used in a report as if it were a database table. Both the data and the definitions are stored in the HotFile. Once created, a HotFile is independent of the database columns from which it was created, and you can use it in any report or catalog. You can join a HotFile to database tables, reports, or other HotFiles.

Using HotFiles
For simpler situations where you have a relatively small or stable set of data that you wish to join to another database, use a HotFile. For example, if you have Branch information in Oracle (a few hundred records) that you need to join to a large Sybase database, use a HotFile to extract the Branch information and join it to the Sybase database. However, if you have one database with thousands or millions of rows that you need to combine with another database with thousands or millions of rows, a HotFile is not the answer. Products such as Sybase OmniServer and Oracle Transparent Gateway allow you to use an existing database server for the joins. Products like Digital's AccessWorks/DBI allow you to use either an existing database server or a separate dedicated database server to join the data. You can: generate reports using data from multiple databases. You can join information from different databases in heterogeneous database environments, or in environments where you must query multiple databases simultaneously. For example, suppose your corporate data is stored in an Oracle database and some of your own personal data is stored in a personal dBASE database. You can create a HotFile from either of these databases and then use that HotFile to create reports in conjunction with the other database. use HotFiles as lookup tables or in report prompts. Reports that query large datasets can slow computer performance when you use them as lookup tables or in report prompts. For example, if you use report that accesses a large dataset to filter values in a second report, Impromptu runs the large report and reads through the dataset to apply the filter. Instead, create a HotFile with the data you want in your lookup table or prompt, and then use the HotFile in your query. use HotFiles as a database. You can store important reporting data from a corporate database in HotFiles, and then use these HotFiles as a database that you access in a catalog. This enables you to stage your data for local queries, without submitting queries to the database. add data items to a report not included in your catalog by adding them directly from a HotFile. For example, you may want to speed up processing time by putting calculated and summary data in a HotFile share HotFiles by including them in your catalog. create and use HotFiles for a multiple query report that Impromptu executes in a single query. A multiple query report requires more than one query of the data to create the report. For each individual query in a multiple query report, you can create a HotFile, and then create a report that queries the HotFiles.

Limitations of HotFiles
Below are some limitations surrounding the use of HotFiles: HotFiles exist on the client.

Administration Guide 89

Chapter 10: Work with HotFiles HotFiles are not indexed, therefore, joins may take longer than expected to execute. Also, Impromptu must use Sort/Merge and sequential scan to filter. HotFile size is limited only by available disk space. However, you should not use HotFiles to store very large query results as they could slow computer performance.

Example
Each of your regional offices uses its own small database to track regional promotions and sales initiatives. However, The Great Outdoors corporate information is stored in a Sybase database. When your regional managers receive your standard reports and templates, they need a way to easily incorporate data from the corporate Sybase database with the information in their local databases. To overcome the multiple database type problems at The Great Outdoors, you create a HotFile called PRODSALE. This HotFile contains sales information from all regions. You set in place an OLE automation procedure that automatically builds this HotFile at the end of each calendar month, and then mails it to your regional managers. Your regional managers use the information in this HotFile with the information in any of the catalogs they have created for their regional databases. This way, your regional managers can easily correlate their sales results with the costs they have incurred in their regional promotions.

Create a HotFile
You can create a HotFile of a report you want to use separately from your database. The following are cases where you might use a HotFile to improve processing efficiency: If you have a large static data set that you use for many reports, you can create a HotFile for this data and use the HotFile data rather than querying the data on the database. If you have a yearly sales table that you use for your financial reports, you can create a HotFile with the subset of data you require and use the HotFile data rather than the database. If you want to access a sales table from one corporate database, and a product table from a different database, you can create a HotFile of the product table and join the HotFile to the corporate database. If you have a complex exception report that requires multiple passes to get the information that you need, you can create a HotFile of your first report (first pass that extracts certain attributes or information), create another Hotfile of any subsequent passes to eliminate or summarize information, and then create the final report from the final HotFile. You can use a macro to automatically create a HotFile.

Examples
You have millions of rows in a database and you commonly use 20 of them. You create a HotFile containing only those 20 rows. This saves processing time when executing queries by reducing the number of rows in the query. You have to generate a daily report of the previous days sales and the sales table containing the data item is not in the local database. You use a macro to automatically create a new HotFile every day.

Steps
1. 2. 3. 4. Create or open the report with the data items you want in your HotFile. From the File menu, click Save As. In the File name box, type the name for the HotFile. In the Save as type list, click HotFile (*.IMS) and then click Save.

Change or Update a HotFile


HotFiles are local tables. After you create a HotFile, you may want to update the data or change the tables.

90 IBM(R) Cognos(R) Impromptu(R)

Chapter 10: Work with HotFiles

Example
You want to create a sales report for July, but you have created a HotFile using June sales tables. You change or update the HotFile by overwriting the older file.

Steps
1. Create or open the report containing the data items you want to include in your changed HotFile. 2. Save your report or query as a HotFile with the same name as the previous HotFile. 3. Click Yes to replace the existing HotFile. The existing tables and data are overwritten.

Add a HotFile to Your Catalog


You can include a HotFile in your catalog. You can also create a catalog of HotFiles. You need to create a database definition for the HotFile catalog. For more information, see "Create a Database Definition for a HotFile" (p. 111).

Examples
You have your sales commission conversion table in a separate database. You add the sales commission conversion table to your commissions catalog using a HotFile. You notice that everyone in the office is constantly using a specific set of HotFiles. You create a database definition for those HotFiles to enable easier access.

Steps
Close all open reports. From the Catalog menu, click Tables. Click the HotFiles option button. Select the folder containing the HotFile you want and click OK. The folders path appears above the Database tables box. 5. In the Database tables box, select the HotFile to add to your catalog, and then click Add. Note: The HotFile table looks the same as any other table in the catalog. 6. Click OK. 1. 2. 3. 4.

Create a Catalog of Only HotFiles


You can create a catalog containing HotFiles only if you have defined a set of HotFiles as a database. For more information, see "Create a Database Definition for a HotFile" (p. 111). You can add unlimited sets of HotFiles to the catalog.

Example
All your sales data are in HotFiles. You create a sales catalog containing only those HotFiles.

Steps
1. Create a new catalog. 2. Add the HotFiles to the catalog.

Use a HotFile in Your Report


You can use a HotFile in your report.

Example
You want to test a theory that expenses are proportional to salary, and the salary data item is in a separate database. You create a HotFile with the salary data item to use in your report.

Administration Guide 91

Chapter 10: Work with HotFiles

Steps
1. 2. 3. 4. Open a report to obtain the data items you need for your report. From the Report menu, click Query. In the Data source box, select HotFile. Click Browse to locate and select the HotFile directory and click OK. In the directory box, double-click the HotFile data items you want to use. Click OK when you have selected all the HotFile data items.

Use HotFiles as Lookup Tables


Large datasets can slow computer performance when you use them as lookup tables. For example, if you use a large report as a dataset that filters values in a filter expression, Impromptu runs the dataset report and then reads through the dataset to apply the filter. If your data is static, create a HotFile with the data that you want in your lookup table, and then use the HotFile in your query.

Share HotFiles by Including Them in Your Catalog


You can share a HotFile by including it in the catalog. This eliminates the need for your users to individually add the tables themselves. HotFiles in your catalog appear the same as any data tables in the catalog. Your users cannot tell the difference between a HotFile table and a regular database table; the data appears as a part of the catalog.

Example
You are the administrator for a master distributed catalog and several people using this catalog ask for data on a database you do not normally use. You create a HotFile of the data.

Join Multiple Databases Using HotFiles


You can use HotFiles to access multiple databases in one query. HotFiles are stored locally and you must update the HotFiles when you want it to reflect changes to the HotFiles data source.

Example
You want to access a sales table from the corporate Oracle database, and a product table from a Sybase database. You create a HotFile of the product table and join the HotFile to the corporate database.

Steps
1. Select one database as the basic database used in Impromptu. 2. Create HotFiles of the tables in any of the other databases. Note: Use the same folder so that you can access the tables at the same time. You may want to give alias names to identical tables from different databases. 3. Create a database definition for the HotFiles you create. 4. Create a catalog with the basic database and the HotFiles database. 5. Open the catalog.

Create and Use a HotFile for a Multiple Query Report


You can create: a complex exception report requiring multiple summary filters

92 IBM(R) Cognos(R) Impromptu(R)

Chapter 10: Work with HotFiles For example, if you have to list all your branch offices in descending order of risk, where the percentage of risky transactions is greater than 50%, you can create a HotFile with a summary filter to identify risky transactions. You then create another HotFile to eliminate stable branch offices. Finally, you create a report that separates the unstable branch offices into several levels of instability. A risky transaction is defined as a transaction with a potential to result in a loss (negative profitability). a statistical analysis report summarizing raw transactional data For example, if you want to determine the attributes of your best customers, you can create a HotFile to determine what customer has what attribute. You can then create another HotFile to determine the factors affecting the attributes. Finally, you can create a report to rank the customers and show resulting attributes. a result set report listing the components of an object For example, if you want to find all the parts used in a particular model of car, you can produce an intermediate HotFile by entering your own SQL, and then use the HotFile to support additional filtering, summaries, and percentages.

Steps
1. 2. 3. 4. 5. Create a HotFile of your first report. Create subsequent HotFiles as necessary. Create a final report. Select the HotFiles that you created in step 1 to include in your catalog. Query the HotFiles.

Administration Guide 93

Chapter 10: Work with HotFiles

94 IBM(R) Cognos(R) Impromptu(R)

Chapter 11: Work with Stored Procedures


Impromptu can access stored procedures (SQL scripts or other code routines stored in your database) and show the results in a list report. They improve the performance of repetitive tasks because they are only compiled the first time you run them. Impromptu comes with a Stored Procedure (.imp) template. You can use the Stored Procedure.imt template to create reports that call stored procedures and show the results in a simple list report. When you create a new report using the template, the Query dialog box is replaced by the Stored Procedure dialog box. To access the procedure, type the following and click OK:
call procedure name (?parameter1? IN, ?parameter2? OUT)

You must create a prompt for each input and output parameter your stored procedure requires. For example, a stored procedure requires a customer number and returns the number of tents the customer purchased in March. Use the Prompt Manager to create a prompt for each parameter, and then type the prompts into the call:
call sp_custinfo (?custid? IN, ?marchsales? OUT)

When you create the prompts, you must give them the same name as the parameter that the stored procedure requires. You must also provide as much information as possible about the type of data the stored procedure returns. You can specify data type information using the Advanced options of the Prompt Definition dialog box. If you always want to submit the same value for a parameter, you can set the value as a default and use the default every time you run the report. Select the Use the Default Value check box (Prompt Definition dialog box) to use the default value automatically when you run the report. You can create stored procedure reports in either administrator or user versions of Impromptu, provided that the user class that you used to attach to the catalog permits you to edit SQL. To allow SQL editing, select the Direct Entry SQL check box from the Governor tab of the User Profiles dialog box. Any user class that can create and edit reports can reuse a stored procedure report in another report, using either version of Impromptu. To allow your users to create and edit reports, select the Create/Edit Reports check box in the Governor tab of the User Profiles dialog box.

Stored Procedure Processing Constraints


The following are processing constraints associated with stored procedures: If a stored procedure returns more than one result set, Impromptu can only access the first one. You can't save a stored procedure report as an .iqd file. You must use uppercase to specify the name of an ORACLE stored procedure. By default, prompts are single select. A Type In prompt response could contain multiple, comma-separated values, but it would require the stored procedure to parse it. Stored procedure reports have the same limitations as type-in SQL reports. To remove these limitations, use stored procedure reports as data sources for other reports. Save your report, and then create a new report using the same catalog. In the Data Sources box (Query dialog box), you can select Hotfiles and Reports, and browse for the stored procedure report. Or, you can use the Tables dialog box to add the stored procedure report to your catalog, and then join this report to other reports or tables from the database. For more information, see "Use SQL" (p. 99). You can still add formats, borders, and patterns to the stored procedure report. However, if you reuse a report in another, then the result set of the reused report has to be locally cached when you execute the final report. This may increase processing time.

Administration Guide 95

Chapter 11: Work with Stored Procedures Impromptu can access stored procedures from any IBM Cognos-supported database. Stored procedures can also be accessed using ODBC connections. For information about supported databases and versions, see the Cognos Software Services Web site (http://support.cognos.com).

Create a Stored Procedure Report


Stored procedures are routines of code stored in a database. Among other capabilities, a stored procedure can retrieve data. A Stored Procedure.imt template is provided to assist you in creating stored procedure reports. An example of a stored procedure is:
call range_sp1 ( ?ParamStartDate? IN, ?ParamEndDate? IN )

Stored procedures have the following components: Syntax <procedure_name> <parameter> Explanation The name of the procedure. Type either the name or fully qualified name, for example, catalog.schema.proc_name. A prompt that provides the parameter. The name should indicate its purpose ("DATE"). Append the parameter type (one of: "IN", "OUT" or "IN OUT") after the prompt name. This component is optional, although most stored procedures have parameters. <status> A prompt that returns a status value. This component is optional. Except for Sybase, most stored procedures won't return a status.

Steps
1. From the File menu, click New. 2. Select the Stored Procedure template (Stored Procedure.imt) and click OK. If you do not have a catalog already open, the Open Catalog dialog box appears for you to select the catalog to use. The SQL tab of the Stored Procedure dialog box appears. 3. Type the name of the stored procedure. Note: Use uppercase to specify the name of an ORACLE stored procedure. 4. Click Insert Parameters to add a parameter. 5. Create a prompt for each input and output parameter. Note: You may have to insert "IN", "OUT" or "INOUT" and a comma between parameters. 6. Click Verify to test the SQL syntax. 7. If the SQL syntax is OK, click OK. Otherwise, fix your SQL syntax and click Verify again. 8. Save the report as an Impromptu report (.imr), not as a HotFile (.ims). 9. Use your report in another report.

Insert Parameters in a Stored Procedure Call


Generally, you use prompts to specify values for all input and output parameters, and you specify any constant values directly in the stored procedure. (You can turn off user-prompting for these default values by selecting the Use The Default Value check box in the Prompt Definition dialog box.)

96 IBM(R) Cognos(R) Impromptu(R)

Chapter 11: Work with Stored Procedures Although you are required to use prompts to specify the output parameter values, those values are only placeholders required for syntax checking. The output parameter values have no impact on the stored procedure execution. Input parameters are available for use within the stored procedure and are used for prompting users for values required during query execution. For example, if a stored procedure called dba.MyStoredProc takes an employee number (integer) and the department name (string) as input, then you cannot make a call to the stored procedure as shown below:
call dba.MyStoredProc(100, "HR")

You first have to define two prompts (because there are two input parameters); for example, EmpNo (datatype: integer) and Dept (datatype: string), with 100 and HR as default values for the prompts.
call dba.MyStoredProc(?EmpNo?, ?Dept?)

Impromptu is able to access the first result from a stored procedure. Subsequent results are not available within Impromptu. If you want the output parameters returned with the result set, list them in the Select statement. This may not work for all databases.

Example
In this example, X and Y are output parameters and are returned with the result set.
PROCEDURE QCSP_PARM_REF (RESULT1 IN OUT ACCTCURTYPE, X OUT NUMBER, Y IN OUT CHAR, Z IN NUMBER, RESULT2 IN OUT B_S_CURTYPE1) is BEGIN X := 1; Y := 'Y'; OPEN RESULT1 FOR SELECT *, X, Y, Z FROM ACCT WHERE ACCT.ACCT_CD = Z; OPEN RESULT2 FOR select bill_sum_key, trn_proj_id, acct_id, org_id from BILLING_SUM; END;

Steps
1. Position the pointer where you want the prompt. 2. Click the Insert Prompt button to open the Prompt Manager dialog box. 3. In the Available prompts box, if the prompt already exists, click the prompt and then click OK. Otherwise, click New and define the prompt in the Prompt Definition dialog box. For more information, see "Working with Prompts" (p. 57).

Hide Prompts for Stored Procedure Values


In some circumstances, you may want to hide a prompt from a user; for example, when providing constant parameters to a stored procedure or for output parameters that will be overwritten, and for which the input value is meaningless.

Steps
1. 2. 3. 4. 5. 6. Open the stored procedure report. From the Report menu, click Prompt Manager. In the Available prompts box, click the prompt to hide. Click Edit. Click Advanced. Select the Use the default value check box and click OK twice.

Administration Guide 97

Chapter 11: Work with Stored Procedures

98 IBM(R) Cognos(R) Impromptu(R)

Chapter 12: Use SQL


What is SQL?
SQL, or Structured Query Language, is the standard query language for accessing information from relational databases. You do not need to know SQL to use Impromptu, since Impromptu automatically generates the SQL needed to retrieve data for your reports.

What You Can Do


Impromptu generates SQL statements for your reports and queries. You can view and alter existing SQL statements or you can write SQL statements from scratch. You can also insert SQL statements that are extracted from other applications that use non-standard SQL. This is not recommended since many Impromptu features are no longer available when you manually enter SQL code. Once you alter the SQL statements, you can only change the query by manually editing the SQL statement.

Limitations
Once you edit SQL statements, you cannot: access some Impromptu tabs (for example, Data, Sort, and Filter). The remaining tabs provide only limited functionality access some of the toolbar buttons (for example, Sort, Filter, and Snapshot) re-establish most of the governor settings that control permissions schedule reports to be executed on a remote server

View the Existing SQL for the Query


You can view existing SQL for a query.

Steps
1. From the Report menu, click Query, and then click the Profile tab. 2. Click the SQL option button to show the SQL code for this query.

Create a Query By Writing Your Own SQL


You can create a query by writing your own SQL.

Steps
1. Create a new report using a template. The Query dialog box appears. 2. Click the Profile tab. 3. Click the SQL option button. Note: The SQL option button only appears if the administrator has enabled SQL access for you. For more information, see "Control the Ability to Enter SQL Directly" (p. 76). 4. Click Edit. 5. In the SQL Query tab, create a SQL statement, and click OK.

Change a Query By Writing Your Own SQL


You can change a query by modifying the SQL statements. Administration Guide 99

Chapter 12: Use SQL

Steps
From the Report menu, click Query, and then click the Profile tab. Click the SQL option button. Click Edit. Click where you want to modify the SQL statements and then do one of the following: To add your own SQL, type the SQL. To paste copied SQL statements, click Paste. To create prompts, click the Insert Prompt. To change a calculation or filter, altern the SQL statement. Note: If you want to maintain the report layout, you must use the same data item name references Impromptu has assigned. 5. Click Verify for Impromptu to verify the functionality of the new or existing SQL statements. 6. Click OK. 1. 2. 3. 4.

Generate Efficient SQL for Summary Level Reports


Impromptu can efficiently execute the common summary report.

Steps
1. Group the query on the column for which you want to view summary values (for example, by CUSTOMER). 2. Associate all related columns to the column you grouped in step 1. 3. Use the summary functions to add the summary columns to the report. Note: In the Query dialog box, click the Eliminate duplicate rows check box to set select distinct for your query.

Example 1
As shown in the following query, Impromptu varies the join specification in the bottom-most derived tables to reduce joins and suppress duplicate records. The query groups on the Order_no column (c9) and associates all related columns to Order_no, Customer name (c13), Address (c12), City (c11), and Province/State (c10). The select distinct for the Outlet and the association of the related columns means that no processing is done on the computer, and all the grouping and sorting is performed by the database.
select c9 as c1, c13 as c2, c12 as c3, c11 as c4, c10 as c5, c8 as c6 from (select T1."ORDER_NO" as c7, SUM(((1 - T4."DISC_PRCNT" / 100) * (T4."PRICE" * T4."QTY"))) as c8 from "CUSTSITE" T3, "ORDER" T1, "CUSTOMER" T2, "ORDRDETL" T4 where ((T3."CUST_NO" = T1."CUST_NO") and (T3."SITE_NO" = T1."SITE_NO")) and (T2."CUST_NO" = T3."CUST_NO") and (T1."ORDER_NO" = T4."ORDER_NO") group by T1."ORDER_NO" ) D2, (select distinct T1."ORDER_NO" as c9, T3."PROV_STATE" as c10, T3."CITY" as c11, T3."ADDRESS1" as c12, T2."CUSTOMER" as c13 from "CUSTSITE" T3, "ORDER" T1, "CUSTOMER" T2

100 IBM(R) Cognos(R) Impromptu(R)

Chapter 12: Use SQL


where ((T3."CUST_NO" = T1."CUST_NO") and (T3."SITE_NO" = T1."SITE_NO")) and (T2."CUST_NO" = T3."CUST_NO") ) D1 where (c9 = c7) order by c1 asc

Example 2
The application of this optimization depends on how the query is grouped. For example, if you group on ORDER.Order_no rather than ORDRDETL.Order_no, the query is not fully optimized. As a result, an extra server-based join is performed. In this case, instead of the above efficient version, the bottom-most derived table is constructed as follows:
select distinct c9 as c1, c13 as c2, c12 as c3, c11 as c4, c10 as c5, c8 as c6 from (select T1."ORDER_NO" as c7, SUM(((1 - T4."DISC_PRCNT" / 100) * (T4."PRICE" * T4."QTY"))) as c8 from "CUSTSITE" T3, "ORDER" T1, "CUSTOMER" T2, "ORDRDETL" T4 where ((T3."CUST_NO" = T1."CUST_NO") and (T3."SITE_NO" = T1."SITE_NO")) and (T2."CUST_NO" = T3."CUST_NO") and (T1."ORDER_NO" = T4."ORDER_NO") group by T1."ORDER_NO" ) D2, (select distinct T1."ORDER_NO" as c9, T3."PROV_STATE" as c10, T3."CITY" as c11, T3."ADDRESS1" as c12, T2."CUSTOMER" as c13 from "CUSTSITE" T3, "ORDER" T1,s "CUSTOMER" T2 where ((T3."CUST_NO" = T1."CUST_NO") and (T3."SITE_NO" = T1."SITE_NO")) and (T2."CUST_NO" = T3."CUST_NO") ) D1 where (c9 = c7) order by c1 asc

Example 3
As another example, if you have not associated the Order columns with "Order_no", you must click the Eliminate Duplicate Rows check box in the Filter tab (Query dialog box). This query retrieves all sales records to the computer for sorting. The resulting query is inefficient and returns a large volume of data:
select distinct c9 as c1, c13 as c2, c12 as c3, c11 as c4, c10 as c5, XSUM(c14 for c9) as c6 from (select T1."ORDER_NO" as c9, T3."PROV_STATE" as c10, T3."CITY" as c11, T3."ADDRESS1" as c12, T2."CUSTOMER" as c13, ((1 - T4."DISC_PRCNT" / 100) * (T4."PRICE" * T4."QTY")) as c14 from "CUSTSITE" T3, "ORDER" T1, "CUSTOMER" T2, "ORDRDETL" T4

Administration Guide 101

Chapter 12: Use SQL


where ((T3."CUST_NO" = T1."CUST_NO") and (T3."SITE_NO" = T1."SITE_NO")) and (T2."CUST_NO" = T3."CUST_NO") and (T1."ORDER_NO" = T4."ORDER_NO") ) D1 order by c1 asc

102 IBM(R) Cognos(R) Impromptu(R)

Chapter 13: Automating and Updating Impromptu


Impromptu has features to help you automate and maintain your Impromptu environment. You can: create standard reports and templates take advantage of Impromptus inheritance feature distribute a revised Impromptu.ini file to users mail shortcuts automate tasks with IBM CognosScript Editor, IBM CognosScript Dialog Editor, and IBM Cognos Scheduler use the Impromptu Type Library manage the report size

Standardizing Reports and Templates


One way to make your job as an administrator easier is to create standard reports and templates for your users. These help ensure consistency, and make it easier for you to maintain Impromptu and for your users to use Impromptu.

Standard Reports
A standard or production report is a report that you create and distribute to users. You can do this by creating a secured catalog where users cannot create or alter reports a distributed or shared catalog and placing the associated reports in a read-only directory. This prevents users from modifying the original copies of the production reports that you distribute, but allows them to make changes to their own copies of the reports. Creating standard reports gives users an easy entry point into Impromptu, and ensures that your reports have a consistent look and feel. For example, customer statements, invoices, and monthly profit and loss reports should reflect company standards, and should not be modified by users. You could create a specific catalog for these reports, but that would increase your maintenance time. Instead, try making a read-only file or directory that cannot be modified regardless of the type of catalog used. Users can open the report/template and save a report using a new name.

Templates
Templates are patterns or models that can be used to build reports. Like standard reports, templates help ensure report consistency throughout your organization. They give users a starting point for creating reports, but dont limit users to the extent that standard reports do. Templates are the basis for all reports. They can be as simple as the default simple list template supplied with Impromptu. They can also be much more complex, and include place holders, calculations, prompts, and formatting. Impromptu comes with several templates that you can use to begin creating your own business reports. If your users create the same type of reports frequently, you might also want to provide them with a set of standard templates you have created. You can use the Impromptu default templates as is, modify them to suit your business requirements, or create your own templates. Templates can be used for classic reporting styles such as mailing labels, invoices, sales reports, expense reports, name and address books, and product catalogs. You can roll out standard templates with your Impromptu catalogs and have users access them immediately.

Administration Guide 103

Chapter 13: Automating and Updating Impromptu The possibilities are endless when designing templates. For example, you can define two templates with similar headings but different page orientation (portrait and landscape). Or, you can use a single template and allow the user to switch the orientation as needed. To keep the proper alignment of headings with both paper orientations, use the alignment options Center, Left, and Right Aligned With Parent. Impromptu automatically adjusts to changes in page size and paper orientation. If you include placeholders in templates, to represent data items that should appear in the report, you make it easy for users to know the type of data to include in reports built from the template. Mailing labels, for example, might include placeholders for name and address. For information about creating templates, see the online book Mastering Impromptu Reports.

Example
As a world class company, it is important that you provide reports with a consistent look and feel for all of your Great Outdoors users. On the other hand, because The Great Outdoors company does span the globe, it is equally important that you give regional report users the ability to customize their reports to meet local requirements. In addition to controlling the look of reports, you must provide your users with "head starts" that enable them to build their own reports quickly and easily. To satisfy the common needs of your users, you create a set of standard templates and reports. For example, for senior, regional, and country managers, you create a template called Top Performers. Within this template are placeholders into which managers can place key sales data items, such as sales, product, and sales representative. The template automatically groups the data by the data items against which sales are measured, and then applies ranking and conditional highlighting to the report values so that key performers stand out immediately. Because you have already set up security by value for your regional and country managers, they automatically see the top performers within their own regions. For your salespeople, you create standard reports that outline their individual sales performance. In addition, you create both templates and standard reports that enable salespeople to browse customer and product information. The templates enable sales personnel to create their own customer and product reports, while the standard reports give all sales representatives the same kind of information in a consistent format. For your customers, you create a standard product brochure report. This report displays product information that your customers can use in their own promotions and sales outlets. Because you earlier secured the user class Outlets by denying its users the ability to create or change reports, your customers cannot change the information in your product brochure. They can use it in sales situations at any time.

Using Inheritance
Impromptus powerful inheritance features enable you to easily maintain and update the reports you distribute. Because all user classes are subordinate to yours, you control what each user class can access. Moving down the user class hierarchy, each user class automatically inherits the security restrictions of the user class above it. As a result, when you make a change near the top of the user class hierarchy, the change occurs throughout your entire user community. The inheritance of higher-level settings applies to: standard conditions, calculations, and prompts in the catalog. If your users have added a standard condition or calculation to a report, and you change the condition or calculation, the change is automatically reflected in the next report created. changes in table or folder access changes in the database or the business view Making changes in any of these areas causes the changes to automatically apply to your users. In the case of a shared catalog, all users access the information in a single catalog. Changing that catalog ensures that each user sees the changes the next time he or she opens that catalog. In the case of a distributed catalog, changes are inherited when the catalog distributes itself (makes a personal copy), or a personal copy is updated.

104 IBM(R) Cognos(R) Impromptu(R)

Chapter 13: Automating and Updating Impromptu

Updating and Maintaining Your Environment: An Example


The original creation of a reporting solution for The Great Outdoors company is actually a small part of your job as the database administrator. As processes and operations change within the company, you constantly receive requests for new reports. In addition, as the database changes over time, you are continually performing time-consuming maintenance on the reports that you distribute. For example, in a single day, you receive memos that inform you of the following company activities: European operations are changing effective one week from today, with the addition of new offices in both Greece and Holland. For security considerations, product sales history data is no longer to be distributed beyond the regional manager level. A major new account has been signed with a company named Total Fitness Shops. This new customer has over 40 retail outlets throughout the United States. After you update your corporate database to accommodate the new regional offices in Europe, and you add the data for the new account, updating the catalog to match is simple. To handle the new country offices in Europe, you enhance your European Customers condition so that it contains the new country codes for Greece and Holland. You could make this task even simpler if you store your country codes in a dataset and update the report that creates the dataset. To enforce the new security restrictions, you deny access to sales history data to all country managers. Impromptus inheritance feature ensures that sales personnel are automatically restricted in the same fashion. To make the users views of data match the new business view, you add a custom condition called Total Fitness Outlets to your catalog. This provides instant access to information about the new customer to all of your American managers and salespeople.

Automating Tasks with Macros


A macro is a set of instructions that enables you to automate complex or repetitive tasks. You can use macros to: generate reports use existing library functions and subroutines or ones that you create perform complex string and numeric operations open and close files activate other applications generate snapshots and HotFiles integrate applications using OLE As part of your overall distribution strategy, you can use IBM Cognos Scheduler, together with Impromptus advanced OLE automation methods and the IBM CognosScript macro language. By combining these powerful utilities, you can automate the distribution of Impromptu reports while integrating Impromptu with other applications at the same time. The three main utilities used to create, test, debug, and schedule Impromptu macros are: IBM CognosScript Editor IBM CognosScript Dialog Editor IBM Cognos Scheduler When you install Impromptu, these utilities are placed by default in the same program group as Impromptu.

IBM CognosScript Editor


You can use IBM CognosScript Editor to create, test, and debug macros. Use this utility to enter the macro commands using the IBM CognosScript language. You can run IBM CognosScript Editor from within Impromptu or directly from Windows. Administration Guide 105

Chapter 13: Automating and Updating Impromptu You can use IBM CognosScript Editor to: open, close, save and rename macros access the dialog editor create, copy, cut, undo, and find text check syntax (debugging) run macros debug or single-step through instructions set/clear breakpoints display functions Among other things, you can use IBM CognosScript and OLE automation to: create, read, update, and delete catalogs create and maintain joins write and edit expressions create and maintain user classes manage database connections For more information about IBM CognosScript Editor, refer to the IBM CognosScript Editor online Help.

IBM CognosScript Dialog Editor


You can use IBM CognosScript Dialog Editor to create custom dialog boxes for use in your more complex Impromptu macros. You can run this utility from within Impromptu or directly from Windows. For more information about IBM CognosScript Dialog Editor, refer to the Dialog Editor online Help.

IBM Cognos Scheduler


IBM Cognos Scheduler launches reports, programs, and macros based on times and dates that you specify. These scheduled launches are called "tasks." For example, you can create a task that launches: an IBM CognosScript macro that automatically runs a production report or builds a HotFile every day of the week, starting at 2:00 A.M. an Excel macro to run once a week on a specified day at a specified time. Your Excel macro might include OLE automation statements that automatically run a linked Impromptu report. an IBM CognosScript macro that automatically runs a set of Impromptu reports once a month, then mails the reports to a group of users a request to batch Impromptu reports on the database server Scheduler enables you to run programs after hours, freeing you for other work during the day and reducing network traffic during peak hours. Use IBM Cognos Scheduler to run automated processes at pre-set intervals, whether or not you are at your computer. You can use IBM Cognos Scheduler to run tasks unattended, since you can specify security parameters for your databases and Impromptu catalogs within the Scheduler. IBM Cognos Scheduler stores catalog user IDs and passwords in an encrypted format, so they are not visible when a task is running. Once you have created a task and scheduled it to run at a specific time, all you have to do is leave your computer on with IBM Cognos Scheduler running. At the specified time, IBM Cognos Scheduler will automatically perform the tasks. You can start IBM Cognos Scheduler: from the Cognos folder (the recommended method) from the Start button in Windows from the Windows Explorer by double-clicking Schdl_go.exe from Impromptu by choosing the Scheduler command from the Tools menu

106 IBM(R) Cognos(R) Impromptu(R)

Chapter 13: Automating and Updating Impromptu from Impromptu by clicking the Launch Scheduler button on the toolbar

To have IBM Cognos Scheduler run when you start Windows, copy the shortcut to the startup folder. To have IBM Cognos Scheduler working in the background, minimize it or run it from the Windows application tray on the taskbar. For more information about IBM Cognos Scheduler, refer to the Scheduler online Help.

Using the Impromptu Type Library


Impromptu comes with a type library that contains descriptions of all the exposed Impromptu objects, properties, and methods. The type library makes it easier for programmers in C++ to use Impromptu automation components in their code. To access the type library, reference the Impclient.tlb file in the folder where Impromptu is installed. For more information about automating and maintaining Impromptu, see the Impromptu Macro Help.

Manage the Size of Impromptu Reports


Impromptu reports can become large in size over time. An Impromptu.ini file setting lets you control the size of the report files by occasionally defragmenting or removing unused information when the files are closed.

Steps
1. Ensure that Impromptu Administrator is closed. 2. Using a text editor, browse to the Impromptu.ini file. The file is located in the installation_location/bin directory. 3. Open the file and in the [Startup Options] section, find the following setting:
Report Defrag Threshold=<n>

4.

5. 6. 7. 8. 9.

If this setting does not exist, add it. To achieve full compression, set the Report Defrag Threshold value to 100. Setting the Report Defrag Threshold value to 0 (zero), turns off defragmentation. If you set Report Defrag Threshold to a value other than 0 (zero), the value is read as a percentage of the amount of accessible data in the report before the report is defragmented. If the percentage of accessible data falls below the threshold value you set, the report will be defragmented and the unused data in the report will be removed. For a complete description of the Report Defrag Threshold setting, see the Impromptu User Help. Save and close the Impromptu.ini file. Start Impromptu Administrator and open the report. If prompted to upgrade the report, select Yes. From the File menu, click Save. From the File menu, click Close.

Important: If you do not close the report, it does not get compressed.

Administration Guide 107

Chapter 13: Automating and Updating Impromptu

108 IBM(R) Cognos(R) Impromptu(R)

Set Up Database Access


A database is a collection of data related to a particular purpose. A database can contain tables, views, synonyms and stored procedures. Impromptu supports local and remote databases. You can access local databases on your computer remote databases (all others) via the database vendors application program interface (API) or via an ODBC Gateway driver

Supported Databases
Impromptu often changes supported databases between release versions. To define and edit database definitions for users of a pre 32-bit release, you may need to use the Database Definition Manager from that release. For information about the databases supported by Impromptu, visit the Cognos Software Services Web site (http://support.cognos.com).

Distributed Sorting
When setting up database access, you must consider how your database sorts data. You need to determine if your database sorts data in the same order as the operating system on which your IBM Cognos products is installed. To ensure that data is sorted appropriately, you may need to make minor modifications to our database connection. For more information about controlling and troubleshooting distributed sorting in IBM Cognos products, visit the Cognos Software Services Web site (http://support.cognos.com).

What You Can Do


To access a database for the first time, you need to create a database definition. You can then use this definition in the Impromptu catalogs you create. After you create a database definition, you can change or remove the database definition select a different database for the catalog connect to and disconnect from the database

Create a Database Definition


Before you create any catalogs, you must first create the database definitions for the databases you want to use with Impromptu. A database definition consists of the logical name you give the database the type of database the location of the database security information Many databases have unique definition requirements. The Test button is not available until you provide the minimum information required for the database definition. If you want to change a database definition, you do not need to define it again. You need to edit the current definition.

Create a Database Definition for DB2


Steps
1. From the Catalog menu, click Databases. 2. In the Database Gateways and Drivers box (Database Definition Manager dialog box), select DB2. 3. Click New Database.

Administration Guide 109

4. In the Logical Database Name box (Database Definition dialog box), type a name for the database. 5. In the DB2 Database Name box, type a name for the DB2 database. 6. In the DB2 Connect String box, type the information you want appended to the database connect string. 7. Select the User ID and Password check boxes in User Prompts to prompt users for their user ID and password when they use this database. 8. To set the timeouts under the Timeouts box, do the following In the Connect box, set the time (in seconds) you want Impromptu to wait for the DB2 Gateway to connect to the database. In the Reply box, set the time (in seconds) you want the database to wait for your reply before timing out. 9. Select the Use Asynchronous Open check box to let users use other applications while Impromptu waits for the database connection. By default, Asynchronous Open is turned off and you cannot work with other applications while Impromptu waits for data, unless you cancel the query. 10. Click Test. If Impromptu cannot connect to the database, a dialog box appears describing the error. You may have to reboot your system to resolve this connection error. 11. Click Options to use an alternative concatenate operator, or pattern escape metacharacter. 12. Click OK.

Problems with Date-Time Expressions from Earlier Versions


For reports upgraded from Impromptu 5.0 or earlier versions, an error message may appear if you use the DB2 UDB varchar() function and the first argument is a date, time, or datetime datatype. When these reports are run in Impromptu 5.0 and the first argument is a date, time, or datetime, DB2 interprets it as a character string and the second argument is accepted automatically. When these same reports are upgraded to Impromptu Series 7 and subsequent releases, DB2 treats the first argument as a date, time or datetime, and the second argument produces an error message. To fix this problem, remove the second argument from the varchar() function in your report query. For DB2 under AS/400, this is not an issue. The database does not accept date, time, or datetime datatypes as the first argument when using the varchar() function.

Problems with Comma Decimal Points


If your DB2 database uses commas instead of periods as the decimal point, an error message may appear when you run a calculation that uses decimal numbers. Impromptu converts the commas to periods before submitting the calculation to DB2. To prevent the commas from being converted, in your Cogdmd2.ini file, type the following:
[Exceptions Separators DATABASE:DSN] Decimal_Separator="locale specific" [Exceptions Delimiters DATABASE:DSN] Numeric_Delimiter="'"

Problems Involving DB2 MVS and CASE Expressions


An error message appears if Impromptu sends a CASE expression with an IN predicate as part of a query to a DB2 MVS database. For example, the following expression contains an IN predicate:
IF ( Module Code = 'PO' and Process Enabled Flag IN ( 'Y', 'N' ) ) THEN 'YN' ...

This expression produces SQL like


"select ... CASE WHEN ((T1.\"S_MODULE_CD\" = 'PO') and (T1.\"PROCESS_ENABLED_FL\" IN ('Y','N'))) THEN ('YN') ..."

110 IBM(R) Cognos(R) Impromptu(R)

This SQL produces an error message if sent to a DB2 MVS database. The error message shown looks something like this:
DMS-E-GENERAL, A general exception has occurred during operation 'prepare request'. DMS-E-GENERAL, A general exception has occurred during operation 'prepare request'. [IBM][CLI Driver][DB2] SQL0582N A CASE expression in a VALUES clause, IN predicate, GROUP BY clause, or ORDER BY clause cannot include a quantified predicate, an IN predicate using a fullselect, or an EXISTS predicate. SQLSTATE=42625

To avoid this error, process the query locally or replace the CASE expression in the query SQL. For example, replace the previous CASE expression with something like this:
IF ( Module Code = 'PO' and ( Process Enabled Flag = 'Y' or Process Enabled Flag = 'N' ) ) THEN 'YN' ...

Create a Database Definition for a HotFile


You can save report data in a file called a HotFile, which you can then make available to a catalog. You can then use the data in the HotFile like a regular database table. You can create a HotFile from any database. To use a HotFile in a catalog, you create a database definition for the HotFile. Because all HotFiles that are in the same local or network folder are treated as a database, you can access tables from several different databases simultaneously. For example, you notice that people regularly use certain HotFiles, you put the HotFiles in a folder on the LAN and create a database definition for the LAN folder.

Steps
1. From the Catalog menu, click Databases. 2. In the Database Gateways and Drivers box (Database Definition Manager dialog box), select HotFile. 3. Click New Database. 4. In the Logical Database Name box (Database Definition dialog box), type a name for the database. 5. In the Location box, select the location of the HotFile folder on your hard disk or LAN. 6. Click Test. If Impromptu cannot connect to the HotFile, a dialog box appears describing the error. 7. Click OK.

Create a Database Definition for Informix


The Informix gateway is used to access Informix, XPS, and Dynamic Server IDS databases. 1. From the Catalog menu, click Databases. 2. In the Database Gateways and Drivers box (Database Definition Manager dialog box), select Informix. 3. Click New Database. 4. In the Logical Database Name box (Database Definition dialog box), type a name for the database. 5. In the Database Name box, type the name of the database as it appears on the server that you are accessing. 6. In the Host Name box, type the name of the node where the database is located. Note: This name must specify a server on the network. 7. In the Database Server Name box, type the name of the server or node where the database is located.

Administration Guide 111

8. Select the User ID and Password check boxes in User Prompts to prompt users for their user ID and password when they use this database. Specify the service name that the database will use to listen for incoming connection requests by clicking the SQLEXEC option button SQLTURBO option button User-specified option button and typing a name in the text box The service name can be a maximum of 19 characters in length. See your Informix documentation for more information. 9. Click Test. If Impromptu cannot connect to the database, a dialog box appears describing the error. 10. Click OK.

Create a Database Definition for Microsoft SQL Server via OLE DB


You can access Microsoft SQL Server using OLE DB. 1. From the Catalog menu, click Databases. 2. In the Database gateways and drivers box (Database Definition Manager dialog box), select Microsoft SQL Server OLE-DB. 3. Click New Database. 4. In the Logical database name box (Database Definition - OLE DB dialog box), type a name for the database, for example, GOSALES. 5. In the Provider box, type the name of the data provider sqloledb. 6. In the Provider string box, type the database connect string and be sure to identify the default database. Use the actual database name, for example, database=gosales. 7. In the Data Source box, type the name of the server where the database is located. 8. Select the User ID check box to have users prompted for a user ID when they use the database. 9. Select the Password check box to have users prompted for a password when they use the database. 10. Click OK.

Create a Database Definition for ODBC


The ODBC gateway connects to a variety of ODBC drivers that access a wide variety of database systems. Depending on the database, you may have to perform additional tasks. For example, if your dBASE system uses the OEM character set, you must convert to the ANSI character set before you begin using your ODBC connection. For information, see your dBASE documentation.

Special Considerations
Several ODBC data sources including AS/400 via IBM's CA and DB2 support the extended SQL syntax: Optimize for n rows. For Impromptu to add this syntax to the SQL passed to these databases, search in the Cogdmod.ini file in the bin folder for the keyword Optimize and read the instructions in that section. Impromptu issues metadata requests via ODBC for table, column, index and API calls (such as, sqlStatistics and sqlSpecialColumns) as it creates a catalog or during query execution. Impromptu now defers fetching metadata for API calls (such as, sqlStatistics and sqlSpecialColumns), indexes, and tableType until required. These fetches can be deferred forever if dbkeys are supported, blobs are not accessed, and scrollable cursors are not used. If you are connected to a RedBrick database through ODBC, an error message may appear when you use the sqlTables function. To avoid the error, contact RedBrick for a patch.

112 IBM(R) Cognos(R) Impromptu(R)

To access DB2 through ODBC, you must type a ODBC connect string in the ODBC Connect String box in Database Definition Manager to tell Impromptu which DB2 server you are using. DB2 server type MVS/ESA OS/400 VSE & VM UDB ODBC connect string SQL_DBMS_NAME=DSN SQL_DBMS_NAME=QSQ SQL_DBMS_NAME=ARI SQL_DBMS_NAME=SQL

Here is an example connection string:


attachdirect d1 dblogicname "DB2" "DSN=DB2;UID=user;SQL_DBMS_NAME=DSN;PWD=password@ASYNC=1@0/0" OD

Steps
1. From the Catalog menu, click Databases. 2. In the Databases Gateways and Drivers box (Database Definition Manager dialog box), select ODBC. 3. Click New Database. 4. In the Logical Database Name box (Database Definition dialog box), type a name for the database. 5. In the ODBC Data Source box, select a data source. 6. In the ODBC Connect String box, type the information you want appended to the connect string for the database. Some ODBC drivers (for example, for Oracle) permit you to specify additional information, such as network type or password, when connecting to ODBC. For more information, see your ODBC documentation or speak to your network administrator. 7. Select the User ID and Password check boxes in User Prompts if you want the users to be prompted for their user ID and password when they use this database. 8. To set the timeouts under the Timeouts box, do the following: In the Connect box, set the time (in seconds) you want Impromptu to wait for the ODBC Gateway to connect to the database. The default setting is 0, where Impromptu waits indefinitely for the ODBC Gateway to connect to the database. If the ODBC Gateway fails to connect to the database in the set time, then Impromptu reports the failure as an error message. In the Reply box, set the time (in seconds) you want the database to wait for your reply before timing out. The default is 0, where the database waits indefinitely for your reply. 9. Select the Use Asynchronous Open check box to let users use other applications while Impromptu waits for the database connection. By default, Asynchronous Open is turned off and you cannot work with other applications while Impromptu waits for data, unless you cancel the query. Some ODBC Gateways do not support Asynchronous Open. Refer to the documentation for your ODBC Gateway for more information. 10. Click Test. If Impromptu cannot connect to the database, a dialog box appears describing the error. 11. From the Tools menu, click ODBC Administrator. Note: ODBC Administrator is also available from the control panel. 12. Define your ODBC data source using the ODBC Administrator (Data Sources dialog box). Note: You must define the data source using the ODBC Administrator before you can access the data source from Impromptu. For more information see the documentation for your ODBC driver. 13. Click Options to use an alternative concatenate operator, or pattern escape metacharacter. Administration Guide 113

14. Click OK.

Create a Database Definition for Oracle


You can configure the amount of data retrieved from Oracle either by buffer size or number of records. For more information, see the Fetch Buffer Size and Fetch Number of Rows entries in the Cogdmor.ini file in the installation_location\cern\bin folder. If you use user-defined functions with an Oracle database, an error may appear saying that there was a type-mismatch. This error could be caused by a DATE input parameter value being converted to a DATETIME value or some other similar conversion within Impromptu. To fix this problem, add the following to the [UDA Misc] section of your Cogdmor.ini file:
[UDA Misc] Check_Input_Parm_Types=F

Steps
1. From the Catalog menu, click Databases. 2. In the Databases Gateways and Drivers box (Database Definition Manager dialog box), select Oracle. 3. Click New Database. 4. In the Logical Database Name box ( Database Definition dialog box), type a name for the database. 5. In the SQL*Net Connect String box, type the logical database name or the SQL*Net connect string. For more information about the SQL*Net connect string, see your Oracle documentation. 6. In the Gateway Type box, select None. 7. Click Test. If Impromptu cannot connect to the database, a dialog box appears describing the error. 8. Click OK.

Create a Database Definition for Sybase Adaptive Server Enterprise


You can configure the amount of data retrieved from Sybase during fetch operations. For more information, see the NUMOFROWS entry in Cogdmct.ini in the installation_location\cern\bin folder.

Steps
1. From the Catalog menu, click Databases. 2. In the Databases Gateways and Drivers box (Database Definition Manager dialog box), select Sybase Adaptive Server Enterprise. 3. Click New Database. 4. In the Logical Database Name box (Database Definition dialog box), type a name for the database. 5. In the SQL Server Name box, type or select the name of the server used by the database. If you do not know the name of the server, check your Sql.ini file. 6. In the User Prompts, select the Password check box to prompt users for their password when they use this database. The User ID check box is selected by default, and cannot be cleared. 7. In the Database Name box, do one of the following to specify the databases that your users can access click Master if you want users to see all the databases whether or not they have access to them click User-Specified and type the name of the database to which users will be restricted 8. In the Timeouts box, set the timeout by doing the following

114 IBM(R) Cognos(R) Impromptu(R)

9.

10.

11.

12.

13.

In the Connect box, enter the time (in seconds) you want Impromptu to wait for Sybase Adaptive Server Enterprise to connect to the database. The default setting is 0, where Impromptu waits indefinitely for the Sybase Adaptive Server Enterprise driver to connect to the database. If Impromptu fails to connect to the Sybase Adaptive Server Enterprise driver within the specified time, then Impromptu reports the failure as an error. In the Reply box, enter the time (in seconds) you want the database to wait for your reply before timing out. The default setting is 0, where Impromptu waits indefinitely for your reply. In the Network box, set the network options by doing the following For Packet Size, type the size of each packet you send over the network. Ask your network administrator about the maximum packet size you can send over your network. For Async Level, set the asynchronous processing value to 1 (the minimum) to enable faster processing within Impromptu. If you set it to 4 (the maximum), processing is faster within other applications but Impromptu is slower. In the Polling Time Slice box, type the number of milliseconds you want the Sybase Adaptive Server Enterprise to wait for a response from the network. For example, if you want the time to be 1.5 seconds, type 1500. In the Application Name box, type the name of the application that you want to see on the server. This information is obtained from the sys_processes table. Click Test. If Impromptu cannot connect to the database, a dialog box appears describing the error. You may have to reboot your system to resolve this connection error. Click OK.

Administration Guide 115

116 IBM(R) Cognos(R) Impromptu(R)

Change a Database Definition


You can change the name, location or type of the database for a database definition at any time. The [Databases] section of the Cognos.ini file automatically updates when you change the logical database name the database type or database gateway other entries (for example: SQL*Net connect string for Oracle) If you change a database definition, you need to update your users' Cognos.ini files.

Steps to Change a Database Definition


1. From the Catalog menu, click Databases. 2. In the Databases Gateways and Drivers box (Database Definition Manager dialog box), select a logical database. 3. Click Edit. Note: The Edit button is enabled only when a logical database is selected and is disabled for all other tree selections. 4. Make all required changes and click OK.

Copy a Database Definition


If you want to create a new database definition with a lengthy connection string that is similar to an existing one, you can copy and then edit the existing definition. You can also copy a database definition and alter it when you are readying a catalog for deployment.

Steps
1. From the Catalog menu, click Databases. 2. In the Databases Gateways and Drivers box (Database Definition Manager dialog box), select a logical database. 3. Click Copy. Note: The Copy button is enabled only when a logical database is selected and is disabled for all other tree selections. 4. In the Logical Database Name box (Database Definition dialog box), the name of the selected database is prefixed with the string "Copy of". To rename the database, type a new name in the Logical Database Name box. 5. Click OK.

Remove a Database Definition


You can remove a database definition from Impromptu if you no longer require access to the related database. Removing the database definition removes the connection information for the database from the [Databases] section of the Cognos.ini file. It does not remove the database information from the catalog. If you later open a catalog that contains the database definition you removed, Impromptu connects the database definition to the Cognos.ini file again. Whenever the database administrator makes changes to the structure of the database (the columns and tables that already exist in reports), you may need to perform maintenance on your catalogs and reports to ensure that they correctly refer to the tables and columns they need.

Steps
1. From the Catalog menu, click Databases. 2. In the Databases Gateways and Drivers box (Database Definition Manager dialog box), select a logical database. 3. Click Delete. Note: The Delete button is enabled only when a logical database is selected and is disabled for all other tree selections. Administration Guide 117

4. Click OK.

Select a Different Database for a Catalog


You can change the database used by a catalog. The database you select may have a completely different structure from the previous database. You can use the Tables dialog to edit the catalog structure to match the new database.

Example
You created a catalog that was attached to a test database. You are ready to deploy the catalog, but you want it attached to the production database. You select a different database for the master catalog to access before deploying the catalog.

Steps
1. From the Catalog menu, click Tables and click the Edit tab. 2. In the Database box, select a database. 3. Click OK.

Connect to the Database


You need to connect a catalog to the database before you can access the tables and columns in the database. When you open a catalog, Impromptu automatically connects to the database. When you open a report, the related data is also automatically retrieved from the database. Automatic connection can be switched off so you can open reports without automatically retrieving data from the database.

Step to Manually Connect to a Database


With a catalog open, click Connect from the Catalog menu. Note: The Connect command is only available if you are currently disconnected from the database. You may be prompted to log on as follows: In the User Class box, select your user class to log on to the catalog. In the Database box, type your user ID and password to log on to the database, and click OK. If Impromptu cannot connect to the database, a dialog box appears.

Steps to Enable Automatic Connection to the Database


1. From the Tools menu, click Options and then click the General tab. 2. Select the Auto-Attach To The Database When Catalog Is Opened check box and click OK.

What If ...
You want to disconnect from a database? From the Catalog menu, click Disconnect. You will want to disconnect if your laptop does not have access to the database the database server is unavailable you want to work with a snapshot of the data

118 IBM(R) Cognos(R) Impromptu(R)

Chapter 14: Create and Customize a Chart


In Impromptu, you can add charts to reports to show data graphically. You can choose from several different chart types. After you add a chart, you can change the chart type or customize the chart to improve readability and presentation. In particular, you can add chart titles, use grid lines and include a legend. You can also add labels for the data in a chart, and specify the format for the labels, such as style, font type, and size. For certain chart types, you can add a trendline. For a list of the controls related to chart formatting, see (p. 141). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135).

Choosing a Chart Type


Description
A chart is a visual representation of data that you can use to quickly and easily evaluate information. To choose a chart type, consider what you want the chart to illustrate. Different chart types and configurations emphasize different things. Purpose Show contributions of parts to a whole Compare variables Compare trends in data over time Highlight trends Compare trends and relationships between data Create a graphical view of a project schedule Compare the difference between values such as stock prices Chart type pie bar area radar correlation Gantt HLCO (high low close open) HLO (high low open) Identify a pattern scatter bubble

Area Charts
Area charts show trends in data over time by emphasizing the total quantity of several data items under the curve. If data is ungrouped, the chart shows the group summaries for the first data item. If data is grouped, each data item shows as a data group on the primary axis. Area charts can have depth added, or have a three-dimensional layout. Area charts plot data on the primary axis.

Administration Guide 119

Chapter 14: Create and Customize a Chart

Bar Charts
Bar charts highlight changes over time and compare totals and individual values. A bar chart can reveal trends and patterns. If data is ungrouped, each bar represents a summarized data item or a summarized row of values for a data item. If data is grouped, each bar represents a group. Bar charts can have depth added, or have a three-dimensional layout. Bar charts plot data on the primary axis.

Bubble Charts
Bubble charts are line charts in which the data points are represented typically by bubbles. The advantage of using a bubble chart instead of a line chart is that the size of the marker provides quantitative information. Bubble markers can be changed to other formats such as stars. Bubble charts plot data on the primary axis, secondary axis, and measure line. The measure data value is represented by the size of the bubble.

Correlation Charts
Correlation charts are bar charts overlaid with a line chart that allows you to show two different measures with a shared x-axis and two y-axes. The left and right y-axes can each have a different scale, enabling you to visually correlate dissimilar measures. For example, you can show products on the shared x-axis, with order income on the right-hand y-axis and order revenue on the left-hand y-axis, and visually compare the relationship between order income and order revenue for each product. For information about how to create a correlation chart, see (p. 132). For information about how to format a correlation chart, see (p. 132).

Gantt Charts
Gantt charts provide a graphical view of a project schedule. Gantt charts are horizontal. To create a Gantt chart, you must group your data, and the second data item must be greater than the first data item. Gantt charts plot data on the primary axis and the secondary axis.

HighLowCloseOpen (HLCO)
HighLowCloseOpen (HLCO) charts highlight changes for a specific time period to compare the difference between pairs of values. HighLowCloseOpen charts plot data on the primary axis, secondary axis and measures line. You can also use the HighLowCloseOpen chart type to create a HighLow chart and a HighLowClose chart. To create a HighLow chart, you do not specify a measure value. To create a HighLowClose chart, specify one measure.

HighLowOpen (HLO)
HighLowOpen (HLO) charts track financial data such as the daily high, low and open price of a stock. It is a variation of the HighLowCloseOpen chart. HighLowOpen charts plot data on the primary axis, secondary axis and measures line. The measure line plots only one measure.

Line Charts
Line charts plot data at equidistant points connected by lines to illustrate trends. Line charts are commonly used to show trends over time. Because the markers in a line chart can be formatted to take a up very little space, line charts are useful when you want to plot charts that have many data values. If data is ungrouped, the chart shows a single line containing points for each data item.

120 IBM(R) Cognos(R) Impromptu(R)

Chapter 14: Create and Customize a Chart If data is grouped, the chart shows multiple lines for each data item. The primary axis shows the data groups. Line charts plot data on the primary axis. Line charts can have depth added, or have a three-dimensional layout. Line charts with depth are known as tape charts. A log chart is a line chart that uses a logarithmic scale.

Pie Charts
Pie charts show the relationship of parts to the whole. Data is represented as pie-shaped segments in a circle. Pie charts can have depth added. If data is not grouped, each segment represents a data item. If data is grouped, each segment represents a group summary. Pie charts plot data on the primary axis.

Radar Charts
Radar charts are used primarily as a comparative tool. Multiple data values are plotted on a circle and joined by connecting lines to create a radial figure. You can use either the area created by the connecting lines or the actual values on the chart to do a comparative analysis. Radar charts plot data on the primary axis.

Scatter Charts
Scatter charts highlight the correlations between large sets of data or several changing data items. It is commonly used to analyze data when there is no obvious correlation between two pieces of data, such as revenue versus inventory counts. It can be used to identify a pattern by illustrating the relationship between independent variables. Scatter charts plot data on the primary axis and the secondary axis.

Create a Chart
Description
To create a chart, you pick the data that you want to appear in the chart. Depending on the chart type you select, you can plot one or more data values. Data values are plotted for the primary axis, secondary axis, and for measures. For more information about the chart types available and the data requirements for each, see "Choosing a Chart Type" (p. 119). You can manipulate the view of the data by pivoting the data on the primary axis changing the data mode and viewing the date either by row or column Before you create a chart, you must define the report query. For more information, see the following entry in the online help index: reports, creating.

Steps
1. With a report open, from the Insert menu, click Chart Frame. 2. Place the pointer where you want to locate the upper-left corner of the frame and drag the mouse diagonally until the frame is the size you want. The Chart Properties dialog appears. 3. In the Chart type box, click the chart type. The chart type sets whether you can plot one or more data values. 4. On the Data tab, in the Query data box, select the data items for the query. Use the arrow to move data items from the Query data box to the Primary Axis, Secondary Axis, and Measure(s) boxes, as required. Only numeric data items appear in the Query data box. Administration Guide 121

Chapter 14: Create and Customize a Chart Tip: To remove a data item, click the data item located in the Primary Axis, Secondary Axis, or Measure(s) box, and click the arrow. 5. On the Data tab, do one or more of the following. Goal Show in a chart the first row in a grouped data item. Action In the Mode box, click By Row.

Show in a chart the first column in a grouped In the Mode box, click By Column. data item. Swap rows and columns. You must have at least one grouped data item. Click Pivot data. If you swap rows and columns in a chart that is grouped by rows, it becomes grouped by columns. Select the Plot null data check box. Select the Plot negative data check box.

Plot null data. Plot negative data. 6. Click OK.

More Info What if ...


You are upgrading a chart and the chart does not have the correct number of data values specified for the chart type? You can upgrade or open the report but you receive a warning. You cannot apply the settings for the chart until the required data values are specified. You want to remove a chart? Select the chart and press the Delete key. You want to create a 100% pie chart? Select the pie chart type, and then on the Format tab of the Chart Properties dialog box, click Properties. In the Properties dialog box, on the Data Labels tab, select the Show Values and As Percentage check boxes. You want to create a percent or stacked bar chart? Select the bar chart type, and then on the Format tab of the Chart Properties dialog box, click Properties. In the Properties dialog box, on the Layout tab, select Percent or Stacked. You want to create a horizontal bar chart? In the Chart type list, select Bar chart, and then on the Format tab of the Chart Properties dialog box, click Properties. In the Properties dialog box, on the Layout tab, under Axes, select the Horizontal option. You want to create a bar chart with depth that is horizontal and 100% stacked. In the Chart type list, select Bar chart, and then on the Format tab of the Chart Properties dialog box, click Properties. In the Properties dialog box, on the General tab, click Depth and specify the amount of depth. On the Layout tab, select Stacked and Horizontal. You want to create a three-dimensional bar chart. In the Chart type list, select Bar chart, and then on the Format tab of the Chart Properties dialog box, click Properties. In the Properties dialog box, on the Layout tab, select True 3D Column. The three-dimensional layout is only available when the bar chart plots data vertically, that is, on the x-axis.

Tips
To quickly access the Chart properties, right-click the chart and click Properties.

122 IBM(R) Cognos(R) Impromptu(R)

Chapter 14: Create and Customize a Chart

Related Topics
"Choosing a Chart Type" (p. 119) "Format a Chart" (p. 123)

Change the Chart Type


Description
There are many chart types that you can choose when adding a chart to a report. Choosing the appropriate chart type depends on the purpose of the chart. For example, if you want to compare parts to the whole, a pie chart is suitable. If you want to compare quantitative data such as annual sales, you may want to use a bar chart. For more information, see "Choosing a Chart Type" (p. 119). Charts plot data values on one or more axis. If you change chart type, ensure that you specify data values for each of the required axes.

Steps
1. Right-click the chart and click Properties. Check that the Chart Properties dialog box opened. If another dialog box opened instead, you did not have the chart selected. Click Cancel to close the dialog box, press Esc to clear your selection, and try again. 2. In the Chart type box, click a chart type. 3. Click the Data tab and specify any additional data values, if required. For example, a pie chart requires only primary axis values whereas a scatter chart requires both primary and secondary axis values. 4. Click OK.

Related Topics
"Format a Chart" (p. 123) "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Format Data Items" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Format a Chart
Description
There are many formatting options that you can use to enhance your charts. For example, you can add a footnote, change the chart background color, add a legend, and so on. When formatting charts, you can define properties that apply to the entire chart or to particular data items in the chart. To format particular data items, use the Customize per Data Item dialog box. (p. 128) To define chart properties that apply globally, use the Properties dialog box.

Steps
1. Right-click the chart, click Properties, and then click the Format tab. Check that the Chart Properties dialog box opened. If another dialog box opened instead, you did not have the chart selected. Click Cancel to close the dialog box, press Esc to clear your selection, and try again.

Administration Guide 123

Chapter 14: Create and Customize a Chart 2. Click the Format tab and use the available controls to set the chart properties. The tabs and settings that appear can vary depending on the chart type you select. Here are some of the formatting changes you can make. Goal Specify a layout type such as stacked, percent, and true 3D column. Add data labels. Add a legend. Add dual axes. Show trendlines. Add a chart title, subtitle, or footnote. Add a title for the category or value axis. Add a series title. Customize the grids and scales of the category axis, y-axis, and series axis. Customize data items. Change the chart, plot or legend background color. Change the font formatting of such chart characteristics as chart titles, legend text, and data labels. Click Grids and Scales. Click Customize per Data Item. In the Chart background box, click the item to format, and click Edit. In the Font formatting box, click the item to format, and click Edit. Action Click Properties, and click the Layout tab. Click Properties, and click the Data Labels tab. Click Properties, and click the Look tab. Click Properties, and click the Layout tab. Click Trendlines. Click Titles.

3. To accept your formatting changes, click OK.

Related Topics
"Change the Chart Type" (p. 123) "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Format Data Items" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Add Chart Titles


Description
Charts can have a main title, a subtitle, a footnote, a category axis title, a Y1 axis title, a Y2 axis title, and a series axis title. You can specify a title for the Y1 and Y2 axes, if your chart has dual value axes. The series axis title is available only for three-dimensional charts. The category and value titles (Y1 and Y2) are available only in charts that use the x-axis and y-axis, respectively.

124 IBM(R) Cognos(R) Impromptu(R)

Chapter 14: Create and Customize a Chart

Steps
1. Right-click the chart, click Properties, and then click the Format tab. Check that the Chart Properties dialog box opened. If another dialog box opened instead, you did not have the chart selected. Click Cancel to close the dialog box, press Esc to clear your selection, and try again. 2. On the Format tab, click Titles, and then in the Titles dialog box, choose from the available options. Select the Title check box and type a main title for the chart Subtitle check box and type a subtitle. A subtitle appears beneath the main title. Footnote check box and type a footnote. A footnote appears in the lower, right-hand corner of the chart. Category Title check box and type a title for the x-axis Value Title (Y1) check box and type a title for the Y1-axis Value Title (Y2) check box and type a title for the Y2-axis Series Axis check box and type a series title 3. Click OK. After you have added a title, you can format it using the Font formatting box located on the Format tab of the Chart Properties dialog box. See, (p. 125).

More Info What if ...


You want to remove titles? Clear the appropriate check box: Title, Subtitle, Footnote, Category Title, Value Title (Y1) Value Title (Y2) and Series Axis.

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123) "Format the Chart, Plot, and Legend Area" (p. 126) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Format Data Items" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Format Chart Titles, Axis Titles, Data Labels, and Legend Text
Description
Certain chart objects such as chart and axis titles, data labels, and legend text permit font formatting. Font formatting includes specifying font color, size, style and alignment. Certain objects, such as data labels, also permit rotation. Rotating objects can be useful when you want to avoid overlapping text.

Steps
1. Right-click the chart, click Properties, and then click the Format tab. Check that the Chart Properties dialog box opened. If another dialog box opened instead, you did not have the chart selected. Click Cancel to close the dialog box, press Esc to clear your selection, and try again. 2. On the Format tab, in the Font formatting box, click the object to format, such as Data Labels. Administration Guide 125

Chapter 14: Create and Customize a Chart 3. Click Edit and, in the Formatting dialog box, specify the format characteristics. 4. Click OK twice. The chart appears with the new formatting you specified.

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123) "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Format Data Items" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Format the Chart, Plot, and Legend Area


Description
The chart has three distinct areas that you can format: chart, plot and legend. The plot area is that area of the chart enclosed by the x-axis and the y-axis. The legend area refers to the legend background. The chart area includes the remaining areas other than the plot and legend areas. For the chart, plot and legend areas, you can customize the line and fill properties.

Steps
1. Right-click the chart, click Properties, and then click the Format tab. Check that the Chart Properties dialog box opened. If another dialog box opened instead, you did not have the chart selected. Click Cancel to close the dialog box, press Esc to clear your selection, and try again. 2. On the Format tab, in the Chart background box, click the chart, plot or legend area, and then, click Edit to specify the fill color, pattern, and pattern color. 3. Click OK twice. The chart appears with the new formatting you specified.

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123) "Add Chart Titles" (p. 124) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Format Data Items" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Change the Axis Labels and Scale Settings


Description
Customize the axis labels and scale settings in a chart to enhance your charts.

126 IBM(R) Cognos(R) Impromptu(R)

Chapter 14: Create and Customize a Chart Note that the tabs and settings that appear in the Grids and Scales dialog box can vary depending on the chart type you select.

Steps
1. Right-click the chart, click Properties, and then click the Format tab. 2. On the Format tab, in the Display options box, click Grids and Scales. 3. In the Grids and Scales dialog box, click the axis to format. Depending on the chart type and chart layout, you can have a Y1 axis, Y2 axis, X Axis, Category Axis, Z Axis, and Series Axis. The Series Axis is only valid for three-dimensional charts. The Y2 Axis appears when the chart has dual axes. The Z Axis appears for bubble and scatter charts. 4. On the General tab, specify where you want the axis labels to be located. In addition to specifying the location, you can arrange the value labels in descending order and the category labels in reverse order. 5. On the Labels tab, choose whether to show or hide the axis labels. For the X Axis, you can stagger the labels or manually set the number of categories you want to show. For the Y Axis, you can specify whether to show the maximum or minimum value label. 6. On the Scales tab, format the chart scale. Note that the Scales tab is not available if the Series Axis or Category Axis tab is selected. Here are the formatting changes you can make. Goal Specify a logarithmic scale Start the scale with zero Manually set the maximum value on the scale Action Select the Make Logarithmic check box. Select the Always Include Zero check box. Select the Set Maximum Value check box, and enter a value in the box.

Manually set the minimum value on the scale Select the Set Minimum Value check box, and enter a value in the box. 7. Click OK twice to accept your formatting changes. Tip: After you have added axis labels to the chart, you can specify such characteristics as font style, color, alignment, and rotation. For more information, see (p. 125).

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123) "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Change the Grids Settings" (p. 128) "Format Data Items" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Administration Guide 127

Chapter 14: Create and Customize a Chart

Change the Grids Settings


Description
Grid settings let you add major and minor grid lines to a chart and add and specify the location of grid labels. Note that the tabs and settings that appear in the Grids and Scales dialog box can vary depending on the chart type you select.

Steps
1. Right-click the chart, click Properties, and then click the Format tab. 2. On the Format tab, in the Display options box, click Grids and Scales. 3. In the Grids and Scales dialog box, click the axis to format. Depending on the chart type and chart layout, you can have a Y1 axis, Y2 axis, X Axis, Category Axis, Z Axis, and Series Axis. The Series Axis is only valid for three-dimensional charts. The Y2 Axis appears when the chart has dual axes. The Z Axis appears for bubble and scatter charts. 4. On the Grids tab, specify whether to show the major and minor grid lines. If you add grid lines, you can specify a grid style, such as Outer Ticks, and you can manually specify the grid intervals. For certain charts, you can also add and specify the location of a custom grid line by selecting the Draw Custom Line at check box. 5. Click OK twice to accept your formatting changes.

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123) "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Change the Axis Labels and Scale Settings" (p. 126) "Format Data Items" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Format Data Items


Description
Formatting the data items in a chart can enhance the appearance of the chart and better communicate information in the chart. Depending on the chart type, you can set data item properties such as color, line style, marker style, and marker size.

Steps
1. Right-click the chart, click Properties, and then click the Format tab. Check that the Chart Properties dialog box opened. If another dialog box opened instead, you did not have the chart selected. Click Cancel to close the dialog box, press Esc to clear your selection, and try again. 2. Click Customize Per Data Item and set any properties you want for any data items, then click OK twice.

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123)

128 IBM(R) Cognos(R) Impromptu(R)

Chapter 14: Create and Customize a Chart "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Hide or Show Data Labels in a Chart


Description
You can hide or show data labels in a chart. You can also format the data labels by adding bolding, for example, as well as changing the font type and size.

Steps
Right-click the chart, click Properties, and then click the Format tab. On the Format tab, in the Display options box, click Properties. In the Properties dialog box, click the Data Labels tab. To have data labels appear in the chart, select the Show Data Labels check box. In the Labels Location box, choose where you want the labels located. You can choose Outside Maximum Inside Maximum Center Base of Chart 6. In the Label Format box, choose how labels appear. You can specify Value Label Label & Value 7. Click OK twice. 1. 2. 3. 4. 5.

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123) "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Format Data Items" (p. 128) "Add and Format a Chart Legend" (p. 129) "Show TrendLines" (p. 131)

Add and Format a Chart Legend


Description
You can include a chart legend with your chart. When you add a legend, the chart is resized within the boundaries of the chart frame to accommodate the legend. You may have to adjust the chart frame to better present the chart and the legend together. When legend markers do not appear in the legend because there are too many to fit within the legend boundaries, an arrow indicates that there are more markers.

Administration Guide 129

Chapter 14: Create and Customize a Chart After you add a legend, you can specify the location of the legend relative to the chart. You can also specify the location of the markers and legend text and set the style of the legend frame. If you are upgrading charts with legends, the legend will appear to the right of the chart and legend markers to the left of the legend text. You can change this if you want.

Steps
1. Right-click the chart, click Properties, and then click the Format tab. Check that the Chart Properties dialog box opened. If another dialog box opened instead, you did not have the chart selected. Click Cancel to close the dialog box, press Esc to clear your selection, and try again. 2. On the Format tab, click Properties, and on the Look tab, click Show Legend. 3. In the Markers and Text box, specify the location of legend markers and text by clicking one of the following: Markers to Left of Text Markers to Right of Text Text Centered on Marker Markers Above Text Markers Below Text 4. In the Layout box, specify the location of the legend. You can specify Legend on the Right Side Legend on the Left Side Legend Below Chart 5. In the Box Style box, specify whether to include a box frame and the box style for the legend. 6. Click OK twice. The chart legend appears in the chart with the characteristics you specified.

What if ...
You are upgrading charts with legends? The legend shows to the right of the chart. Legend markers show to the left of the legend text. You want to change the font type, style, and color of the text in the legend. On the Format tab, in the Font formatting box, specify Legend text and click Edit. You want to exchange the values in the legend for the values on the primary axis? In the Chart Properties dialog box, click the Data tab and select the Pivot data check box. The Pivot data check box is not valid for some types of charts.

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123) "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Format Data Items" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Show TrendLines" (p. 131)

130 IBM(R) Cognos(R) Impromptu(R)

Chapter 14: Create and Customize a Chart

Show TrendLines
Description
A trendline is a line that indicates the general direction of a series of data over time. For example, are production costs trending up? Are sales increasing year after year? Important: Trendlines do not predict the future. They merely show trends in data based on historical information. A trendline can connect all actual data points or it can be a line that is computed mathematically, such as the moving average line. In the latter instance, the line smooths the fluctuations of the actual data points in the series. The data points through which the trendline is drawn, or that it approximates, can represent individual data elements or groups of data elements such as averages or medians. You can add trendlines to the following charts: area, bar, line, and scatter. You can draw linear, logarithmic, polynomial, exponential and moving average trendlines.

Steps
1. Right-click the chart, click Properties, and then click the Format tab. Check that the Chart Properties dialog box opened. If another dialog box opened instead, you did not have the chart selected. Click Cancel to close the dialog box, press Esc to clear your selection, and try again. 2. On the Format tab, click Trendlines, and select the Show Trendlines check box. With trendlines selected, you can then make the following changes: Goal Specify the type of trendline to draw. Action In the Regression Type box, click a trendline type. For a polynomial trendline, you must specify the degree of linear regression in the Order box. The value must be greater than one but no greater than the number of groups in the chart. For Moving Average, you must specify the number of periods in the Period box. The value must be greater than 1 and less than the number of groups. In the chart, show the equation that was used Select the Show Equation check box. to calculate the trendline. In the chart, show the coefficients values used to draw the trendline. Have the trendline appear in the same color as the selected data series. 3. Click OK twice. Select the Show Coefficients Values check box. Select the Show Color same as Series check box.

Related Topics
"Change the Chart Type" (p. 123) "Format a Chart" (p. 123) "Add Chart Titles" (p. 124) "Format the Chart, Plot, and Legend Area" (p. 126) "Format Chart Titles, Axis Titles, Data Labels, and Legend Text" (p. 125) "Format a Chart" (p. 123)

Administration Guide 131

Chapter 14: Create and Customize a Chart "Change the Axis Labels and Scale Settings" (p. 126) "Change the Grids Settings" (p. 128) "Hide or Show Data Labels in a Chart" (p. 129) "Add and Format a Chart Legend" (p. 129)

Correlation Chart
A correlation chart plots data using columns or bars and a line. To identify the data item plotted by the line, see the Chart Properties, Data tab, Primary Axis box while in a chart. The last data item listed in the Primary Axis box is plotted by a line on the Y2 axis. This data item cannot be moved to the Y1 Axis. A correlation chart always has a dual axis. To view the data items plotted by the Y1 and Y2 Axis, see the Properties dialog box, Dual Y Options tab. For information about how to create a correlation chart, see (p. 132). For information about how to format a correlation chart, see (p. 132).

Example - Create a Correlation Chart to Show Order Income Relative to Order Revenue
You are a report author at The Great Outdoors Company. You are requested to create a chart that shows the correlation between order revenue and order income from 2004 to 2006. You decide to create a correlation chart because it allows you to correlate two dissimilar measures.

Steps
1. From the File menu, click New and on the FastFind tab, click Blank, and click OK. 2. In the Open Catalog dialog box, click gosales.cat and click Open. 3. If you are prompted for a userid and password, type Administrator in the UserID box and leave the Password box empty. Click Log On. 4. In the Catalog Logon for GOSALES.CAT dialog box opens, accept the default values and click OK. 5. In the Query dialog box, define the report query as follows: Click the calculation button and in the Calculation Definition dialog box, create the expression, year (Orderdate), name it Order Year, and click OK. On the Data tab, add Order Income, and Order Revenue to the Query data box. On the Group tab, click Order Year and click Group. Click Order Income and click Associate. Do the same for Order Revenue. Click OK. 6. From the Insert menu, click Chart Frame and drag the pointer to create the chart frame. 7. In the Chart Properties dialog box, in the Primary Axis box, remove the data items listed by default, and add Order Revenue followed by Order Income. Click OK. 8. Right click the chart, click Properties, and in the Chart type box, click Correlation and click OK. The last data item in the Primary Axis list appears as a line in the correlation chart. In our example, this is Order Income. 9. Save the report and name it correlation_chart.imr. You are now ready to format the chart (p. 132).

Example - Format the Correlation Chart Correlation_chart.imr


You created a correlation chart named correlation_chart.imr that shows the relationship between order revenue and order income (p. 132). You want to format this chart before you distribute it throughout your department.

Steps
1. With correlation_chart.imr open, right-click on the chart, click Properties, and click the Format tab. 2. In the Chart background box, click Chart area, and Edit. On the Fill tab, click dark gray and click OK. 132 IBM(R) Cognos(R) Impromptu(R)

Chapter 14: Create and Customize a Chart 3. In the Chart background box, click Plot area, and Edit. On the Fill tab, click light gray and click OK. 4. Click Titles, and add a Title, Footnote, Value Title (Y1) and Value Title (Y2). Name them as follows: for Title, type Order Income for Footnote, type Order Income Correlated to Order Revenue for Value Title (Y1), type Order Revenue for Value Title (Y2), type Order Income 5. To format the chart titles, in the Font formatting box, click the title, and click Edit. In the Formatting dialog box, specify the font, font size and style and alignment. 6. To add a legend, click Properties, click the Look tab, specify the following legend settings and click OK: Markers to the Right of Text Legend below Chart Beveled Frame 7. To customize the data items in the chart, click Customize per Data Item. In the Color column, click the Order Revenue color. In the Formatting dialog box, click Pattern, and specify a pattern. Experiment with different background and foreground colors until you get an acceptable combination. Click OK. Your chart should look something like this:

Tip: To make the bars in the chart narrower, increase the gap width. On the Format tab, click Properties, and on the General tab, increase the Gap Width value.

Administration Guide 133

Chapter 14: Create and Customize a Chart

134 IBM(R) Cognos(R) Impromptu(R)

Chapter 15: Impromptu Chart Changes


Formatting charts in the Impromptu Series 7 Version 4 release has changed significantly from the last release. Powerful new dialogs have been introduced that offer more functionality. So, moving to the latest version of Impromptu means that you will not lose any functionality that you had in previous versions. However, it does mean that you will do certain tasks differently in the new environment. To identify the changes related to formatting charting, see the following topics: chart types chart properties titles legends data properties grids, scales and axis labels Data formats depend on the locale configuration settings for your IBM Cognos Series 7 product. By default, IBM Cognos Series 7 server products and IBM Cognos Impromptu use a data format configuration file named cerlocale.xml. For information about managing data formats, copying data format information, or editing the data format configuration file, see the Configuration Manager User Guide.

Chart Types
See the following table to compare how you add and change the chart type in Impromptu Series 7 Version 3 and Series 7 Version 4. Goal Add a 2D bar chart Series 7 Version 3 In the Chart Properties dialog, in the Chart type list, click 2D Bar. Series 7 Version 4 In the Chart Properties dialog box, in the Chart type list, click Bar. On the Format tab, click Properties, and then on the General tab, un-check the Depth check box (no Depth). In the Chart Properties dialog box, in the Chart type list, click Bar. On the Format tab, click Properties, and then on the General tab, specify Depth. In the Chart Properties dialog box, in the Chart type list, click Pie. In the Chart Properties dialog box, in the Chart type list, click Pie. On the Layout tab, click 2D Circular Pie.

Add a 3D bar chart. Note: This 3D bar chart is not a true three-dimensional chart. It is a 2D bar chart with depth. Add a pie chart.

In the Chart Properties dialog, in the Chart type list, click 3D Bar.

In the Chart Properties dialog, in the Chart type list, click either 2D Pie or 3D Pie. In the Chart Properties dialog, in the Chart type list, click 2D Pie.

Add a 2D pie chart.

Administration Guide 135

Chapter 15: Impromptu Chart Changes Goal Add a 3D pie chart. Series 7 Version 3 In the Chart Properties dialog, in the Chart type list, click 3D Pie. Series 7 Version 4 In the Chart Properties dialog box, in the Chart type list, click Pie. On the Format tab, click Properties, and then on the General tab, specify Depth. In the Chart Properties dialog box, in the Chart type list, click Area. Click the Format tab, click Properties, and on the General tab, un-check the Depth check box (no Depth). In the Chart Properties dialog box, in the Chart type list, click Area. Click the Format tab, click Properties, and on the General tab, specify Depth. In the Chart Properties dialog box, in the Chart type list, click Line. Click the Format tab, click Properties, and on the General tab, un-check the Depth check box. In the Chart Properties dialog box, in the Chart type list, click Line. Click the Format tab, click Properties, and on the General tab, specify Depth. In the Chart Properties dialog box, in the Chart type list, click Line. Click the Format tab, click Grids and Scales, and then on the Scales tab, click Make Logarithmic. In the Chart Properties dialog box, in the Chart type list, click Line. Click the Format tab, click Properties, and on the General tab, specify Depth.

Add a 2D area chart.

In the Chart Properties dialog, in the Chart type list, click 2D Area.

Add a 3D area chart. Note: This 3D area chart is not a true three-dimensional chart. It is a 2D area chart with depth. Add a line chart.

In the Chart Properties dialog, in the Chart type list, click 3D Area.

In the Chart Properties dialog, in the Chart type list, click Line.

Add a 2D line.

In the Chart Properties dialog, in the Chart type list, click Tape.

Add a log chart.

In the Chart Properties dialog, in the Chart type list, click Log.

Add a tape chart.

In the Chart Properties dialog, in the Chart type list, click Tape.

136 IBM(R) Cognos(R) Impromptu(R)

Chapter 15: Impromptu Chart Changes

Other Chart Properties


See the following table to compare how you change certain other chart properties in Impromptu Series 7 Version 3 and Series 7 Version 4. Goal Change chart background, plot and legend color. Series 7 Version 3 On the Format tab, in the Select box, click the chart. Under the Background color option, click Customize. The color you specify applies to the chart, plot and legend areas. Show chart values as a percent. Swap the chart axes. On the Format tab, click Percent. On the Format tab, click Swap. Series 7 Version 4 On the Format tab, in the Chart background box, click the area of the chart to format: chart, plot or legend. Click Edit and use the Formatting dialog box to format the color. On the Format tab, click Properties. On the Layout tab, click Percent. On the Format tab, click Properties. On the Layout tab, select the Horizontal check box. On the Format tab, click Properties, and on the General tab, specify an Explode value. This value is applied to each piece of the pie. To customize the Explode value for a particular slice, on the Format tab, click Customize per Data Item.

For pie chart, specify a pullout slice.

On the Format tab, in the Select box, click the chart. Click Show pullout slice. Use the dropdown list to specify the data item to pull out.

Titles
See the following table to compare how you change chart titles in Impromptu Series 7 Version 3 and Series 7 Version 4. Goal Add a chart title. Series 7 Version 3 In the Chart Properties dialog box, on the Format tab, click Chart Title. Series 7 Version 4 In the Chart Properties dialog box, click the Format tab, and then click Titles. Click the Title check box and type a title.

Add a primary or x-axis title.

On the Format tab, click the In the Chart Properties primary or x-axis Title. dialog box, click the Format tab, and then click Titles. Click the Category Title check box and type a x-axis title. On the Format tab, click the In the Chart Properties secondary or y-axis Title. dialog box, click the Format tab, and then click Titles. Click the Value Title (Y1) check box and type a y-axis title.

Add a secondary or y-axis title.

Administration Guide 137

Chapter 15: Impromptu Chart Changes Goal Format a title. Series 7 Version 3 On the Format tab, in the Select box, click the chart or axis title, then click Font. Use the Chart Font dialog box to format the title. Series 7 Version 4 In the Chart Properties dialog box, on the Format tab, use the Font formatting list box to select the title, then click Edit.

Legends
See the following table to compare how you add and format a legend in Impromptu Series 7 Version 3 and Series 7 Version 4. Goal Add a legend. Series 7 Version 3 In the Chart Properties dialog box, on the Format tab, click Legend, and then click Show the legend. On the Format tab, click Legend, with Show the legend selected, specify the legend location and the location of markers and legend text. In the Chart Properties dialog box, on the Format tab, click Legend, then click Font. Use the Chart Font dialog box to format the legend text. Series 7 Version 4 In the Chart Properties dialog box, on the Format tab, click Properties. Click the Look tab, and select Show Legend. In the Chart Properties dialog box, on the Format tab, click Properties. Click the Look tab, select Show Legend, and specify the legend options. In the Chart Properties dialog box, on the Format tab, use the Font formatting list box to select the title, then click Edit.

Change legend and legend marker location.

Format legend text.

Data Properties
See the following table to compare how you change data properties in Impromptu Series 7 Version 3 and Series 7 Version 4. Goal Plot null data. Series 7 Version 3 Series 7 Version 4

In the Chart Properties On the Format tab, in the Null data box, click Plot as dialog box, on the Data tab, zero or Exclude from chart. select the Plot null data check box. Available only for line Available only for line and charts. correlation charts. On the Format tab, in the Select box, click the chart. In the Display options box, in the Show Values box, click where you want the data labels to appear. In the Chart Properties dialog box, on the Format tab, click Properties. Click the Data Labels tab, select Show Data Labels, and then specify Labels Location and Label Format.

For bar charts only, change the location of data labels.

138 IBM(R) Cognos(R) Impromptu(R)

Chapter 15: Impromptu Chart Changes Goal Per data item, customize data item color marker style marker size line style For the entire chart or series, specify line style, marker style and size. This applies to line, bubble and scatter charts. On the Format tab, click the To format marker shape and chart. In the Display options size: box, specify line style, On the Format tab, click marker style and size. Properties and use the General tab. To format the line style: On the Format tab, click Customize per Data Item and specify the line style for each data item. Show data items with color. On the Format tab, click the chart. In the Display options box, in the Data item colors box, click Show as colors. Data items automatically appear in different colors. After you specify color to show, to customize the color of each data item, click Customize per Data Item. Show data items with pattern. On the Format tab, click the chart. In the Display options box, in the Data item colors box, click Show as patterns. On the Format tab, click Customize per Data Item and in the Color column, click the color for a data item. In the Formatting After you specify pattern, to dialog box, in the Fill customize the pattern for Options, click Pattern. In each data item, click the Choose a Pattern dialog Customize per Data Item. box, specify the fill pattern, foreground and background color. On the Format tab, click Customize per Data Item and the color of a data item. In the Formatting dialog, specify a color from the color palette. Series 7 Version 3 On the Format tab, in the Select box, click the chart. Click Customize per Data Item. Series 7 Version 4 In the Chart Properties dialog box, on the Format tab, click Customize per Data Item.

Grids, Scales and Axis Labels


See the following table to compare how you add and format grids and scales in Impromptu Series 7 Version 3 and Series 7 Version 4. Goal Add gridlines. Series 7 Version 3 On the Format tab, in the Select box, click the chart. Select the Primary gridline check box to gridlines to the x-axis. Select the Secondary gridline check box to add gridlines to the y-axis. Series 7 Version 4 On the Format tab, click Grids and Scales. Click the axis tab, and then click the Grids tab. You can specify gridlines, grid style and grid spacing for major and minor gridlines.

Administration Guide 139

Chapter 15: Impromptu Chart Changes Goal Add and format x-axis labels. Series 7 Version 3 On the Format tab, in the Select box, click the Labels button for the x-axis. Select Show the labels check box to add the axis labels. Click Font to format the labels. Series 7 Version 4 To add labels: On the Format tab, click Grids and Scales. Click the Category Axis, and use the Labels tab and General tab to add labels and specify how they display. To format labels: On the Format tab, in the Font formatting list, click the axis you want to format, for example, Category axis, and then click Edit. Wrap x-axis labels. On the Format tab, in the Select box, click the Labels button for the x-axis. Select Show the labels check box to add the axis labels. Click Word wrap to wrap labels. Word wrap text: You cannot specify word wrap explicitly. Text is wrapped automatically. For information on formatting x-axis labels, see "Add and format x-axis labels". Truncate text: You cannot specify that text be truncated explicitly. It is truncated automatically. For information on formatting x-axis labels, see "Add and format x-axis labels". To add labels:

Truncated x-axis labels.

On the Format tab, in the Select box, click the Labels button for the x-axis. Select Show the labels check box to add the axis labels. Click Truncate to truncate labels.

Add and format y-axis labels.

On the Format tab, in the Select box, click the Labels button for the y-axis. Select the Show labels check box to add the axis labels.

On the Format tab, click Grids and Scales. Click the a y-axis tab, and use the Labels tab and General tab to add labels and specify Select Customize the scale and then edit the Minimum, how they display. Maximum and Number of steps boxes to customize the labels.

140 IBM(R) Cognos(R) Impromptu(R)

Chapter 16: Impromptu Chart Controls


Impromptu provides several dialog boxes that you can use to format charts. These include the Properties, Titles, Trendlines, Grids and Scales, Customize per Data Item, and Formatting dialog boxes. To assist you with chart formatting, you can find a list of controls for the following dialog boxes, together with a description of each control and the chart types that use them. The dialog boxes are listed alphabetically. Formatting dialog box Grids and Scales dialog box Properties dialog box Titles dialog box Trendlines dialog box For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135).

Formatting Dialog Box Controls


Here is a list of the controls in the Formatting dialog box. Not all the controls apply to every chart type or chart configuration. If a control does not apply, either the control does not appear in the dialog box, or it appears but is unavailable. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135).

Font tab
Specifies font characteristics for certain chart objects, such as chart titles, axes titles, data labels, and legend text. Here are an alphabetical list of the controls you find on the Font tab. Name Alignment list box Color palette Font list box Rotation list box Size list box Style buttons Transparent button Description Specifies the text alignment. You can align text left, right, or have it centered. Specifies font color. Specifies the font type. Rotates text. Rotating text can help avoid overlapping text, for example, in axis labels. Specifies the font size. Specifies the font style: italic, bold, and underline. Makes text transparent.

Administration Guide 141

Chapter 16: Impromptu Chart Controls

Line tab
Specifies line characteristics, such as line color, style, and thickness. Name Color palette Style list box Thickness list box Transparent button Description Specifies font color. Specifies the line style. Specifies the line width. Makes text transparent.

Fill tab
Specifies fill characteristics, such as fill color, fill pattern, and fill pattern color. Name Color palette Pattern button Transparent button Description Specifies font color. Opens the Choose a Pattern dialog box that lets you specify fill pattern, pattern background and foreground color. Makes text transparent.

Grids and Scales Dialog Box Controls


Use the Grids and Scales dialog box controls to add axis labels, scales and grids to your charts. The tabs on the left-side of the dialog box show the available axes in the chart: Y1 Axis, Y2 Axis (for dual-axes charts), Category Axis, X Axis (for bubble and scatter charts) and Series Axis (for three-dimensional charts). When you select an axis tab, the tabs for formatting appear at the top of the dialog box. Not all of the controls apply to every chart type or chart configuration. If a control does not apply, either the control does not appear in the dialog box, or it appears but is unavailable. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135)

General tab
Here is an alphabetical list of controls in the General tab. Name Draw Categories in Reverse Order check box Draw Series in Reverse Order check box Description Reverses the categories plotted on the chart Category Axis. The Category Axis labels appear from left-to-right at the bottom of the chart. Axis Chart Type

Category Axis, area, bar, X Axis correlation, gantt, HLCO, HLO, line, radar area, bar, line

Reverses the data plotted on the Series Axis. Series Axis The Series Axis is only valid for three-dimensional charts.

142 IBM(R) Cognos(R) Impromptu(R)

Chapter 16: Impromptu Chart Controls Name Labels on Both Sides radio button Description Specifies the location for the Category or X Axis baseline and labels. Axis Chart Type

Y1 Axis: Y1 Axis Category Axis area, bar, bubble, correlation, X Axis The default category axis baseline and labels HLCO, HLO, appear at the bottom of the chart. line, radar, scatter Category Axis: gantt

Specifies the location for the Category or X Category Axis, area, bar, bubble, Labels on X Axis correlation, Bottom radio Axis baseline and labels. HLCO, HLO, button The default category axis baseline and labels line, radar, scatter appear at the bottom of the chart. Labels on Left radio button For the Y1 Axis, specifies that labels appear Y1 Axis, Y1 Axis: on the left side of the axis. Category Axis area, bar, bubble, correlation, HLCO, HLO, line, radar, scatter Category Axis: gantt Labels on Right radio button For the Y1 Axis, specifies that labels appear Y1 Axis, Y1 Axis: on the right side of the axis. Category Axis area, bar, bubble, correlation, HLCO, HLO, line, radar, scatter Category Axis: gantt Labels on Top radio button Specifies the location for the Category or X Axis baseline and labels. The default Category Axis baseline and labels appear at the bottom of the chart. Category Axis, area, bar, bubble, X Axis correlation, HLCO, HLO, line, radar, scatter Y1 Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar, scatter X Axis: scatter Shows or hides the category or Y axis base Show the Axis Line on lines. This option is always enabled. the Chart Value Axis Crosses Between Categories Category Axis correlation

Make this a Descending Axis check box

Draws the numeric axis in descending order Y1 Axis for the X Axis value labels and columns. X Axis

When selected, offsets the area from the plot Category Axis, area, line edges so that there are gaps between the Y X Axis Axis and the start of the plot area values. When cleared, the categories are aligned flush to the plot area edge.

Administration Guide 143

Chapter 16: Impromptu Chart Controls

Scales tab
Here is an alphabetical list of controls in the Scales tab. Name Make Logarithmic check box Description Specifies a logarithmic scale. To set the logarithmic scale, you must choose manual scaling and set the minimum and maximum value to a value greater than zero. Axis Y1 Axis X Axis Z Axis Chart Type Y1 Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar X Axis: bubble Z Axis: bubble Specifies whether to include a zero on the Always Include Zero numeric axis. check box This option is disabled when the Set Minimum Value option is selected. Y1 Axis X Axis Z Axis Y1 Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar X Axis: bubble Z Axis: bubble Set Maximum Value check box Applies manual scaling on the axis. This allows you to specify a range of values that is different from the range specified in the data. The value you enter sets the maximum value that appears on the numeric axis. The value label and chart columns are adjusted to align with this value. Y1 Axis X Axis Z Axis Y1 Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar X Axis: bubble Z Axis: bubble Y1 Axis X Axis Z Axis Y1 Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar X Axis: bubble Z Axis: bubble

Set Minimum Applies manual scaling on the axis. This Value check allows you to specify a range of values that is different from the range specified in the box data. The value you enter sets the minimum value that appears on the axis. The value label and chart columns are adjusted to align with this value.

144 IBM(R) Cognos(R) Impromptu(R)

Chapter 16: Impromptu Chart Controls

Labels tab
Here is an alphabetical list of controls in the Labels tab. Name Automatic radio button Description Draws all labels on the axis. This option is available for the Category and Series axes. Axis Chart Type

Category Axis Category Axis: Series Axis area, bar, bubble, correlation, HLCO, HLO, line, radar Series Axis: area, bar, line

Hide labels for: Maximum Value check box

Shows or hides the maximum value on an axis.

Y1 Axis Y2 Axis X Axis

Y1 Axis: area, bar, bubble, correlation, HLCO, HLO, line, radar, scatter Y2 Axis: area, bar, correlation, line X Axis: bubble, scatter

Hide labels for: Minimum Value check box

Show s or hides the minimum value on an axis.

Y1 Axis Y2 Axis

Y1 Axis: area, bar, bubble, correlation, HLCO, HLO, line, radar, scatter Y2 Axis: area, bar, correlation, line, X Axis: bubble, scatter

Number of categories between labels radio button

Controls the number of labels that appear on the axis by specifying the number of labels that can be dropped between categories. By default, all labels appear. To restrict the number of labels, you must select the Show Labels with this Axis check box.

Category Axis area, bar, bubble, correlation, HLCO, HLO, line, radar

Administration Guide 145

Chapter 16: Impromptu Chart Controls Name Show Labels for this Axis check box Description Shows or hides numeric and Category Axis labels. Axis Chart Type Y1 Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar, scatter Y2 Axis: area, bar, correlation, line Category Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar X Axis: bubble, scatter Series Axis: area, bar, line

Y1 Axis Y2 Axis Category Axis On the numeric axis, labels identify the X Axis range of data values that are charted. On the Series Axis category axis, the labels show how data in the chart is grouped or categorized. When the check box is selected for the category axis, the axis labels appear immediately below the chart frame. For numeric axis labels, when the columns appear vertically from top-to-bottom or bottom-to-top, the labels on the Y1 Axis appear on the left side of the chart. For the Y2 Axis, the labels appear on the right side of a vertical chart and on the top for a horizontal chart. For 3D charts, the category labels appear on the lower right side of the chart.

Stagger Labels radio button

Category Axis Category Axis: X Axis area, bar, Staggering labels is useful when long labels correlation, are required for each data group but you do HLCO, HLO, not want the labels to wrap. line, radar By default, labels on the Category Axis X Axis: appear on a single line. If labels are too long bubble to fit on a single line, labels are wrapped at word breaks and appear on multiple lines. Staggers Category Axis labels. This option is not available for 3D charts.

Use Manual Number of Series radio button

Allows you to manually specify the number Series Axis of data series plotted in the chart.

area, bar, line

Grids tab
Here is an alphabetical list of controls in the Grids tab. Name Description Axis Chart Type Y1 Axis: area, bar, correlation, HLCO, HLO, line, scatter Y2 Axis: area, bar, correlation, line X Axis: scatter

Draws a custom grid line on the Y1 Axis or Y1 Axis Draw Y2 Axis Custom Line Y2 Axis in your chart. The location of the at check box grid line is specified by the value you enter X Axis in the Draw Custom Line at edit box.

146 IBM(R) Cognos(R) Impromptu(R)

Chapter 16: Impromptu Chart Controls Name Description Axis Chart Type

Y1 Axis: Grid Style list Specifies the style of grid line for major and Y1 Axis area, bar, bubble, Y2 Axis minor grid lines. You can specify the Category Axis correlation, gantt, following styles: HLCO, HLO, Regular Grids line, radar, scatter Grids and Ticks Y2 Axis: Inner Ticks area, bar, Outer Ticks correlation, line Spanning Ticks To format the width and color of a grid line, use the Formatting option on the Chart Properties, Format tab. Category Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line Y1 Axis Y2 Axis Y1 Axis: correlation, gantt, radar Y2 Axis: correlation Category Axis area, bar, bubble, correlation, gantt, HLCO, HLO, line

Gridlines per Controls the number of minor grid lines in interval box, the chart. Minor Gridlines tab

Set manual number of categories between gridlines radio button Minor Gridlines tab Show Gridlines check box

For minor grid lines on the Category Axis, specifies the number of categories between the grid lines.

Y1 Axis Y2 Axis To specify a grid line style, see the Grid Style Category Axis option. Series Axis Shows or hides major grid lines in a chart.

Y1 Axis: area, bar, gantt, correlation, HLCO, HLO, line, radar, scatter Y2 Axis: area, bar, correlation, line Category Axis: area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar Series Axis: area, bar, line

Administration Guide 147

Chapter 16: Impromptu Chart Controls Name Use manual grid interval value check box Description For major grid lines, lets you set the grid interval value manually. Axis Y1 Axis Y2 Axis X Axis Chart Type Y1 Axis: area, bar, correlation, gantt, HLCO, HLO, line, radar, scatter Y2 Axis: area, bar, correlation, gantt, line X Axis: scatter

Properties Dialog Box Controls


Use the Properties dialog box controls to format chart characteristics that apply to the chart globally, such as the layout type, data labels, and legend. Here is a list of the controls in the dialog box, grouped by tab. Not all of the controls apply to every chart type or chart configuration. If a control does not apply, either the control does not appear in the dialog box, or it appears but is unavailable.

General tab
This tab specifies the general properties of a chart, which vary depending on the chart type. For example, you can specify tilt, depth, rotation and explode values for a pie chart. For the columns in a bar chart, you can specify shape, overlap, gap width between columns, and depth. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135) Here is an alphabetical list of the controls in the General tab. Name Bubble size slider Connect Data Points with Lines check box Depth check box Description Specifies the size of the markers in a bubble chart. Shows or hides a connecting line between each marker in a series. Chart Type bubble scatter

Controls whether depth is added to a chart. When area, bar, correlation, gantt, cleared, the chart is flat. By default, all charts line appear with depth added to the chart frame and columns. This option is not available for bar charts with the True 3D layout.

Depth slider

Specifies the amount of depth to be applied to the chart. For a pie chart it controls the thickness of the pie. For the remaining charts, it controls the depth of the bars risers and frame. This option is not available for bar charts with the True 3D layout.

area, bar, bubble, correlation, gantt, line, pie

Direction slider

Specifies the direction in which the depth is applied. This option is not available for bar charts with the True 3D layout.

area, bar, correlation, line

148 IBM(R) Cognos(R) Impromptu(R)

Chapter 16: Impromptu Chart Controls Name Display Series Lines check box Explode slider Description Draws a line connecting the series data. Detaches all slices from the pie. Exploding a pie or donut chart detaches all slices away from the center. Gap Width slider Changes the gap between the group of bars or columns in each category. bar, correlation, gantt, HLCO, HLO, 3D area, 3D line ring pie pie Chart Type stacked bar, percent bar pie

Hole Size slider Keep aspect ratio constant check box

Controls the size of the hole in a ring pie chart. Controls whether a pie chart has to be perfectly circular when drawn. There are cases when a pie chart, with depth and a high Tilt value, looks better with a non 1:1 width: height aspect ratio. Changes the degree that bars or columns, within each category, overlap each other. This option is only available for a clustered chart. This option is not available for bar charts that have the True 3D layout.

Overlap slider

bar, correlation

Restore All button

Restores all slices of the pie to their original settings when slices have been detached or removed from a pie chart. Changes the shape of the bars or columns. This field is not available if the Use Depth check box is selected.

pie

Riser Shape list box

bar, correlation, gantt,

Rotation slider Shape list box

Rotates the pie chart. Changes the shape of markers. For line and scatter charts, this option is only available if Show Markers is selected.

pie bubble, line, scatter

Show line(s) check box Shows or hides the lines in a chart.

line

line, scatter Show Marker(s) check Shows or hides the markers in a chart. box For line charts, if this control is enabled, a marker is drawn on each line at locations representing the data values. For a bubble chart, if the user hides markers and does not select Connect Data Points with Lines, the scatter chart does not contain any columns representing the data values. Size slider Changes the size of markers. For bubble charts, if zero is used, the markers disappear from the chart. For scatter charts, this option is only available if Show Markers is selected. bubble, line, scatter

Administration Guide 149

Chapter 16: Impromptu Chart Controls Name Tilt box Description Tilts the pie chart. Lesser values make the pie chart flatter facing the viewer, whereas, the maximum value tilts the pie chart such that only the pie edge is shown. Chart Type pie

Layout tab
Changes the default layout. Depending on the chart, you can make the layout type absolute, percent, stacked, clustered, or three-dimensional. You can also specify whether data items appear on the vertical or horizontal axis. For certain charts, you can also specify dual axes. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135) Here is an alphabetical list of the controls in the Layout tab. Name 2D Circular Pie check box Absolute radio button Angle box slider Area radio button Circular Data Lines check box Circular Gridlines radio button Description Adds depth to a pie chart. The tilt value is set to zero. Specifies that absolute data values are used. Rotates the chart, showing it at different angles. Shows the area enclosed by the data points. Draws the perimeter of a radar chart which is circular. Chart Type pie area, bar, line radar radar radar

Shows circular or value grid lines on a radar chart. radar You can toggle between circular or spider grid lines. With circular grid lines, you can also specify circular data lines. bar area, bar, bubble, line

Clustered radio button Creates a side-by-side group of columns. This is the standard type of column or bar chart. Dual Axes check box Creates a chart with two numeric axes (Y1 and Y2). To change the data series that are assigned to each axis, use the settings in the Dual Y Options tab. This option is only available for clustered and stacked area charts. It is not available for percent and 3D charts. Horizontal radio button Line radio button Percent radio button Plots data columns on the numeric or y-axis. Connects the data points in the chart using lines. Creates a column version of a pie chart. Each group calculates the percent of the total required for each series. The axis goes from zero to 100%. Shows data as a percentage of a total.

area, bar, correlation, line radar area, bar, line

Pie radio button Ring Pie radio button

pie

Creates a ring variant of the pie chart. The total of pie all slices is placed in the center.

150 IBM(R) Cognos(R) Impromptu(R)

Chapter 16: Impromptu Chart Controls Name True 3D radio button Show Close Show Open Spider Gridlines radio button Split check box Description Creates a standard three-dimensional chart that displays a riser for each value in the data set. Chart Type area, bar, line

Hides or shows the closing value in a HLCO chart. HLCO Hides or shows the opening value in a HLCO chart. HLO

Draws the circular or value grid lines such that the radar radar chart resembles a spider web. Assigns half of the series in the chart to the primary numeric axis (Y1) and the other half to the secondary numeric axis (Y2). It physically splits the chart and shows two separate numeric axes. All columns or bars are drawn from a single category axis base line. The series assigned to the Y1 and Y2 axes are drawn on opposite sides of the chart. If the Dual Axes check box is not selected, this check box is unavailable. area, bar, line

Stacked check box

Arranges the polygons formed by the data points such that the polygons are stacked one on top of the other. Shows stacked groups of columns or bars. Each stack is comprised of all the series in the group, added up to get a total. The axis is the total value of the cumulative points. Specifies the layout style in high-low-close-open and high-low-close charts. Data values can be represented using rectangular columns or vertical lines.

radar

Stacked radio button

area, bar, line

Style list

HLCO, HLO

Vertical radio button

Plots data columns on the category or X-Axis.

area, bar, correlation, line

Data Labels tab


Specifies whether to show data labels. If you choose to have data labels appear, you can specify the label location and format. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135) Here is an alphabetical list of the controls in the Data Labels tab. Name Absolute Values radio button As Percentage check box Cumulative Values radio button Description Chart Type

Shows absolute data values. Available when you area, bar, line select the stacked and percentage chart layout type. Shows the data values in the chart as a percentage of the total. pie

Shows cumulative data values. Available when you area, bar, line select the stacked and percentage chart layout type.

Administration Guide 151

Chapter 16: Impromptu Chart Controls Name Label Format list box Description Selects the label format.The user can choose from the following options: Value, Label, or Label & Value. This option is enabled when the Show Data Labels check box is selected. If Value is selected, the data values appear at the corresponding location on each column. If Label is selected, the series labels appear. If Label & Value is selected, the series labels and data values appear. For bubble charts, you can choose an X and Y Value or Label. This selection is not available for scatter charts or charts with the True 3D layout. Labels Location list box area, bar, bubble, correlation, gantt, line, HLCO, This option is enabled when the Show Data Labels HLO, scatter check box is selected. Selects where the data labels appear next to the associated column or bar in the chart. This option is not available when the True 3D chart layout is selected. The data labels location can be one of the following: Outside Maximum, Inside Maximum, Center, or Base of Chart. For scatter charts, one of the following label locations can be selected: Above Marker, Below Marker, or Centered on Marker. Labels on Sides check box Shows the series labels on the sides of the chart. pie Chart Type area, bar, bubble, correlation, line, HLCO, HLO

On Slices radio button Shows the data values on each pie slice. Available if pie Show Values is selected. Do not select this check box to show the absolute values for each slice. On Slices radio button Shows the series labels on each pie slice. Available if Show Labels is selected. Outside Slices radio button (data values) Outside Slices radio button (series labels) Show as Percentage check box Show Data Labels check box Shows the data values outside each pie slice. Available if Show Value is selected. Shows the series labels outside each pie slice. Available if Show Labels is selected. Shows the data values in the chart as a percentage of the total. pie pie pie area, bar

Show or hides data labels for all series in the chart. area, bar, bubble, correlation, gantt, HLCO, HLO, line, radar, scatter

Show Labels check box Shows or hides the series label associated with each pie pie slice.

152 IBM(R) Cognos(R) Impromptu(R)

Chapter 16: Impromptu Chart Controls Name Show Leader Lines check box Description Shows or hides the leader lines from each pie slice next to the data value or series label. Available if the Outside Slices option is selected for values or labels. For data values, shows totals when you select the stacked layout type. Shows or hides data label values for each slice in the pie chart. Chart Type pie

Show Total radio button Show Values check box

area, bar pie

Dual Y Options tab


For charts that have dual y-axes, specifies which data series uses the Y1 axis and which data series uses the Y2 axis. This tab is not available for pie, gantt, radar, HLCO, and HLO charts. To add a dual axis to a chart, use the Layout tab. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135) Here is an alphabetical list of the controls in the Dual Y Options tab. Name Y1 Axis list box Description Assigns a data series to the Y1 axis. When the Dual Y Options tab is enabled, the data series is divided by two. Half of the series is assigned to the Y1 Axis, and the other half is assigned to the Y2 Axis. The Dual Y Options tab is available only if the Dual Axes check box is selected in the Layout tab. Y2 Axis list box Assigns a data series to the Y2 Axis. When the Dual Y Options tab is enabled, the data series is divided by two. Half of the series is assigned to the Y1 Axis, and the other half is assigned to the Y2 Axis. The Dual Y Options tab is available only if the Dual Axes check box is selected in the Layout tab. Show Axis Split check box Show or hides the dual axes split line. Only available when the Dual Axes and Split Dual Axes check boxes are selected in the Layout tab. Selects the location where the chart is split into two halves. Only available when the Dual Axes and Split Dual Axes check boxes are selected in the Layout tab. area, bar, line area, bar, line area, bar, bubble, line Chart Type area, bar, bubble, line

Split Position slider

Look tab
Specifies a legend and legend properties for your chart. For example, you can specify where the legend is placed in chart. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135)

Administration Guide 153

Chapter 16: Impromptu Chart Controls Here is an alphabetical list of the controls in the Look tab. Name Box Style list box Description Draws a text box around the entire legend area. The available options are: No Frame Single Line Frame Double Line Frame Beveled Frame Reverse Beveled Frame Layout list box Defines where the legend area markers and text appear in the chart. The available options are: Legend on Right Side Legend on Left Side Legend Below Chart Markers and Text list box Chart Type area, bar, bubble, correlation, gantt, HLCO, HLO, line, pie, radar, scatter

area, bar, bubble, correlation, gantt, HLCO, HLO, line, pie, radar, scatter

Defines the content and format of the legend area. area, bar, bubble, correlation, gantt, Available only if Show Legend it selected. HLCO, HLO, The following options are available: line, pie, radar, Markers to Left of Text scatter Markers to Right of Text Text Centered on Markers Markers Above Text Markers Below Text area, bar, bubble, correlation, gantt, If this check box is not selected, all other selections HLCO, HLO, related to the Legend are unavailable. line, pie, radar, scatter Shows or hides the chart legend.

Show Legend check box

Display Status tab


Use this tab to specify certain display options for pie and radar charts and charts with a three-dimensional layout. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135) Here is an alphabetical list of the controls in the Display Status tab. Name Floor check box Left Wall check box Pie Name check box Description Shows or hides the floor in a three-dimensional chart. Chart Type 3D area, 3D bar, 3D line

Shows or hides the left wall in a three-dimensional 3D area, 3D bar, chart. 3D line Shows or hides the pie name, which is the category pie label. The category label appears below the pie chart. Shows or hides the total value in the center of each pie pie. Available only for ring pie charts. Shows or hides the labels for the right wall in a three-dimensional chart. 3D area, 3D bar, 3D line

Pie Total check box Right Wall check box

154 IBM(R) Cognos(R) Impromptu(R)

Chapter 16: Impromptu Chart Controls Name Description Chart Type radar

Show Y-Axis Values on Hides or shows the Y Axis values on the left-side the left check box of a radar chart.

Titles Dialog Box Controls


Here is a list of the controls, in alphabetical order, that you find in the Titles dialog box. Not all the controls apply to every chart type or chart configuration. If a control does not apply, either the control does not appear in the dialog box, or it appears but is unavailable. For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135). Name Category Title check box and edit box Footnote check box and edit box Description Defines a title for the Category Axis. Chart area, bar, gantt, HLCO, HLO, line, radar, area, bar, bubble, gantt, HLCO, HLO, line, pie, radar, scatter area, bar, bubble, gantt, HLCO, HLO, line, pie, radar, scatter area, bar, bubble, gantt, HLCO, HLO, line, pie, radar, scatter area, bar, bubble, gantt, HLCO, HLO, line, pie, radar, scatter

Defines a footnote. By default, the footnote is placed at the bottom right corner of the chart.

Subtitle check box and Defines a subtitle that allows you to provide edit box additional information about the chart. By default, the subtitle is placed at the top center of the chart directly below the chart title. Title check box and edit box Defines the main chart title. By default, the chart title is placed at the top of the chart.

Value Title (Y1) check box and edit box

Adds a title to the Y1 Axis.

Value Title (Y2) check box and edit box Series Axis check box and edit box

area, bar, bubble, Adds a title to the Y2 Axis. This title is available for dual-axes charts, where the chart has both a Y1 line, scatter Axis and a Y2 Axis. Adds a series axis title to describe the information charted on the Series Axis. This title is only available for three-dimensional charts where the axis labels that are normally displayed in the legend area are plotted along a secondary group axis. In the default configuration, the series labels appear on the lower left side of the three-dimensional cube. area, bar, line

X-Axis check box and edit box

Adds a title to the X Axis of the chart. Only bubble bubble, scatter and scatter charts include an X Axis.

Trendlines Dialog Box Controls


Here is a list of the controls, in alphabetical order, that you find in the Trendlines dialog box. Not all of the controls apply to every chart type or chart configuration. If a control does not apply, either the control does not appear in the dialog box, or it appears but is unavailable. Administration Guide 155

Chapter 16: Impromptu Chart Controls For information about chart-related tasks, see (p. 119). For information about how tasks are done differently in this version of Impromptu compared to earlier releases, see (p. 135). Name Order edit box Description Specifies the degree of linear regression for the polynomial trendline. Available only for a polynomial trendline. The Order number must be greater than one but no greater than the number of groups in the chart. Period edit box Specifies the period over which the moving average area, bar, line, line should be drawn. Available only for a Moving scatter Average trendline. Defines the type of trendline you want to appear. Available only if Show Trendlines is selected. You can choose the following regression types: linear, logarithmic, polynomial, exponential, moving average. Show Coefficient Values check box Shows or hides the coefficient values that are used area, bar, line, scatter for the trendline. Available for linear, logarithmic, polynomial, power, or exponential trendlines. Show Color Same as Series check box Show Equation check box Draws the trendline with the same color as the selected series. This option is selected by default. Shows or hides the equation that was used for the trendline. Available for linear, logarithmic, polynomial, power, or exponential trendlines. Show Trendlines list box Shows or hides a trendline for the selected series. area, bar, line, scatter area, bar, line, scatter area, bar, line, scatter area, bar, line, scatter Chart Type area, bar, line, scatter

Regression Type list box

156 IBM(R) Cognos(R) Impromptu(R)

Chapter 17: Product Sample Listing

Catalogs
The sample catalogs support all the sample reports and sample applications available for Impromptu and PowerPrompts.

Description
GoSales.cat
This catalog supports the sample reports that demonstrate new functionality incorporated within Impromptu. It is based on the database for The Great Outdoors, a fictitious camping equipment company.

IMP_Audit.cat
This catalog supports the Auditing_Report.imr sample report. The catalog is based on a fictitious audit database. It is created from the IMP_Audit.mdb database.

Location
File Name GoSales.cat IMP_Audit.cat Default Location \installation_location\Samples\Impromptu\reports \installation_location\Samples\Impromptu\audit\reports

Main Reports
The main sample reports are examples of the different ways you can use Impromptu.

Description
actual_sales_against_target_sales_(prompt).imr
This report demonstrates prompts, sorting, grouping, and filters. It also demonstrates the use of a sub-report within a main query. The report displays detailed yearly sales figures for each sales representative for the past three years. When you open the report, you are prompted to select the country you want the sales figures for.

Annual_Product_Sales.imr
This report assesses the annual performance of a Great Outdoors product. The report contains order details, retailer information, and a chart frame showing a three-year sales history. A logarithmic trend line shows the trend in total sales.

Administration Guide 157

Chapter 17: Product Sample Listing

company_letter_and_labels.imr
This report demonstrates the use of a sub-report within a main query. This report is a letter to level 3 representatives about the product sales targets for the year and an upcoming sales conference. The report includes a sub-report of address labels.

currency.imr
This report is in the PowerPrompts report set. See "PowerPrompts Applications" (p. 162).

customer_satisfaction.imr
The report demonstrates the use of conditional formats. This report lists the total number of returned items per product. The quality of each product is rated on a scale of 1 to 5, determined by the number of orders returned.

income_from_customers.imr
This report demonstrates drill through links to the secondary report Income_from_Customers_Drillthrough.imr. The report shows a list of retailers ranked by income. You can drill through on retailer name to see a detailed report listing income by individual product sales.

Order_Income_Correlation_Chart.imr
This report demonstrates the correlation chart and certain chart formatting features, such as the use of pattern and color in bar columns, a chart legend and chart background customization, and a chart footnote. The chart shows the correlation between order revenue and order income for a period of three years.

product_details_(prompt).imr
This report demonstrates prompts and drill through links. When you open the report, you are prompted to select the product type you want to include in your report. The report shows pictures, product names and descriptions of all the products within a product type. You can drill through on Product Name to see a report of projected sales versus return quantity.

Product_Margin_Export_to_Excel.imr
This report incorporates the proven practises of designing a report for export to Excel. This report displays the average production cost and margin for all products that are included in the golf and mountaineering equipment product lines using a list report and two pie charts with pull-out slices.

Product_Orders_Drill_Through.imr
This report demonstrates drill through. The report shows total sales for each Great Outdoors product by country. You can drill through on the Sales Staff Name, Productname and Ordernumber columns to see reports with greater detail.

Products.imr
Use this report with Drill-Through Report.mac, a macro that demonstrates the use of the OpenDrillDownReport method. The report lists all products.

Products_(Publish_as_HTML).imr
This report demonstrates simple aspects of Publish as HTML. The report lists all Great Outdoor products. You can view the report in both Impromptu and a Web browser.

158 IBM(R) Cognos(R) Impromptu(R)

Chapter 17: Product Sample Listing

pwp_tutorial_js.imr
This report is in the PowerPrompts report set. See "PowerPrompts Applications" (p. 162).

Revenue_and_Expense_Chart.imr
This report demonstrates a multi-line chart. The report displays total revenue and total expenses for all products in each product line. Various chart properties were used to demonstrate the modifications you can make to a chart to improve its readability. You can view the report in both Impromptu and a Web browser.

Revenue_Expense_and_Income_Chart.imr
This report demonstrates a multi-line chart. The report displays total revenue, total expenses, and total order income for all products in each product line. The data is filtered on the year 2005 only. Various chart properties were used to demonstrate the modifications you can make to a chart to improve its readability. You can view the report in both Impromptu and a Web browser.

Sales_by_Country_(Publish_as_HTML).imr
This report demonstrates intermediate aspects of Publish as HTML. The report lists total sales, sales margin, quantity, and order price for each product by country. You can view the report in both Impromptu and a Web browser.

sales_comparison_by_product_(prompt).imr
This report demonstrates the use of prompts, crosstab reports, and filters. When you open the report, you are prompted to select the product line you want to include. The report compares the sales figures for each product in that product line for the last three years.

SalesRep_Sales_Totals_(Publish_as_HTML).imr
This report demonstrates advanced aspects of Publish as HTML. The report shows detailed sales figures for several sales representative, such as the largest and smallest transaction, and sales totals for each retailer. You can view the report in both Impromptu and a Web browser.

sales_staff_report.imr
This report demonstrates grouped lists. Members of the sales staff are grouped by position and sorted by last name. Country, first name, phone number, and extension are other data items included in the report.

sales_volume_by_country_(prompt).imr
This report demonstrates prompts, sorting and grouping by data items. The report uses graphic frames, bar graphs, and list reports sorted by product type. When you open the report, you are prompted to select the country you want to include. The report shows customer sales information for each country you select.

simple_crosstab_report.imr
This report demonstrates a simple crosstab report. The report shows the yearly revenue totals for each product line.

singlepage.imr
This report is in the PowerPrompts report set. See "PowerPrompts Applications" (p. 162).

Administration Guide 159

Chapter 17: Product Sample Listing

UDF Integration.imr
This report is a copy of Products (Publish as HTML). Use the report with the HTML User Defined Function (UDF) sample. This report will fail unless the necessary steps documented in the html readme.txt file are followed. This file is located in \installation_location\bin\udf\Save As HTML folder.

Location
File Name actual_sales_against_target_sales_(prompt) .imr Annual_Product_Sales.imr company_letter_and_labels.imr customer_satisfaction.imr income_from_customers.imr Order_Income_Correlation_Chart.imr product_details_(prompt).imr Product_Margin_Export_to-Excel.imr Product_Orders_Drill_Through.imr Products.imr Products_(Publish_as_HTML).imr Revenue_and_Expense_Chart.imr Revenue_Expense_and_Income_Chart.imr Sales_by_Country_(Publish_as_HTML).imr sales_comparison_by_product_(prompt).imr Default Location \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ report \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports

SalesRep_Sales_Totals_(Publish_as_HTML).im \installation_location\Samples\Impromptu\ r reports sales_staff_report.imr \installation_location\Samples\Impromptu\ reports

160 IBM(R) Cognos(R) Impromptu(R)

Chapter 17: Product Sample Listing File Name sales_volume_by_country_(prompt).imr simple_crosstab_report.imr UDF Integration.imr Default Location \installation_location\Samples\Impromptu\ reports \installation_location\Samples\Impromptu\ reports \installation_location\Bin\UDF\Save As HTML

Secondary Reports
These reports are used by the main reports to demonstrate Impromptu features such as drill through. Some are also used by macros.

Description
income_from_customers_drillthough.imr
Use this report with Income_from_Customers.imr, a report that demonstrates the use of drill through links. The report lists product sales by customer.

Product_Details_Drillthrough.imr
Product_Details_(prompt).imr uses this report to demonstrate drill through links. The report shows detailed projected versus return quantity information for the product you link from.

Product_Orders_Drill_Through1.imr
This is a drill-through report for Product Orders Drill-Through.imr. When you drill through on Productname, you see a detailed report about the orders for that product.

Product_Orders_Drill_Through2.imr
This is a drill-through report for Product Orders Drill-Through.imr. When you drill through on Sales Staff Name, you can see a report with detailed information about orders for that sales person.

Product_Orders_Drill_Through3.imr
This is a drill-through report for Product Orders Drill-Through.imr. When you drill through on Ordernumber, you see a report with details for that order.

Product_Orders_Drill_Through4.imr
This is a drill-through report for Product Orders Drill-Through.imr. When you drill through on Sales Staff Name or Productname, you can see a report with detailed order information.

Location
All secondary reports are in \installation_location\Samples\Impromptu\Reports.

Discovering Impromptu Reports


These are the sample reports used in the tutorials in Discovering Impromptu. "actual_sales_against_target_sales_(prompt).imr" (p. 157) "income_from_customers.imr" (p. 158) Administration Guide 161

Chapter 17: Product Sample Listing "income_from_customers_drillthough.imr" (p. 161) "Product_Details_Drillthrough.imr" (p. 161) "sales_staff_report.imr" (p. 159) "sales_volume_by_country_(prompt).imr" (p. 159) "simple_crosstab_report.imr" (p. 159)

Location
All Discovering Impromptu reports are in \installation_location\Samples\Impromptu\Reports.

Standard Templates
You can also open these templates using the shortcuts in \installation_location\Bin\User Workspace.

Description
Crosstab.imt
This is a standard crosstab template.

Form Letter.imt
This is a standard form letter template.

Grouped Crosstab.imt
This is a standard grouped crosstab template.

Grouped List.imt
This is a standard grouped list template.

Mailing Labels.imt
This is a standard mailing label template.

Simple List.imt
This is a standard list template.

Stored Procedure.imt
This is the template you use to call stored procedures.

Location
All standard templates are in \installation_location\Samples\Impromptu\Templates\Standard.

PowerPrompts Applications
The PowerPrompts tutorial and the sample applications are all generated from reports based on the GOSales.cat catalog. The PowerPrompts samples consist of several types of files. The application files (.xxm) are used with the PowerPrompts Developer Studio. The report files (.imr) contain the information for each application. Several HTML files (.htm) contain the formatting and appearance of the PowerPrompts applications.

162 IBM(R) Cognos(R) Impromptu(R)

Chapter 17: Product Sample Listing

Description
customersatisfaction.xxm and customer_satisfaction.imr
This report and application demonstrate cascading prompts. Each selection on a web page influences the choices available on the next page. For example, when a user selects a set of product lines the following prompt will restrict the user to product types that belong to the selected product lines. In the final report, each product row is highlighted in a color that reflects the relative success of the product based on product returns. Bright green indicates a very successful product, dark green means somewhat successful, dark red means somewhat unsuccessful, and bright red means very unsuccessful.

currency.xxm and currency.imr


This application is based on the currency.imr report, made specifically for this sample. The sample displays currency names, and the euro to local conversion value. This sample uses a query function to retrieve SQL used in the currency.imr report instead of a Dynamo or JavaScript from PowerPrompts. Any changes to the report in Impromptu are automatically picked up when the PowerPrompts application is run. Also, the query function adds a column from Impromptu into the PowerPrompts application.

singlepage.xxm and singlepage.imr


This report and application demonstrate different types of prompts on a single page. The sample displays a product name and the expected volume of sales for that product over time.

tutorial.xxm and pwp_tutorial_js.imr


This report and application are needed to complete the tutorial included in the Discovering PowerPrompts book. The report lists all the sales representatives and their sales transactions by retailer.

salesstaff.xxm and sales_staff_report.imr


This report and application demonstrate how the appearance of PowerPrompts can be dynamically changed based on themes selected by Upfront users. The sample displays sales staff names with their home country, occupational position and other information specific to the sales staff. The user filters the results based on occupational position and by country.

Location
File Name customersatisfaction.xxm customer_satisfaction.imr currency.xxm currency.imr singlepage.xxm singlepage.imr tutorial.xxm pwp_tutorial_js.imr Default Location \installation_location\samples\powerprompts\cascade \installation_location\samples\Impromptu\reports \installation_location\samples\powerprompts\queryreport \installation_location\samples\Impromptu\reports \installation_location\samples\powerprompts\singlepage \installation_location\samples\Impromptu\reports \installation_location\samples\powerprompts\tutorial \installation_location\samples\Impromptu\reports

Administration Guide 163

Chapter 17: Product Sample Listing

File Name salesstaff.xxm sales_staff_report.imr

Default Location \installation_location\samples\powerprompts\upfronttheme \installation_location\Impromptu\reports

Notes
If PowerPrompts is installed to a location other than C:\Program Files\Cognos\cern, the samples with the .xxm extension, will fail to run. You must specify the location of each .imr report.

OLE Automation (Macros)


Description
For information about the macros included with Impromptu, see the Sample Macros section of the Impromptu Macro online help. In the Documentation folder, double-click imp_mac.hlp.

Location
All macro files are in either \installation_location\Samples\Impromptu\Macros or \installation_location\Samples\CogMac.

User Defined Functions


Description
Software Developers Kit
These files are included: cogudf.h cogudf.mak cogudfty.h udf.mak udf.mdp udf.ncb udflib.lib Use these files in Microsoft Developer Studio with Visual C++ to build .dll files that contain external user defined functions (UDFs). Database UDFs These files are included: cogudfxx.sql database udf readme.txt impfunct update.txt informix udf.txt oracle udf.txt orfunct update.txt Use these files to implement an Oracle or Informix database UDF. When you use Impromptu to connect to the database for which the UDF has been implemented, the UDF will be visible in the expression editor.

Encryption UDFs
These files are included: 164 IBM(R) Cognos(R) Impromptu(R)

Chapter 17: Product Sample Listing cogudf encrypt update.sql encrypt readme.txt encrypt.c encrypt.def encrypt.dll impfunct encrypt update.txt

Use these files to implement encryption UDFs. When you implement the UDFs, they will be visible in the expression editor.

HTML UDFs
These files are included: cogudf html update.sql html readme.txt impfunct html update.txt pubhtml.c pubhtml.def pubhtml.dll Use these files to implement HTML UDFs. When you implement the UDFs, they will be visible in the expression editor.

Location
File Name SDK files Database UDF files Encryption UDF files HTML UDF files Default Location \installation_location\Bin\ \installation_location\Bin\UDF\Database UDFs \installation_location\Bin\UDF\Encryption \installation_location\Bin\UDF\Save As HTML

Administration Guide 165

Chapter 17: Product Sample Listing

166 IBM(R) Cognos(R) Impromptu(R)

Chapter 18: Integrating Impromptu with Other IBM Cognos Products


You can use IBM Cognos BI to give users across your enterprise access to important information quickly, and with easy, centralized administration. You can use Architect for centralized metadata modeling Use Architect to create a business model of your database that all your IBM Cognos BI products can use. You can export a part the model as an Impromptu catalog and use it to create reports. the DB2 Dimensional Metadata wizard to leverage dimensional data in DB2 Cube Views Access Manager for centralized, enterprise-wide security Access Manager uses LDAP technology to provide a single security structure for your entire enterprise. Impromptu Web Reports to distribute your reports over the Web in a managed environment Report consumers can subscribe to reports and use their Web browsers to view them in .pdf, .csv, .html, or .xls format. If they want more information about a certain column in a report, they can drill through to IBM Cognos Query, an ad hoc reporting product for the Web. IBM Cognos Query for Web-based reporting IBM Cognos Query users can create their own queries. They can sort, filter, group, and format data. Advanced users can create new queries that are then distributed to other users. You can import queries into Impromptu, save them as reports, and distribute them over the Web again using Impromptu Web Reports. PowerPlay for client- and Web-based OLAP reporting Use Impromptu to specify a set of data to use as an OLAP data source for PowerPlay. Also, if your users want to see the details behind a trend, they can drill through to an Impromptu report. Upfront to distribute reports directly to the Web Report consumers can use Upfront NewsBoxes to access reports. Configuration Manager to configure IBM Cognos Series 7 components Use to manage configuration settings, such as locale and accessibility.

Use Architect with Impromptu


You can use Impromptu to create and modify catalogs or you can use catalogs created in IBM Cognos Architect, a standard metadata application for IBM Cognos products. You can use Architect to assemble metadata from existing data sources, and then create a business model of your databases for use with Impromptu, PowerPlay, and IBM Cognos Query. You can create several catalogs from the same business model, each tailored to a specific audience. You can also create user classes for each catalog and set several properties, including whether the user class can create and edit reports the maximum number of rows the user class can retrieve the maximum number of database tables the user class can access which parts of the catalog the user class can view

Administration Guide 167

Chapter 18: Integrating Impromptu with Other IBM Cognos Products

Import Impromptu Metadata into Architect


You can import your existing catalogs into an Architect model. Architect converts your catalog folders and columns into entities and attributes, and imports condition filters, prompts, and calculations. When you import an Impromptu catalog into the Architect model, Architect uses the information contained in the catalog to automatically create the data access model, the business model, and a package. Architect matches the user classes of the catalog with those in Access Manager. The Architect catalog contains a reference to a namespace on the directory server where Access Manager stores security information. If users arent listed in that namespace they cant open the catalog. You can use Architect to set up governor options for the Access Manager user classes in the namespace. For more information about using Architect to create catalogs, see the Architect online Help.

Task List Before Moving Existing Catalogs Into Architect


Because Architect uses Access Manager for security, ensure the following before importing your catalogs: If you use more than one catalog with the same user classes, the user classes must have the same permissions and restrictions. For example, the Sales user class in Catalog1.cat must be identical to the Sales user class in Catalog2.cat. If there are discrepancies, you will lose security information when you import the catalogs. If different user classes in different catalogs share the same name, rename them before you import the catalogs. For example, Catalog1.cat contains a user class called Sales that regional sales administrators use to track the performance of each sales representative. Catalog2.cat contains a user class called Sales that sales representatives use to check their own performance against quota. You should rename the user classes to Sales Admin and Sales Rep. The user class names in your catalogs match the user class names in the Access Manager namespace. If Architect cant find a user class in the namespace, it discards the security information for that user class when you import the catalog.

Export Catalogs from Architect


You can copy portions of your business model into packages and generate a catalog from each package. You can create several packages from the same business model, each customized for a specific audience. However, because Impromptu connects to one database at a time, you must ensure that all the tables and columns that are referenced in a single package are in the same database. When using these catalogs, Impromptu uses Access Manager to control security. You must decide whether these catalogs will be read-only or read-write when you export them. They are, by default, read-only. You cannot modify the read-only catalogs in Impromptu. To make catalogs read-write when you export them from Architect, in the Save As dialog box, clear the Export as Read-Only check box. For more information about exporting an Impromptu catalog, see the Architect online help. To modify the read-write catalogs in Impromptu, the catalog namespace must have a Creator user class and you must log on as a member of that user class.

Integrate with Impromptu Web Reports


When your reports are ready for distribution, you can deliver them together with their catalog and any required files to your Impromptu Web Reports report administrator. Your report administrator publishes the reports so that users with the appropriate permission can view them in their Web browsers.

168 IBM(R) Cognos(R) Impromptu(R)

Chapter 18: Integrating Impromptu with Other IBM Cognos Products

Preparing Your Reports for the Web


There are several things you should keep in mind when you create reports for distribution over the Web using Impromptu Web Reports. For example, Impromptu Web Reports does not support IBM CognosScript, AutoRun macros, or OLE automation.

Security Interaction With Impromptu Web Reports


If you want users to be prompted for a database signon every time they open a catalog, do not share an Access Manager namespace with Impromptu Web Reports. If you use the same namespace to store security information for both Impromptu and Impromptu Web Reports, the security information you enter for one product may have an effect on the security for the other. For example, you don't have a database signon stored in your namespace so Access Manager prompts you for one when you open an Impromptu catalog. Later, you run a report in Impromptu Web Reports that uses the same catalog, and Access Manager prompts you for a database signon again. If the option to save database signon is specified, Access Manager stores the database signon information in your namespace. The next time you open the catalog in Impromptu, Access Manager already has your database signon and doesn't prompt you for one.

Database Signon Differences Between Impromptu Web Reports and Impromptu


Impromptu Web Reports and Impromptu have similar, but different, methods for determining database signon information. When an Impromptu Web Reports report set is retrieving database signon information from Access Manager (User option button -- Report Project view of the Report Administrator), it will ignore any database signon information in the catalog user profiles. Similarly, if the report set is retrieving signons from the catalog user profiles (User Class option button -- same location), Impromptu Web Reports will ignore any signons in Access Manager. In contrast, Impromptu will use database signon information from either Access Manager (preferred) or catalog user profiles when the catalog does not contain a namespace.

Integrate with IBM Cognos Query


Impromptu Web Reports distributes Impromptu reports over the Web. Report consumers cant change the reports. They can select which reports they want to see and schedule reports to run at certain times. IBM Cognos Query is an ad hoc reporting product for the Web. Users can do many of the same things you can do using Impromptu on your computer, including creating their own queries sorting, filtering, and formatting queries You can use Impromptu to set up drill-through reporting from Impromptu Web Reports to IBM Cognos Query. When you distribute your reports using Impromptu Web Reports, users can drill through on a column that interests them and explore the information on their own. For example, you distribute a report that lists customer names, order numbers, and the total sale amount for each order. If users want to see transaction details for order number 160, they can click this value. A query, filtered to show only information for order number 160, opens in their Web browser. They can continue to sort, filter, and format the query, and follow hypertext links to related queries.

Drilling Through to IBM Cognos Query


When you save a query in IBM Cognos Query, you can create an Impromptu Query Definition file by selecting the Enable Drill Through check box. The .iqd file has the same name as the query, and contains the Structured Query Language statement the query is based on the name of the database the query attaches to a list of the columns in the query and the associated columns in the database

Administration Guide 169

Chapter 18: Integrating Impromptu with Other IBM Cognos Products You must select the Enable Drill Through check box to drill through to a query from another IBM Cognos product. For more information about .iqd files, see the IBM Cognos Query documentation.

Setting Up Drill-Through Access in Impromptu


In Impromptu, you can select which IBM Cognos Query server you want to drill through to using the Drill Through tab (Options dialog box). Then associate a column in your report with an .iqd file on that server using the Drill Through Properties dialog box. The Impromptu report and the query in IBM Cognos Query dont have to be related. You can associate a column in your report with any .iqd file on the IBM Cognos Query server and drill through to it. However, your Impromptu catalog and the IBM Cognos Query model should attach to the same database and have at least one common column for drilling through to be meaningful. To ensure your applications use the same data source, use Architect as your common modeling tool. Before you distribute the report in Impromptu Web Reports, you can test the drill-through access in Impromptu. When you click the Drill Through button, Impromptu creates the LaunchCQ.html file in your temporary folder and opens the file in your default Web browser. LaunchCQ.html contains scripts that launch IBM Cognos Query a form that automatically runs the query contained in the .iqd file filter statements so that the query shows only information about the drill-through column When you distribute your report over the Web, Impromptu Web Reports shows drill-through columns as hypertext links. For more information about drilling through to IBM Cognos Query, see the Impromptu online Help.

Importing Queries From IBM Cognos Query


If you want to distribute a query from IBM Cognos Query in a managed reporting environment, you can open it as a report in Impromptu and distribute it using Impromptu Web Reports. In IBM Cognos Query, you export the query as an Impromptu report. IBM Cognos Query creates a .cq file that contains the name of the package in Architect that the query is based on script language that tells Impromptu how to recreate the query Before you use the .cq file to create a report in Impromptu, you must create a catalog for the new report to use. In Architect, export the package that the query is based on as an Impromptu catalog. In Impromptu, you use the Import IBM Cognos Query dialog box (Tools menu) to select the .cq file and the catalog. Impromptu reads the script, runs the query, and shows the result in a list report. You can change or format the query, and then redistribute it using Impromptu Web Reports. For more information about importing queries from IBM Cognos Query, see the Impromptu online Help.

Integrate with PowerPlay


PowerPlay is the IBM Cognos BI product used for client- and Web-based OLAP reporting. You can use Impromptu to specify a set of data to use as an OLAP data source for PowerPlay. Also, if your users want to see the details behind a trend, they can drill through to an Impromptu report.

170 IBM(R) Cognos(R) Impromptu(R)

Chapter 18: Integrating Impromptu with Other IBM Cognos Products

Drilling Through from PowerPlay


PowerPlay users can select a value in a PowerPlay report and obtain more information about this value by drilling through to Impromptu. For example, a PowerPlay report shows that Camping Equipment sales in January 2004 are $40,000. PowerPlay users can drill through to Impromptu and get the order details for this $40,000 in sales.

How Does PowerPlay Drill Through Work?


PowerPlay users drill through to a saved Impromptu report. The Impromptu report is associated with a PowerPlay measure such as sales, cost, or profit margin percentage in PowerPlay Transformer. When a PowerPlay user chooses the Drill Through command, Impromptu starts, the associated report opens, and information passes from PowerPlay to Impromptu. Drill-through information is applied to the associated report when applicable. For example, a PowerPlay report shows sales for Camping Equipment in January 2004. The information passed from PowerPlay to Impromptu is Product = "Camping Equipment" and Year = "Jan04." The report associated with the sales measure appears with the filter "Product = Camping Equipment and Year = Jan04" applied to the report data in addition to any pre-existing filters. If Product and Year are not data items in the associated report, the filter cannot be applied and all the information in the report appears. If Product is a data item in the associated report and Year is not, Year = "Jan04" is dropped from the filter. Impromptu matches the filter information it receives from PowerPlay to columns in the Impromptu Data tab (Query dialog box). If the Year column has been changed in the Query Data tab to "MthYear", Year = "Jan04" is dropped from the filter (even when Year appears as a column title in the associated report). The filter information passed from PowerPlay is not visible in the Impromptu expression editor. However, it can be viewed in the Impromptu-generated SQL.

Limitations
The Impromptu report cannot be saved as a snapshot by the PowerPlay user. The Impromptu drill-through report cannot be a crosstab report. Binary Large Objects (BLOBS) are not supported in PowerPlay Transformer, and they cannot be part of the .iqd or .imr files for PowerPlay. Character or numeric values converted to date values for a PowerCube may cause Impromptu to generate invalid SQL for these columns when PowerPlay users drill through to Impromptu. To prevent this, ensure that date values for Transformer originate from date values in the underlying data source.

How Are Measures and Impromptu Reports Associated?


To enable drill-through access in PowerPlay reports, a PowerPlay measure is associated with an Impromptu report when the PowerCube is created. While all measures in a PowerCube can be associated with a single Impromptu report, each measure is typically associated with a different Impromptu report. For example, the Revenue measure can be associated with a sales report, and the Inventory measure can be associated with a stock report. The association of measures and Impromptu reports is flexible. For example, more than one Impromptu report can be associated with a measure, and not all measures in a PowerCube are associated to an Impromptu report. If there is more than one report associated with a measure, a list of reports and their corresponding descriptions appears when a PowerPlay user initially chooses the Drill Through command. When the user selects a report, it becomes the default report for the current measure.

Setting Up Drill Through Access


To enable drill-through access from PowerPlay to Impromptu, an administrator saves an Impromptu report as

Administration Guide 171

Chapter 18: Integrating Impromptu with Other IBM Cognos Products an Impromptu Query Definition (.iqd) file. PowerPlay Transformer uses the .iqd file as a data source for building PowerCubes. an Impromptu Report (.imr) file. The Transformer administrator associates a measure in the PowerCube with the report.

For more information about drilling through to Impromptu from PowerPlay, see the PowerPlay online Help.

Creating PowerCubes
Your PowerPlay administrator can use your Impromptu reports as data sources for PowerCubes. PowerCubes are OLAP data sources that you can open in PowerPlay to explore multidimensional information. To use your report as a PowerPlay data source, you must save it as an .iqd file. The .iqd file contains information about how to connect to the database and which columns are in the report. Your PowerPlay administrator opens the .iqd file in PowerPlay Transformer and models the data into a PowerCube. When you create a report as a data source for Transformer, keep the following points in mind: Create simple reports. Do not use crosstab reports. Include only those columns in the report that you want PowerPlay to use. Use filters to exclude information you do not want to view in PowerPlay.

Creating PowerCubes Automatically


You can use the Create PowerPlay PowerCube button to automatically create a PowerCube based on the currently open report. When you click the button, Impromptu runs a macro that saves your report as an .iqd file, starts Transformer, generates the PowerCube, and opens the PowerCube in PowerPlay. Transformer uses the AutoDesign command to generate the PowerCube. AutoDesign decides which columns to use as dimensions and which to use as measures. The following are tips you can follow to ensure AutoDesign works well: Use real date fields, not numeric or character fields containing date values. AutoDesign requires real date fields in order to break dates down by calendar year, quarter, and month. Give related columns similar names. AutoDesign assumes that columns with similar names are more likely to be related. Scan more data for a more accurate PowerCube. The more data PowerPlay scans, the more accurate the PowerCube data. However, creation time is longer for larger scan volumes. To change the number of records scanned, edit the following entries in the Trnsfrmr.ini file: rowCheckMax=600 sampleMax=300 The maximum sampleMax value is 1000.

Publish Reports to Upfront


You can publish reports to Upfront, the IBM Cognos Web portal, to make them available to users as NewsItems in HTML, PDF, Excel and CSV format. NewsItems are organized in NewsBoxes. For information about creating a NewsBox while publishing, see (p. 173). You can publish reports directly to Upfront, using the Impromptu Web Reports server. The computer on which Impromptu is installed must be configured to use the same security, or directory server, as the computer on which Impromptu Web Reports is installed. A report must be saved before you can publish it to Upfront.

172 IBM(R) Cognos(R) Impromptu(R)

Chapter 18: Integrating Impromptu with Other IBM Cognos Products

Steps
1. With a report open, from the File menu, click Publish to Upfront. The Publish to Upfront: Connect to IWR Server dialog box appears. 2. In the URL of IWR gateway box, enter the URL location for the IWR server. The URL has the form http://servername/web_alias/cgi-bin/gateway_connector. There are 3 gateway connectors, one for each type of web server protocol. Web server protocol CGI ISAPI NSAPI Gateway connector imrap.cgi imrapisapi.dll imrapnsapi.dll (Windows) imrapnsapi.so (Solaris, AIX) imrapnsapi.sl (HP) 3. Click OK. The Publish Report Projects1 dialog box appears. 4. Under Publish, choose whether to publish the current report or the entire report set. To publish only the current report, click Only the current report. To publish all the Impromptu application files found in the folder specified in the Publish box, click All reports at. 5. In the Report set options box, specify the report parameters for publishing. Select Update the existing report set Create a new report set named To Update a previously published report or report set Specify the folder location for a new report or report set. Impromptu creates the report files for publishing in this location. Enter the source location of the reports to publish using the IWR Server Report Set Location box. 6. Under Publish Reports to Upfront NewsBox, click Select. The Select Newsbox dialog box shows the NewsBoxes that exist in Upfront. 7. Click the Upfront NewsBox in which you want to publish the report or report set. 8. Click OK. The NewsBox location appears in the Publish reports to Upfront NewsBox box. 9. In the Publish Report Project1 dialog box, click OK. You are notified when publishing is complete. 10. To view the results, open Upfront and locate the reports in the NewsBox you specified in Impromptu. Note: Report sets are updated in the same manner as report sets are updated by IWR Report Administrator.

Create NewsBox on Publish to Upfront


You can create a NewsBox in Impromptu while publishing reports to Upfront. To successfully create a NewsBox, you must have sufficient privileges in Upfront. For information about publishing reports in Upfront, see "Publish Reports to Upfront" (p. 172).

Administration Guide 173

Chapter 18: Integrating Impromptu with Other IBM Cognos Products

Steps
1. In the Publish Report Projects dialog box, click Select, and then in the Available NewsBoxes list, click a NewsBox. If you have write permission to the selected NewsBox, you can create a NewsBox. If you have read-only permission to the selected NewsBox, even though it appears in the Available NewsBoxes list, it is not available, and you cannot create a NewsBox. If you do not have read permission to a NewsBox, the NewsBox does not show in the Available NewsBoxes list. 2. Click Create NewsBox, and then in the Name box, type a name for the NewsBox. 3. If you want, in the Description box, add a description for the NewsBox. 4. Click OK. You receive an error message if the NewsBox is not created in Upfront.

Data Formats and Locale Settings


Data formats depend on the locale configuration settings for your IBM Cognos Series 7 product. By default, IBM Cognos Series 7 server products and IBM Cognos Impromptu use a data format configuration file named cerlocale.xml. IBM Cognos Architect, IBM Cognos Visualizer, IBM Cognos PowerPlay for Windows, and IBM Cognos Transformer use Windows Regional Settings for locale settings and data format information. However, these products can also be configured to use the data format configuration file. For information about managing data formats, copying data format information, or editing the data format configuration file, see the Configuration Manager User Guide, or contact your administrator.

Creating Accessible Reports


We are committed to assisting people with disabilities, and promote initiatives that make workplaces and technologies accessible. For example, IBM Cognos Series 7 provides a report-reading solution for accessibility. This report-reading solution is currently available in English. In addition to the English report-reading solution, the Upfront Accessible theme can be read in English and French.

Enabling Accessibility Support


By default, reports created in Impromptu are not accessible to disabled users. To enable accessibility, you must specify the appropriate settings in Configuration Manager. Reports rendered with accessible tags can be read by screen readers when the reports exist in PDF format. PDF documents that support software accessibility guidelines contain additional markup information that increases the size of the PDF file produced and, as a result, may impact performance. If a report with accessible information degrades performance, render the same report twice. Render one report with accessible information and the other without accessible information. For more information about performance and accessibility, see the Planning Advanced Installations Guide.

Steps
1. 2. 3. 4. Open Configuration Manager. From the File menu, click Open the current configuration. The current configuration of your computer appears in the Configuration Manager window. From the View menu, click Advanced.

174 IBM(R) Cognos(R) Impromptu(R)

Chapter 18: Integrating Impromptu with Other IBM Cognos Products 5. In the Explorer, under IBM Cognos Impromptu, set accessibility for the appropriate component. To set accessibility for Impromptu User, under Impromptu, click the Accessibility category. To set accessibility for Impromptu Administrator, under Impromptu Administrator, click the Accessibility category. 6. Click the Accessible PDF property, and change the Value property to True. 7. From the Actions menu, click Validate Selection. 8. Click the Accessibility category, then from the Actions menu, click Apply Selection.

Design Considerations for Accessible Reports


When creating accessible reports for people with disabilities, consider the following design "do's and don'ts": Avoid using visual cues such as text bolding or color to convey important information. Avoid using pictures and OLE objects in PDF documents. These objects are tagged as artifacts and ignored by screen readers. Avoid using conditional formatting to convey important information. If using a chart, ensure that a table is included, and that the table provides the same information as the chart. In addition to these guidelines, you should be aware of report authoring features that are not supported for accessible reports in your product. The following Impromptu report authoring features are not supported for accessible reports: exception highlighting verbalization of images verbalization of the functionality of horizontal or vertical scroll bars In addition, accessibility to complex crosstab displays is limited, due to current limitations with assistive technology.

Administration Guide 175

Chapter 18: Integrating Impromptu with Other IBM Cognos Products

176 IBM(R) Cognos(R) Impromptu(R)

Chapter 19: Troubleshooting and Best Practices


Troubleshooting resources are sources of information that can help you resolve a problem that you are having with a product. Generally, sources of troubleshooting information include logs, debugging modes, documentation, and Cognos support. For information about Cognos support locations and programs, see the Cognos Software Services Web site (http://support.cognos.com). To contact Cognos support, you must have a current support agreement. Before you call, do the following: Verify that the problem is related to IBM Cognos software and results in an IBM Cognos error message. Attempt to reproduce the problem to ensure that it isnt just a simple error. Check obvious things like file locations, directories, paths, and access. Review all relevant documentation, including any release notes or readme files. Check to see if any recent changes in your computing environment might be responsible for the problem.

Unable to Identify Catalog Contents


If your catalogs are large and complicated, you may want to store information about the contents in an external data source; or your company may already store catalog information in a relational database or metadata repository. You can use that information to provide context help that describes columns, calculations, catalog filters, and catalog prompts. You create the annotation server that provides the annotations to the users. An annotation server receives the annotation request, searches your external data source for information about the item, and displays the information. You can create the annotation server in any application that can build a COM server or use the one provided as an example. For more information about COM servers, see your Microsoft documentation. An annotation request contains two pieces of information, the data item name and fully qualified folder path, and the database entity that this data item represents. The following table lists examples of what Impromptu would send to the annotation server for some data items from the Great Outdoors Sales database. Data item name and folder path

Annotated item

Actual database item \ColumnRef["GOS".COUNTRY_MULTILING UAL"."COUNTRY"] \(ColumnRef["GOS"."ORDER_DETAILS"."U NIT_SALE_PRICE"] * ColumnRef["GOS"."ORDER_DETAILS" ."QUANTITY"] ) (ColumnRef["GOS"."ORDER_DETAILS" ."QUANTITY"] * ColumnRef["GOS"."ORDER_DETAILS" ."UNIT_COST"] )

Country (Column) \Country\Country Order Income (Calculation) \Orders\Order Income

Administration Guide 177

Chapter 19: Troubleshooting and Best Practices

Annotated item Asia (Catalog Filter) Product Type Prompt (Catalog Prompt)

Data item name and folder path \Country\Conditions\ Asia \Prompts\Products\ Product Type Prompt

Actual database item \ColumnRef["GOS"."COUNTRY_MULTILIN GUAL"."COUNTRY"] in ( 'China' , 'Japan', 'Korea' , 'Taiwan' ) \PromptDef["\Prompts\Products\Product Type Prompt","Select the Product Type to use",ch,256,f,1,0,f,cp,FolderItemRef["Products "."Producttype"],FolderItemRef["Products"."P roducttype"]]

Steps to Set Up an Annotation Server Using Visual Basic


A compiled annotation server (AnnotationServer.exe) and an annotation database file (Annotate.mdb) are included in the Impromptu samples. 1. Open Visual Basic and select the ActiveX.exe project. Creating the annotation server using C++ is more work than using Visual Basic because you must create an ActiveX server that supports the interface. 2. Open the Project Explorer window. 3. Set the Project name to AnnotationServer. 4. Add new class called Annotate or rename Class1 to Annotate. 5. Add a function called AnnotateRequest to Annotate by pasting the following code in the (General) code window:
Public Sub AnnotateRequest(folder As String, dB As String) 'Configure the dialog box AnnotateResults.folder = folder AnnotateResults.dB = dB 'Show the dialog box AnnotateResults.Show End Sub

6. 7. 8. 9. 10.

Create a form to display the annotation. From the File menu, click Make AnnotationServer.exe to compile the executable file. Click Run and then click Stop. Distribute the AnnotationServer.exe to users. Have your users register AnnotationServer.exe to their computers. Tip: You could write a batch file (.bat) that registers AnnotationServer.exe for your users. After being registered, users can open Impromptu and request annotations. Users can open annotations in the Query dialog box, Folders dialog box, and any expression editor.

178 IBM(R) Cognos(R) Impromptu(R)

PART 2: Creating Reports with Impromptu

Administration Guide 179

180 IBM(R) Cognos(R) Impromptu(R)

Chapter 20: View a Report


Description
You may have created your own Impromptu reports, or someone else in your organization may have created a number of reports for you. When you view or open a report, Impromptu retrieves the data from the database.

What You Can Do


You can view an existing Impromptu report. view the report in either page or screen layout view. drill through to information behind a value in your report using a drill-through report created by you or your administrator. For example, you can view the detailed sales transactions that account for the total sales for a particular customer.

Related Topics
"Change the Page Layout View of a Report" (p. 183) "View an Existing Report" (p. 181) "View the Details of a Value in a Report" (p. 182)

View an Existing Report


Steps
1. If you are just starting Impromptu, click Open an Existing Report in the Welcome dialog box. Otherwise, from the File menu click Open. 2. Locate and select the report you want to open, and click Open. If the IBM Cognos Common Logon dialog appears, type your User ID and click Log On if you are using Access Manager for security. Otherwise, click Cancel. If you do not have a catalog open, the Catalog Logon dialog box appears where you can select a catalog, enter your user class and click OK. 3. Click OK. If the catalog or report was created with a previous version of Impromptu, see "Upgrade a Catalog or Report" (p. 203).

More Info Note


The Welcome dialog box is not available when the Show the Welcome to Impromptu dialog check box is cleared in the Start-up tab (Options dialog box, Tools menu).

Tips
To quickly locate reports in the User Workspace folder, click the FastFind button (Open dialog box). To add a shortcut to one of your folders or reports in the User Workspace, click Add to FastFind (Open dialog box). You can load the same catalog automatically every time you run Impromptu. From the Tools menu, click Options, and click the Startup tab.

Administration Guide 181

Chapter 20: View a Report

Related Topics
"View a Report" (p. 181) "View the Details of a Value in a Report" (p. 182)

View the Details of a Value in a Report


Description
You or your administrator may have created one or more drill through reports that you can open from your current report. A drill-through report shows information behind a value you select in the current report. The Drill Through command is available for list reports, crosstab reports, sub-reports, charts, and reports using HotFiles or snapshots.

Example

Steps to View the Details Using the Report Menu


1. Select a value associated with a drill-through report. Note: Do not select multiple rows and columns. Drill-through reports are available only when you select a single value. You may want to add custom formatting, such as highlighting or underlined text, to indicate which values are associated with a drill-through report. 2. From the Report menu, click Drill Through. 3. Select the report you want to view from the list, and click OK.

Step to Quickly View the Details of a Value in a Report


To open the default drill-through report, do one of the following: Select a value associated with a drill-through report and click the Drill Through toolbar button. Drill Through button Double-click a value associated with a drill-through report. Impromptu opens the default drill-through report if an association exists. If no drill-through association exists, the I beam cursor appears indicating that you can edit the text.

More Info Notes


Only one copy of a drill-through report associated with a value can be open at a time.

182 IBM(R) Cognos(R) Impromptu(R)

Chapter 20: View a Report Impromptu includes a sample drill-through report, Product Orders Drill-Through.imr

Tips
To return to the main report from a drill-through report, use the Window menu. To view all the data in a drill-through report, click the Undo button on the toolbar. Impromptu removes the drill-through filter and displays all the data in the drill-through report. To quickly open a drill-through report, double-click a value associated with a drill-through report, right-click a value and select Drill Through from the menu, or select a value and press Enter. To save a drill-through report, click the Save As command (File menu). To drill through from a chart, select the entire chart.

What if ...
The Drill Through command and the Drill Through button are not available? No drill-through report is available for the value you have selected or you have selected multiple columns or rows. Drill-through reports are available only when you select a single value. The Drill Through Properties command from the Drill Through drop-down menu is not available? The Enable Drill-Through Properties check box (Options dialog box, Tools menu) is not selected. The drill-through report contains no data? There is a conflict between the main report and the drill-through report. For more information, see your administrator.

Related Topics
"Drill Through to IBM Cognos Query" (p. 281) "Set Up Drill-Through Access to IBM Cognos Query" (p. 282) "View a Report" (p. 181) "View an Existing Report" (p. 181)

Change the Page Layout View of a Report


Description
Two different views are available when you work in Impromptu. The view you choose depends on the type of work you are doing. Use Screen Layout view for inserting graphics or comments. Screen Layout view is good for editing and formatting text, and for screen-only reports. Use Page Layout view to reduce the view so you can see the edges of your report. Use this view to see page numbers if youve included them in your report. You can also see the layout of the report page including page headers and footers. What you see in Page Layout view is how your report will look when it is printed.

Step
From the View menu, click Screen Layout or Page Layout.

More Info Notes


Page layout view is only available if a default printer is defined. The results of the Fit to Page and Repeat This Column on Every Page options are not visible in the Screen Layout view.

Administration Guide 183

Chapter 20: View a Report The results of the Fit to Page option are not visible in the Page Layout view. You can only see the scaled down columns when you preview a report before printing, or when you print the report.

Tips
To quickly move between the Screen Layout view and the Page Layout view, use the toolbar buttons. Screen Layout button Page Layout button To take a closer look at your report, click one of the Zoom buttons on the toolbar. You can also reduce the view to see the entire page and make layout decisions easier. You can continue working on the report after enlarging or reducing the view. To enlarge the view in 25% increments, click the Zoom In button. To reduce the view in 25% increments, click the Zoom Out button. To fill the whole page, click the Whole Page button. To zoom in to 100%, click the 100% button. To zoom in to fit the page width, click the Page Width button.

Related Topics
"View a Report" (p. 181) "View an Existing Report" (p. 181)

184 IBM(R) Cognos(R) Impromptu(R)

Chapter 21: View a Report with a Web Browser


Description
Anyone with a Web browser can view a report that is saved as Hypertext Markup Language (HTML). To view HTML report output, you do not require Impromptu. Depending on how the HTML report is distributed, you can view it either directly on a Web page by clicking the button set up to launch the report by downloading the required HTML files from email or from a network folder and opening the main HTML page on your computer You cannot update an HTML report with new data.

Step to View an HTML Report on a Web Page


Click the button on the Web page that launches the report.

Tip
Save the report to a folder called my report to keep all related files together.

Steps to View an HTML Report


1. Copy all the HTML report files from email or the network folder where they are located. 2. Open the main HTML page. Example: C:\Report1\index.htm You can open the file by double-clicking it in Windows Explorer using the Run command starting your Web browser first, then indicating the location and name of the main HTML page.

More Info Note


Printing capabilities for HTML reports depend on the browser you are using. You cannot print multiple pages of an HTML report and, depending on your browser, if you specify more than one page in the print range, a blank page may print. For more information about printing HTML reports from within a browser, see your browser help.

What if ...
You get a blank page when you print an HTML report? You did not select the report before sending it to print. Open the HTML report in your Web browser and click the middle of the report. Note that there is no visual indication that the report is selected.

Related Topics
"Export a Report to Other Applications" (p. 194) For information about creating HTML report output, see Mastering Impromptu Reports.

Administration Guide 185

Chapter 21: View a Report with a Web Browser

186 IBM(R) Cognos(R) Impromptu(R)

Chapter 22: Print a Report


Description
Using the Print Preview command, the Page Setup command, and the Print Setup dialog box, you can preview your report, page by page, to ensure that it looks exactly the way you want it to look when it is printed set the margins, determine where headers and footers are printed, and set where to start a new page choose the printer you want to use, the page orientation, the size and the source of paper, as well as a whole range of options for fonts, graphics, and memory temporarily override the paper size and orientation you set using the Page Setup command by clicking Setup in the Print dialog box. What you see in the Print Setup dialog box from the Print dialog box is dependent on the printer you have installed Using the Print command, you can choose to print all the pages or a range of pages in your report select the print quality of your report specify the number of copies you want printed and whether or not you want them collated

Note
In addition to printing a report, you can keep a copy of your current data by using a local snapshots, or the Save As command (File menu). You can also use the Copy and Paste commands (Edit menu) to move your data to another application.

Steps
1. From the File menu, click Print. 2. Do one of the following: To print the entire report, click OK. To print the current page only, in the From and To boxes type the current page number, and click OK. To print a range of pages, in the From box type the number of the first page you want to print, and in the To box type the number of the last page you want to click. Click OK. To print more than one copy, in the Copies box type the number of copies, and click OK. To print to a file you specify in the Print to File dialog box, click Print to File, and click OK.

More Info What if...


You want to change how the printer is set up? In the Print dialog box, click the Setup button. In the Printer box, select the printer and then click Properties. You want to change the orientation of your report? In the Print dialog box, click the Setup button. In the Orientation box (Print Setup dialog box), select Portrait or Landscape. You want to print a wide list report?

Administration Guide 187

Chapter 22: Print a Report Use the Fit To Page check box (Page Setup dialog box) or the Repeat This Column on Every Page check box (Text Properties dialog box). See "Print a List Report With Repeating Columns" (p. 190) for more information.

Related Topics
"Preview a Report" (p. 188) "Print a Wide List Report on a Single Page" (p. 189)

Preview a Report
Description
You can preview your report before you print it. Print Preview shows you all the parts of your report in their positions on the page. You can see a full report page or the actual page size and move to the next or previous page. You can also see one or two pages at a time, or zoom in and out on the report.

Steps
1. From the File menu, click Print Preview. Impromptu shows a page view of your report. You cannot edit your report while you are in print preview. 2. Do one of the following: To preview the next or previous page, click the Next Page button to go forward a page in the report. Click the Prev Page button to go backward a page in the report. The Next Page button is unavailable once you have reached the end of your report. The Prev Page button is unavailable when you are at the first page of your report. To switch from viewing a single page to viewing two pages, click the Two Pages button. The button name changes to One Page. You can click this button to switch back to one page. To switch from full page view to actual size view, click the Zoom In button on the toolbar. To zoom in closer, click the Zoom In button again. The Zoom In button is unavailable once you have clicked it twice. To return to full page view, click the Zoom Out button. You may have to click it twice to get back to full page view. The Zoom Out button is unavailable once you are in full page view. To return to your report, Click Close.

Related Topics
"Print a Report" (p. 187)

Set Up the Printer


Description
You can change the current printer or the print setup options. You can choose a different printer (if you have access to more than one printer). The Print Setup dialog box indicates the printer to which you are currently connected change the paper source for the printer you want to use. The choices you have are limited to your current printer selection temporarily override the paper size and orientation settings using the Page Setup dialog box. This will not change the default printer settings

Steps
1. From the File menu, click Print. 2. Click Setup. 3. In the Print Setup dialog box, do one or more of the following: 188 IBM(R) Cognos(R) Impromptu(R)

Chapter 22: Print a Report To select a printer from the list, select the printer name in the Name box. Note: Only installed printers appear in the list. To temporarily override the specified paper size, select the paper size in the Size box. To specify a paper source, select the paper source from the Source box. To temporarily override the specified orientation of the report, click either the Portrait or Landscape option button from the Orientation box. 4. Click OK. Impromptu saves your new printer settings (except for changes to the paper size and orientation) and returns you to the Print dialog box. 5. Do one of the following: If you want to print based on the settings in the Print Setup dialog box, click OK. If you want to save the new printer setting in the Print Setup dialog box, but you do not want to print, click Cancel.

More Info Notes


The default printer is always the printer you have selected as the default printer in the Windows Printers settings. Your report can exceed the paper size supported by your printer. To print a wide list report, see "Print a Wide List Report on a Single Page" (p. 189). List reports and crosstab reports print on multiple pages; other reports are clipped. For example, if the list report contains more columns than can fit on a single page, additional columns print on the next page unless you've set the Fit to Page option (Page Setup dialog box).

Related Topics
"Print a List Report With Repeating Columns" (p. 190) "Print a Report" (p. 187)

Print a Wide List Report on a Single Page


Description
If you have a wide list report with many columns, you can automatically scale it down to a single page. This allows you to keep information together on one page. As a result, your report is easier to understand.

Steps
1. From the File menu, click Page Setup. 2. In the List Frames box, select the Fit to Page check box. 3. Click OK.

More Info Notes


Fit To Page does not affect the Page Layout view or Screen Layout view of a report. Fit To Page scales down a wide list report while maintaining the horizontal/vertical ratio. Fit To Page should not be used with the Repeat This Column on Every Page option. Fit To Page has no affect on how Impromptu Web Reports displays your report in PDF format. For more information about preparing reports for Impromptu Web Reports, see "Prepare a Report for Impromptu Web Reports" (p. 283).

What if ...
The Fit To Page check box is unavailable?

Administration Guide 189

Chapter 22: Print a Report You are not working on a list report. The Fit To Page check box is only available for list reports. The report is difficult to read after you select the Fit To Page check box? The report is too wide for the Fit To Page check box to be useful. You may want to repeat a column on every page instead. Part of the list report is cut off when you preview or print the report? The width of the list exceeds the physical page size. Select a value in the list. From the Edit menu, click Select Parent. From the Format menu, click Properties. Ensure that the box indicating width is set to Parent or is set to a specific width that is less than the physical page width.

Related Topics
"Preview a Report" (p. 188) "Print a List Report With Repeating Columns" (p. 190) "Print a Report" (p. 187)

Print a List Report With Repeating Columns


Description
You can use the Repeat This Column on Every Page check box to repeat one or more columns in a list report on every printed page (after the page where the repeating column first appears). When a report is too wide for one page, the additional columns are placed on the next page to the right. For page 1, the next page to the right is 1b. If you make a column on page 1 the repeating column, it becomes the first column on page 1b. This can be useful if your report is too wide to fit on a single page or too wide to be readable when scaled down using the Fit To Page option. When you repeat columns, the context of the information is maintained, ensuring that every page of your printed report is easy to understand. You can resize or edit repeat columns and the changes are automatically applied to the original column on the page that it first appears, as well as to all the columns that repeat on subsequent pages.

190 IBM(R) Cognos(R) Impromptu(R)

Chapter 22: Print a Report

Example

Steps
1. 2. 3. 4. Select one or more columns in your report. From the Format menu, click Properties, and click the Printing tab. Select the Repeat This Column On Every Page check box. Click OK.

More Info Notes


The Repeat This Column on Every Page option does not affect the Screen Layout view of a report. The Repeat This Column on Every Page option can also be applied to the row area of a crosstab. It cannot be applied to either cells or columns.

What if ...
You want to see which columns repeat? Select a value or column in your report. Click the Select Parent toolbar button. From the Format menu, click Properties and click the Printing tab. Select Parent button Columns do not repeat when you preview or print a report?

Administration Guide 191

Chapter 22: Print a Report The Fit To Page option may be enabled. From the File menu, click Page Setup and click the Printing tab. In the List Frames box, ensure that the Fit To Page option is cleared.

Related Topics
"Preview a Report" (p. 188) "Print a Report" (p. 187) "Print a Wide List Report on a Single Page" (p. 189)

192 IBM(R) Cognos(R) Impromptu(R)

Chapter 23: Export a Report


One way of sharing data between an Impromptu report and another application is to save the report in the file format of the other application. Saving your data in another file format is one way to keep a permanent copy of the current data.

File Formats Available for Exporting


Save Your Report As ... HotFile (.ims) HotFiles are used to access data from several databases Impromptu Query Definition (.iqd) Transformer uses information in the .iqd file to retrieve the data directly from your database when generating data in your model. For information about creating a model to use in PowerPlay, see the documentation for PowerPlay Transformer. IBM Cognos Visualizer uses information in the .iqd file to retrieve the data directly from your database when generating a visualization. For information about creating a visualization to use in IBM Cognos Visualizer, see the documentation for IBM Cognos Visualizer. If you save an Impromptu report that contains Access Security Tokens as an .iqd, Impromptu treats these values with special rules. The Access Security Tokens are: 1) catalog-user-profile, 2) user-name, and 3) user-classes. For more information, see the Impromptu Online help. Excel with Format (.xls) Analyze your data in a spreadsheet and keep the report formatting. You can save your reports in Excel 2000 format or Excel 2002 and higher format (default). To ... Use the results of your report as database tables in another catalog Create a source file for a PowerPlay Transformer model

Administration Guide 193

Chapter 23: Export a Report Save Your Report As ... Delimited ASCII (.csv) To ...

Use an ASCII file as a source file for a PowerPlay Transformer model, when you do Dates are exported as YYYY-MM-DD hh:mm not have to connect to the database to retrieve or as YYYY-MM-DD hh:mm am/pm. The latter the data for the model format is used when <ITime> is set to 0 in the cerlocale.xml file. When you use this format for a Transformer model, Transformer automatically identifies the data items in the file, and assigns them default names. The default names are based on the data item values in the files first record. Note the data item names that you are saving so you can assign the correct names in your model later. XML (.xml) Portable Document Format (.pdf) Hypertext Markup Language (.htm) Data File (.dat) Text (.txt) Use the Impromptu report in XML applications Create a report in printable format View a report using a browser Analyze your data using PowerPlay Transfer the results of an Impromptu report to other applications that cannot import Impromptu reports directly Use the SQL (Structured Query Language) statements that created the Impromptu report Use data in your report as a dBASE database

SQL (.sql) dBASE (.dbf)

Related Topics
"Attach a Report to Email" (p. 196) "Export a Report to Other Applications" (p. 194) "CSV File Format" (p. 196)

Export a Report to Other Applications


Steps
From the File menu, click Save As. Locate the folder where you want to save the file. In the File Name box, type a name for the file. In the Save As Type box, select the file format you want. When you save a report as Excel, you can specify the version of Excel to use (p. 196). When you save as a dBase file, you save the data only. The dBase field names are based on the data items listed in the Data tab (Query dialog box). When you save as a delimited ASCII file, you save the data only. When you save as an SQL file, you save the SQL statements that Impromptu uses to retrieve the data. When you save as a text file, you save the data and the column titles. When you save as an Impromptu Query Definition file, you save the formatting and the commands required to retrieve the data from the database. 5. If you save the report as a dBASE (.dbf), Hypertext Markup Language (.htm), or Delimited ASCII file (.csv), click Options to set options on how to export the file. 194 IBM(R) Cognos(R) Impromptu(R) 1. 2. 3. 4.

Chapter 23: Export a Report 6. Click Save. Impromptu makes a copy of the existing file and stores it in the folder you selected, using the file name you typed and the extension that matches the new format. The original Impromptu version of the report or template remains open on your screen.

More Info Notes


Impromptu Query Definition (.iqd) files contain no security information. If the report contains information some users should not see, you must set up the appropriate security in the target IBM Cognos application. Hypertext Markup Language (.htm) files and Portable Document Format (.pdf) files can be rendered with a Report Navigator which adds navigation links to report output. To add a Report Navigator, use the Navigation tab of the Report Properties dialog box.

Related Topics
"Export a Report" (p. 193) "Render a Report in Excel Format" (p. 196) "CSV File Format" (p. 196) "Add Report Navigation" (p. 195)

Add Report Navigation


You can add a Report Navigator to your report output to set navigation based on one or more grouped columns. The columns serve as bookmarks in PDF report output and table of contents entries in HTML report output. For items to appear in the Report Navigator, the selected columns must be visible in the report. In addition, only grouped and associated columns are available for selection. If you do not have any grouped columns in your report, you cannot add columns to the Report Navigator. A Report Navigator is recommended for multipage reports. However, if your report fits on one page, a Report Navigator is not required.

Steps
1. With a report open, from the Report menu, click Navigation. 2. Select the Include report navigator check box. 3. In the Available columns box, select the check box next to one or more of the grouped or associated columns that you want. 4. For HTML report output, specify the following HTML navigation properties that you want. Goal Action

Include a list of page numbers in the report Select the Include page numbers check box navigator, which link to specific pages in the report body Remove duplicate entries in the report navigator caused by horizontal page breaks Select the Suppress duplicate entries check box

5. Click OK. Tip: If you later want to remove all bookmarks in your report output without changing the settings in the Available Columns box, clear the Include report navigator check box. The Bookmark tab remains in the PDF report output when you view a report in Adobe Reader. This is expected Adobe behavior.

Related Topics
"Create a Report" (p. 201)

Administration Guide 195

Chapter 23: Export a Report

Render a Report in Excel Format


When you export a report to Excel (p. 194), you can choose to render it as Excel 2000 or Excel 2002 and higher. Reports rendered as Excel 2000 have limited rendering. Reports rendered as Excel 2002 and higher have complete rendering of report objects. There are a number of best practises recommended when exporting reports to versions of Excel 2002 and higher. For information about designing reports for Excel, see Mastering Impromptu Reports.

Steps
1. Open a report. 2. From the Report menu, click Excel, and in the Version box, click the Excel version to use. 3. If you want to, you can include the following objects with the Excel 2002 and higher version by clicking the check box next to the object: images static charts text frames summary expressions 4. Click OK.

Related Topics
"Create a Report" (p. 201)

Attach a Report to Email


Description
If you use Microsoft Mail, Exchange, or Outlook, you can send a report as an attachment to an email message to users who have access to the report catalog.

Step
From the File menu, click Send. The report appears as an attachment to a new Microsoft Mail, Exchange, or Outlook message.

More Info Tip


If your users don't have access to the report catalog, save the Report as a snapshot and then send the report.

Related Topics
"Export a Report" (p. 193)

CSV File Format


You can export data as delimited text using many of the IBM Cognos products. In PowerPlay for Windows, you can export data as a delimited ASCII text file (.asc). In PowerPlay Web, IBM Cognos Query, Impromptu, and Impromptu Web Reports, you can export data as a Comma Separated Value file (.csv). Delimited text format is one of the most popular export formats, because the resulting file can be used as an import source by many applications. The updated delimited text format used in Series 7 ensures a high degree of compatibility in multi-language environments. It also ensures reliability when importing into third-party applications such as Microsoft Excel.

196 IBM(R) Cognos(R) Impromptu(R)

Chapter 23: Export a Report Each IBM Cognos product exports data to delimited text format in the same manner, as shown in the following table. List separator The list separator specifies what character separates items in a list. Its default value is derived from the locale settings. The list separator selected is not persisted between sessions or Save As operations. Note: In Impromptu, you can optionally change this character. Export of numeric data The decimal symbol for the locale is used, even if the format or pattern of the number contains an explicit decimal that differs from the locale. The digit grouping symbol (the symbol used to group large numbers such as thousands in the US locale) is not used in the CSV export. The negative sign symbol but not the format of the locale is used. This may also be different than the explicit format used for that number. The negative symbol is always leading. For example, for a German locale of DE_DE, a number that was formatted as "(765 000.45)" is exported to CSV format as "-765000,45". Export of currency data Currency values follow the same rules as numbers. The currency symbol is not exported. For example, if the locale is EN_US, and the format of the number in a PowerPlay report is "$123,456.00", then PowerPlay exports "123456.00". Export of character data Export of date and time data In some products, you can optionally allow quotes to be put around the text. This technique ensures that a text field containing the list separator (such as a comma) is not interpreted as multiple fields in the exported file. Dates are exported in ISO format, YYYY-MM-DD Time is exported as ISO format, hh:mm:ss. The hour value (hh) uses the 24-hour clock. Note: In PowerPlay, the date is defined in the Transformer model and is exported as text.

Related Topics "Export a Report" (p. 193) "Export a Report to Other Applications" (p. 194)

Administration Guide 197

Chapter 23: Export a Report

198 IBM(R) Cognos(R) Impromptu(R)

Chapter 24: Use Annotations


Description
Annotations describe catalog and report items that your company may already store in a relational database or metadata repository. Your Impromptu administrator creates the annotation server, connects it to the annotation database, and distributes the server (called AnnotationServer.exe). After you copy the server to your computer and register it, you can open the annotations that describe the columns, calculations, catalog filters, and catalog prompts you use. If you don't register your annotation server to your computer, your annotation requests will fail. You can open annotations in the Query dialog box, Folders dialog box, and any expression editor.

Steps to Register the Annotation Server


1. Copy the server (called AnnotationServer.exe) to your computer. 2. In Windows Explorer, double-click AnnotationServer.exe. Your annotation server is registered on your computer.

Steps to Request Annotations


1. Open the Impromptu catalog or report that contains annotations. 2. In the Query dialog box, Folders dialog box, or any expression editor, select a data item and press F1. The annotation server starts and shows the annotation information.

Tip
To request annotations, you can also select the What's This? arrow (in the top-right corner of the dialog box) and then click the data item.

Administration Guide 199

Chapter 24: Use Annotations

200 IBM(R) Cognos(R) Impromptu(R)

Chapter 25: Create a Report


What Is a Report?
An Impromptu report is a focused answer to a business problem. It is an organized and formatted view of the data requested from your company database.

What Is In a Report?
A report contains data Reports show data from your database. The Impromptu catalog contains all the information necessary for Impromptu to access and retrieve information from a relational database. Every time you open your report, Impromptu updates it with the most recent data. formatting You can enhance a reports appearance by rearranging and aligning parts of a report, changing the font, applying borders and patterns, setting margins, and so on. When you save a report, you save the information and instructions about what data to get from the database and how to format the report. You do not save the actual data.

How to Create a Report


You can create a report using the Report Wizard a template

Using the Welcome Dialog Box


The Welcome dialog box appears when you first start Impromptu. Click ... Create a Standard Report Create a Report Using a Template Open an Existing Report Take a Quick Tour To ... Use the Report Wizard to help you create a list or crosstab report quickly and easily. Create a new report using one of Impromptu's templates. Open a report that you previously saved. Discover the possibilities available to you with Impromptu.

Using the Report Wizard


The Report Wizard asks what type of report you want to create, a list report or a crosstab report. The wizard then prompts for the title of your report, the data you want to include, and the data items to group (if applicable), and how you want to filter the data. The Report Wizard does the rest for you.

Using Templates
A template is an incomplete report. It can contain formatting, calculations, macros, and placeholders. You add the appropriate data items to the template to create a report. For example, a template may have placeholders for a customer address.

Administration Guide 201

Chapter 25: Create a Report You can use a template as a pattern for creating a report. Alternatively, you can modify an existing template to suit your business needs or create your own template.

Related Topics
"Add Report Navigation" (p. 195) "Create a Crosstab Sub-Report" (p. 208) "Create Accessible Reports" (p. 208) "Open a Catalog" (p. 202) "Upgrade a Catalog or Report" (p. 203) "Use a Report in Another Report" (p. 207) "Use a Template to Quickly Create a Report" (p. 205) "Use the Report Wizard to Quickly Create a List Report" (p. 203) "Use the Report Wizard to Quickly Create a Crosstab Report" (p. 204) "View a Report" (p. 181)

Open a Catalog
Description
To create or run Impromptu reports, other than snapshot reports, you must first open a catalog. You can open a different catalog at any time during your Impromptu session, but you can open only one catalog at a time. When you open a different catalog, Impromptu, by default, automatically connects the catalog to the appropriate database and closes any open reports.

Example
You have a catalog called Sales Results that is attached to the sales database and a catalog called Accounts Receivable that is attached to the accounts database. When you close the Sales Results catalog and open the Accounts Receivable catalog, Impromptu automatically attaches you to the accounts database, not to the sales database.

Steps
Note: If there is no open catalog and you are opening or creating a report using the Report Wizard, or creating a report using a template, you are prompted to open a catalog. Proceed to step 2. 1. From the Catalog menu, click Open. 2. In the Open Catalog dialog box, locate the catalog and click Open. 3. If the IBM Cognos Common Logon dialog appears, type your User ID and click Log On if you are using Access Manager for security. Otherwise, click Cancel. 4. In the Catalog Logon dialog box, select your user class from the User Class box. 5. If a catalog password is required, type it in the Password box. 6. If you have a database user ID and password, type them in the Database User ID and Password boxes and click OK. If you opened the catalog from the Catalog menu, the screen is blank, but a status message indicates the name of the database to which you are connected.

More Info Notes


If you cannot open a catalog, your administrator may have it open for maintenance. The last user class chosen becomes the default user class for the catalog for that user. If you do not know your user class, see the administrator.

202 IBM(R) Cognos(R) Impromptu(R)

Chapter 25: Create a Report

Tip
To close a catalog, click Close from the Catalog menu. To obtain a better view of a long list of catalogs, resize the Open Catalog dialog box.

Related Topics
"Reporting While Disconnected From the Database" (p. 277) "Create a Report" (p. 201)

Upgrade a Catalog or Report


Description
If the catalog or report was created with a previous version of Impromptu, the Catalog Upgrade or Report Upgrade dialog box appears. When you want to use, but not modify the catalog, and also want to continue using previous versions of Impromptu, click Open this Catalog as Read-Only. If you want all previous version catalogs to open as read-only automatically, click Open this Catalog as Read-Only and then clear the Show This Dialog When Opening Previous Version Catalogs check box. When you want to view, but not modify, a report, and also want to continue using previous versions of Impromptu, click Open this Report as Read-Only. If you want all previous version reports to open as read-only automatically, click Open this Report as Read-Only and clear the Show This Dialog When Opening Previous Version Reports check box.

Steps to Upgrade a Catalog


1. To upgrade a catalog, click Upgrade this Catalog. Note: If you want to upgrade all previous version catalogs automatically, click Upgrade this Catalog and clear the Show This Dialog When Opening Previous Version Catalogs check box. 2. Click OK. Previous versions of Impromptu can no longer open this catalog.

Steps to Upgrade a Report


1. To upgrade a report, click Upgrade this Report. Note: If you want to upgrade all previous version reports automatically, click Upgrade this Report and clear the Show This Dialog When Opening Previous Version Reports check box. 2. Click OK. 3. From the File menu, click Save. Previous versions of Impromptu can no longer open this report.

More Info What if ...


You want to show the Catalog Upgrade dialog box or the Report Upgrade dialog box? From the Tools menu, click Options. Click the Show the Catalog Upgrade Dialog Box or the Show the Report Upgrade Dialog Box check box.

Related Topics
"Create a Report" (p. 201) "Open a Catalog" (p. 202)

Use the Report Wizard to Quickly Create a List Report


Description
The Report Wizard is the quickest and easiest way to create a list report. The Report Wizard prompts you for the information you need to create your report.

Administration Guide 203

Chapter 25: Create a Report

Steps
1. If you just started Impromptu and the Welcome dialog box is open, click Create a Standard Report. Otherwise from the File menu click New, select the Simple List template, and click Wizard. 2. If the catalog is not open, open and log on to the catalog you want. 3. Type a title for your report, and click Next. 4. Click the List Report option button and follow the instructions in the Report Wizard. The Report Wizard creates a list report based on the information you provide.

More Info Notes


The Report Wizard supports any template created with Impromptu (except the Blank template). If the catalog or report was created with a previous version of Impromptu, see "Upgrade a Catalog or Report" (p. 203). You can drag and drop only one data item at a time when working with folders in the Wizard.

What if ...
You want to create a new report using a different catalog? From the Catalog menu, click Close, and then create a new report. You are automatically prompted to select a catalog. You want totals inserted automatically in the list report? Click the Automatically Generate Totals check box in the Grouping page (Report Wizard). A Total summary is inserted at the lowest level of detail in the report. You want to quickly save a report to the User Workspace folder? Click the FastFind button in the Save As dialog box, and then save your report.

Related Topics
"Create a Report" (p. 201) "Open a Catalog" (p. 202) "Use the Report Wizard to Quickly Create a Crosstab Report" (p. 204)

Use the Report Wizard to Quickly Create a Crosstab Report


Steps
1. If you just started Impromptu and the Welcome dialog box is open, click Create a Standard Report. Otherwise, click New from the File menu, select the Crosstab template, and click Wizard. 2. If the catalog is not open, open and log on to the catalog you want. 3. Type a title for your report, and click Next. 4. Click Crosstab Report, and follow the instructions in the Report Wizard. The Report Wizard creates a crosstab report using the information you provide.

More Info Notes


You must enter one data item into the Rows area, one data item into the Columns area, and one data item into the Cells area of a crosstab report. When you add a data item to the Cells area, Impromptu automatically summarizes the item. For example, Sale Amount becomes Total Sale Amount, and Product becomes Count Product. If you drag the item from the Cells area back to the Rows or Columns area, it remains summarized. To return to the original data item, select the item and edit its data definition.

204 IBM(R) Cognos(R) Impromptu(R)

Chapter 25: Create a Report When you create a crosstab report using the Report Wizard, only three data items can be entered in the Cells area of the crosstab. BLOB columns do not appear in a crosstab report. You can drag and drop only one data item at a time when working with folders in the Report Wizard.

What if ...
You want to create a new report using a different catalog? From the Catalog menu, click Close, and then create a new report. You are prompted to open a catalog. You want to quickly save a report to the User Workspace folder? Click the FastFind button in the Save As dialog box, and then save your report.

Related Topics
"Create a Crosstab Sub-Report" (p. 208) "Create a Report" (p. 201) "Open a Catalog" (p. 202) "Use the Report Wizard to Quickly Create a List Report" (p. 203)

Use a Template to Quickly Create a Report


Description
Templates can save you time and effort when you create new reports. Templates are particularly useful when you frequently create the same type of reports. The template you use may contain placeholders. Four types of placeholders can appear in a template: optional single-column optional multi-column required single-column required multi-column You can skip or fill in optional placeholders. You must fill in required placeholders. You can fill in a single-column placeholder with one data item from the catalog and you can fill in a multi-column placeholder with at least one data item from the catalog.

Example
You use a template to create mailing labels. The template contains placeholders for Contact Name, Contact Title, Company, Street, City, State, and Zip Code. The Contact Title is an optional placeholder and the Street placeholder is a multi-column placeholder. You fill in the contact's name, but you don't know the title for the contact person so you skip the contact title placeholder. To include both a street address and a suite number, you fill in the placeholder Street with two data items: Street and Suite Number.

Steps
1. If you just started Impromptu and the Welcome dialog box is open, click Create a Report Using a Template. Otherwise, click New from the File menu. 2. Select the template you want to use, and click OK. If the current folder does not contain the template you want to use, select another folder. If you do not have a catalog already open, the Open Catalog dialog box appears, where you can locate and select the catalog to use. 3. In the Catalog box (Data tab), select one or more data items from the folders. Data item icon 4. Click the right arrow button to add the selected data items to the Query Data box.

Administration Guide 205

Chapter 25: Create a Report Add button 5. Repeat steps 3 and 4 until you have added all the data items you want, and click OK.

More Info Notes


All required placeholders appear in bold type and must be filled in. When you use a template to create a crosstab report, you must fill in at least one row placeholder, one column placeholder, and one cell placeholder. Placeholders only accept data items of the same data type.

If a placeholder accepts only one data item, the placeholder is unavailable once you fill it in. You can drag and drop only one data item at a time when working with folders. If the catalog was created with a previous version of Impromptu, see "Upgrade a Catalog or Report" (p. 203). You can only expand placeholders in the Data tab. Selecting the Blank template (in the New dialog box) allows a user to create a report with no template. Impromptu automatically creates the Blank entry in the New dialog box, there is no Blank template file.

Tips
To quickly add a single data item to the Query Data box, double-click the data item in the Catalog box. It is automatically added to the next available placeholder of the same data type. If there are no available placeholders of the same data type, the data item is put at the end of the list. To quickly fill in placeholders, drag a data item from the Catalog box and drop it onto a placeholder in the Query Data or Placeholders box (Report Wizard). The placeholder accepts the data item if it is of the same data type. If the placeholder is of a different data type than the data item, the data item fills the first available placeholder of the same data type. If no placeholders are of the same data type, the data item is put at the end of the list.

What if ...
You want to use the same template with a different catalog? From the Catalog menu, click Close and then create a new report. No data appears in your report after you have selected the data items in the Query dialog box? You are using the Blank template. This template is for creating customized reports. Select a different template. The data item you add to the Query Data box is appended to the end of the placeholder list instead of filling in a placeholder? There was no available placeholder of the same data type as the data item. This data item appears in the report. You want to remove a data item from a placeholder? Select the data item in the placeholder and click Remove. You want to quickly save a report to the User Workspace folder? Click the FastFind button in the Save As dialog box and then save your report.

206 IBM(R) Cognos(R) Impromptu(R)

Chapter 25: Create a Report

Related Topics
"Create a Report" (p. 201) "Apply a Template to an Existing Report" (p. 247)

Import a Query from IBM Cognos Query


Description
You can import a query from IBM Cognos Query using the default template as set in the File Locations tab of the Options dialog box. You can only import queries from IBM Cognos Query version 6.0 and above. When you import a query, a log file called CognosQueryImport.log is created. To set the location of this log file, specify a folder in the IBM Cognos Query Log File Location box in the File Locations tab of the Options dialog box.

Tips
To avoid confusion when importing IBM Cognos Query (.cq) files, select a catalog that was created from the same Architect package that the query was created with. To set the title of the report from the imported .cq file, ensure that the default template has Text Frame named "Title". To control the format of the report resulting from the imported .cq file, change the default template for Impromptu or change the primary frame for the default template. All the calculations and columns from the default template will be added to the primary frame of the default template.

Steps
1. Open Impromptu. 2. From the Tools menu, click Import IBM Cognos Query. The Import IBM Cognos Query dialog box appears. 3. In the IBM Cognos Query Filename box, specify the IBM Cognos Query file (*.cq) to import into Impromptu and click Open. 4. In the Catalog Location box, specify file name of the catalog and click Open. The file name of the catalog must match the name specified in the IBM Cognos Query file. For example, if the query file contains the entry catalog=salesdb, then the catalog file name must be salesdb.cat. 5. Click Import. When the query is successfully imported, a dialog box appears that shows the number and type of information messages generated and that prompts you to open the import log file. 6. View your Impromptu report.

Related Topics
"Drill Through to IBM Cognos Query" (p. 281)

Use a Report in Another Report


Description
Like HotFiles, columns and tables from Impromptu reports can be added as data items to another report. You can use any Impromptu report (except crosstabs) as a data source for another report as long as both reports are from the same catalog. Reusing reports was introduced to support stored procedures as a second report is required to apply formatting to the data returned from the database. However, reusing reports need not be limited to stored procedures. Note: You can only use a stored procedure report in another report if it has been run at least once and it returns a result set.

Administration Guide 207

Chapter 25: Create a Report Reusing reports saves you time when building queries, but may cost processing time because the result set of the reused report is locally cached when you execute the current query.

Steps
1. Open a new report or an existing report. 2. Open the Query dialog box and click the Data tab. 3. In the Data Source box, click HotFile and then browse to directory containing the report to reuse. 4. Click OK. The report to reuse is shown in the Report Directory box. 5. Double-click the report folder to expand it and then select the data items for the current report.

Related Topics
"Create a Report" (p. 201)

Create a Crosstab Sub-Report


Description
Impromptu supports crosstab sub-reports. You can have a main query and several crosstab sub-reports in the same report. You can convert list frame sub-reports to crosstab sub-reports the same way you convert list frames to crosstabs: pivot a column and click the Build Crosstab button in the Query dialog box. You can't drag crosstab sub-report columns into another crosstab. Other drag-and-drop actions are allowed, including dragging columns into the same crosstab sub-report or dragging columns from another frame into the crosstab sub-report. You can only link the crosstab sub-report query to the main query in the crosstab detail and crosstab summary filters.

Steps
1. Open a report that has at least one query. 2. From the Insert menu, click Sub-Report and then click Crosstab Frame to add a new crosstab sub-report.

Related Topics
"Create a Report" (p. 201) "Use the Report Wizard to Quickly Create a Crosstab Report" (p. 204)

Create Accessible Reports


We are committed to assisting people with disabilities, and promote initiatives that make workplaces and technologies accessible. For example, IBM Cognos Series 7 provides a report-reading solution for accessibility. This report-reading solution is currently available in English. In addition to the English report-reading solution, the Upfront Accessible theme can be read in English and French. To create reports accessible to disabled users, you must enable accessibility in Configuration Manager. There are also certain design considerations that you must apply when creating accessible reports. For more information, see the Impromptu Administration Guide.

Note
PDF documents that support software accessibility guidelines contain additional markup information that increases the size of the PDF file produced and, as a result, may impact performance. For more information about performance and accessibility, see the Planning Advanced Installations Guide.

208 IBM(R) Cognos(R) Impromptu(R)

Chapter 25: Create a Report

Related Topics
"Create a Report" (p. 201)

Retrieve Data from the Database


When you open a report or add data to a report, Impromptu automatically goes to the database and retrieves the data you require. You can turn automatic data retrieval off and manually retrieve data to improve performance.

Example
You are working with a large database. You want to re-order the report columns without waiting for Impromptu to retrieve the data each time you move one column. You turn the automatic data retrieval off, and re-order the columns in your report. Once you have finished, you manually retrieve the data from the database.

Steps
1. If automatic data retrieval is on, click Query from the Report menu and click the Access tab. 2. In the Query Options box, clear the Automatically Retrieve Data check box and click OK. 3. From the Report menu, click Retrieve. Impromptu updates the data.

More Info Note


Impromptu cycles through three steps when retrieving data. First, Impromptu prepares the data. Next, Impromptu scans the data for the best fit, and lastly Impromptu generates the report.

Tips
You can also turn off automatic data retrieval by clicking the Auto Retrieve button. When the button is not depressed, Auto Retrieve is turned off. To add the Auto Retrieve button to the toolbar, click Toolbars from the Tools menu. From the Categories box, select Report. Click and drag the Auto Retrieve button onto the toolbar.

What if ...
You want to cancel data retrieval? The status line reflects the processes that Impromptu cycles through when retrieving data. When canceling a query is possible, the status line includes both a button on the left that lets you cancel the query, and a message stating that you can cancel the query by pressing the Esc key.

Related Topics
"Add or Remove Data" (p. 211)

Multiple Instances and Versions of Impromptu


You can open multiple instances of Impromptu, each operating independently of each other. Each instance can open the same catalog (or a different one). To avoid conflicts between instances using the same catalog, make changes to the catalog using the first instance of Impromptu that accesses it. When you open Impromptu, it recalls custom settings, such as toolbars and file locations, from the most recently closed instance. You can also install multiple versions of Impromptu on your computer at the same time. For example, you can install Impromptu 7.4 and an earlier version of Impromptu, or Impromptu 7.4 and a current or earlier OEM version of Impromptu. Use multiple versions of Impromptu to keep your existing version and test a newer version at the same time. The following change has been made to Impromptu to handle multiple versions.

Administration Guide 209

Chapter 25: Create a Report

Configuration Settings
Impromptu stores product configuration information in Cern.ini in the Bin folder where Impromptu is installed. The exception is database connection information which remains in Cognos.ini. In previous versions, information maintained in the Cognos.ini file could be overwritten by newly installed versions.

Related Topics
"Change the Number of Instances of Impromptu" (p. 210)

Change the Number of Instances of Impromptu


Description
By default, you can open multiple instances of Impromptu. With Impromptu set to multiple instance you can have reports from two different catalogs open at once. You can also execute more than one query at a time. However, you may want to set Impromptu to single instance. For example, if you are running previous versions of macros that haven't been updated. Ensure you have closed all instances of Impromptu before changing this setting.

Steps
1. Close all instances of Impromptu. 2. From the Start menu, click Run. The Run dialog box appears. 3. To switch to single instance, in the Open box, type "<path name>\<executable>" /SI. - or To switch back to multiple instance, in the Open box, type "<path name>\<executable>" /MI. Here are two examples: "C:\Program Files\Cognos\Cer3\ImpUser.exe" /SI Switches to single instance for Impromptu User "C:\Program Files\Cognos\Cer3\ImpAdmin.exe" /MI Switches to multiple instance for Impromptu Admin Note: If you didn't install to the default location, type your path in the Open box. 4. Click OK. Now you can open the number of instances of Impromptu you want.

Related Topics
"Multiple Instances and Versions of Impromptu" (p. 209)

210 IBM(R) Cognos(R) Impromptu(R)

Chapter 26: Add or Remove Data


By default, when you add data items to a report, Impromptu adds them to the query and automatically marks them for insertion in the open report. You can add data items to a query without showing them in a report. This enables you to use data items in calculations and filters without them appearing in the report. Each time you make changes to a report, Impromptu automatically retrieves the data you require from the database. To save time when adding or removing data from a report, you can turn automatic data retrieval off. For more information, see "Retrieve Data from the Database" (p. 209).

What You Can Do


Within a report, you can add data items, calculations, and summary operations sort, group, and filter data to create concise and meaningful reports edit the names or definitions of data items, calculations, and summary operations to make them more relevant

Related Topics
"Add Data to an Existing Report" (p. 211) "Remove Data from a Report" (p. 212) "Group, Sort, or Associate Data in a Report" (p. 215)

Add Data to an Existing Report


Description
You can select data to include in a report at any time.

Example
You have a report that provides information on your customers. To include information about how they pay for their purchases, you add a data item called Payment Method.

Steps
1. From the Insert menu, click Data. 2. Click the mouse button at the position where you want to insert data. Impromptu shows the Data tab (Query dialog box). 3. In the Data Source box, do one of the following: To insert data from the catalog, click Catalog. To insert data from a HotFile or another report, click HotFile. 4. Double-click the folders to open or close them. 5. Double-click each data item you want to add. 6. Repeat steps 4 and 5 until you add all the data items you want to add to your query. By default, the new data items are marked for insertion into the report. A data item that is marked for insertion is identified by the following icon in the Query Data box: Marked Data icon 7. Click OK. Impromptu inserts the data items that are marked for insertion into the report.

Administration Guide 211

Chapter 26: Add or Remove Data

More Info Notes


If you insert data into a text frame, Impromptu adds it at the beginning of the text frame in the order the data items appear in the Query Data box. If you insert data into a form frame, Impromptu adds it a the position where you clicked the mouse button. If you insert data into a list frame, Impromptu adds it a the position indicated by the highlighting. If you insert data into chart frame, Impromptu adds it into the list of data items for the chart frame. To add the new data items, click Properties from the Format menu and click the Data tab (Format dialog box). Select a data item in the Query Data box and depending on where you want the data item to appear, click the add arrow next to the Primary Axis, Secondary Axis, or Measure(s) box. The data item appears in the Chart Data box. If the space between two adjacent columns is highlighted, or if a data cell is highlighted, then Impromptu adds the data item as a new column. If a data cell in the group header or footer is highlighted, then Impromptu adds the data item to the header or footer. If you position the pointer over a header or footer, then Impromptu adds the data item to that header or footer. If you insert a large amount of data into a text frame, set the height of the frame to size dynamically so that the text frame spans pages when the text exceeds a single page.

Tip
To quickly add data items to a report, click the Data button and click the report. Data button

Related Topics
"Add or Remove Data" (p. 211)

Remove Data from a Report


Description
You can remove data items from a report or from the report query. When you remove data items from the report, it is still available in the query. You can add the data item from the query back into the report at any time. If you remove a data item from the report query, you have to add it back into the query and retrieve the data again to show the data in the report at a later time.

Example
You remove simple calculations such as totals that become redundant once you create more complex calculations, such as totals by branch and salesperson.

Steps to Remove Data from a Report


1. Select the data item. 2. From the Edit menu, click Delete. Note: You can also use the Cut command (Edit menu) to remove a data item from a report.

Steps to Remove Data from a Report Query


1. From the Report menu, click Query, and click the Data tab. 2. Select the data item you want to remove from the Query Data box. 3. Click the Remove left-arrow button and click OK. Remove button

212 IBM(R) Cognos(R) Impromptu(R)

Chapter 26: Add or Remove Data

More Info What if ...


You change your mind and want to restore the data item to the report? Click the Undo button on the toolbar. Undo button You deleted a column from your report, but it still appears in the Query Data box of the Query dialog box? This column is retrieved from the database every time you open your report, but it is not included in the report. To include this column in your report, see "Add Data to an Existing Report" (p. 211).

Related Topics
"Add or Remove Data" (p. 211)

Administration Guide 213

Chapter 26: Add or Remove Data

214 IBM(R) Cognos(R) Impromptu(R)

Chapter 27: Group, Sort, or Associate Data in a Report


When you group data, Impromptu sorts the data item you are grouping and removes duplicate values. By associating a grouped data item to another data item, you can eliminate duplicate information from your report.

What You Can Do


You can define one or more data items in your report as grouped data items add group headers and footers change the grouping order for the grouped items generate summaries, such as subtotals, at each group level associate a grouped data item with another data item search for a specific data item

Associating Grouped Data Items


You can associate a grouped data item with any other data item that has a one-to-one relationship with that grouped data item.

Examples
You open an ungrouped report.

You group data by Customer Name so that you can easily view your data by customer. The customer names are sorted and the Customer Name appears once for all the entries in that group.

You suppress duplicate Customer Numbers by declaring Customer Number as an associated data item.

Administration Guide 215

Chapter 27: Group, Sort, or Associate Data in a Report

Grouping and Sorting


Impromptu sorts grouped data by default. You must remove grouping before you can remove sorting. You can sort on an associated data item, an ungrouped, or an unassociated data item at any time using the Sort tab (Query dialog box, Report menu).

Examples
You create a report with two data items: Customer Number and Customer Name. You group Customer Name. Impromptu sorts this grouped data by default. You then associate Customer Number to Customer Name, and sort Customer Number in descending order. Impromptu overrides the default sort on Customer Name and instead sorts on Customer Number in descending order. The default sort on Customer Name is lost.

If you group on Customer Name and you have the Order Number data item in the query, you can sort in descending order by Order Number. Impromptu sorts Order Number in descending order for each grouping of Customer Name. Customer Name, by default, is sorted alphabetically.

Note
Each time you make changes to a report, Impromptu automatically retrieves the data you require from the database.

Tip
To save time when you group or sort data in a report, you can turn automatic data retrieval off. For more information, see Retrieve Data from the Database.

Related Topics
"Associate Data to a Grouped Data Item" (p. 219) "Group Data" (p. 217) "Sort Data" (p. 218)

216 IBM(R) Cognos(R) Impromptu(R)

Chapter 27: Group, Sort, or Associate Data in a Report

Group Data
Description
You can organize your report by grouping on one or more data items.

Example

Steps
1. From the Report menu, click Query, and click the Group tab. Note: the Group tab is not available for crosstab reports. Crosstab reports are grouped automatically. 2. In the Group Order box, select the data items that you want to group. 3. Click Group. A black bar across the top of the data icon indicates a grouped data item. Grouped data item Note: The grouping priority of data is set by the order of the grouped data items in the Group Order box. 4. Click OK.

More Info Notes


When you group data, and grouping is done on your computer rather than by the database, text BLOBs disappear from the report. The Group button is unavailable if you ctrl-click more than one sub-report frame. To find out which frames in your report are sub-report frames, from the View menu click Boundary Lines. Impromptu groups crosstab reports automatically. All data items in the rows and columns are grouped, and data items in the cells are associated with the lowest-level data item in the columns.

Tips
To quickly group one or more data items, select the data items in the order that you want them grouped and click the Group button on the toolbar. Group button

Administration Guide 217

Chapter 27: Group, Sort, or Associate Data in a Report To change the group order, drag the grouped data items up or down in the Group Order box (Query dialog box) or click the Group and Associate buttons on the Group tab (Query dialog box, Report menu).

What if ...
You want to ungroup a data item in a report? Double-click the data item in the Group Order box that you want to remove from the group and click OK. You want to quickly remove all groups from a report? Press Esc to ensure nothing is selected in your report, click the Group button on the toolbar, and confirm that you want to delete all group items.

Related Topics
"Group, Sort, or Associate Data in a Report" (p. 215)

Sort Data
Description
By default, Impromptu does not sort data unless you sort or group the data item. You can sort data by characters in ascending order (a to z) or descending order (z to a) numbers in ascending order (0 to 10) or descending order (10 to 0) dates, from the earliest to the latest date (1995 to 1999) or from the latest to the earliest date (1999 to 1995)

Example
To make your report easier to understand, you sort on Customer Name in ascending order to list the customers in alphabetical order from A to Z.

Steps
1. From the Report menu, click Query and click the Sort tab. 2. Select one or more data items. 3. Click Ascending or Descending to specify the sort order. A small Ascending or Descending icon appears beside the data item you want to sort. Ascending icon Descending icon Note: The order of the data items in the Sort Order box determines the sort priority of the data items. 4. Click OK.

More Info Note


The Sort Ascending and Sort Descending buttons are unavailable if you ctrl-click more than one sub-report frame. To find out which frames in your report are sub-report frames, from the View menu click Boundary Lines.

Tips
To quickly sort data in ascending order, select a data item and click the Sort Ascending button on the toolbar. Sort Ascending button To quickly sort data in descending order, select a data item and click the Sort Descending button on the toolbar. Sort Descending button

218 IBM(R) Cognos(R) Impromptu(R)

Chapter 27: Group, Sort, or Associate Data in a Report

What if ...
You dont want to sort certain data items? From the Report menu, click Query, and click the Sort tab. In the Sort Order box, select the data items that you don't want to sort, click Dont Sort and click OK. You want to quickly clear all sorting from data items? Press Esc to ensure nothing is selected in your report, click the Sort Ascending button or the Sort Descending button, and confirm that you want to delete all sorting from items. The Sort Ascending or Sort Descending button is not on your toolbar? To add a button to the toolbar, click Toolbars from the Tools menu. From the Categories box, select Report. Click and drag the toolbar button onto the toolbar.

Related Topics
"Group, Sort, or Associate Data in a Report" (p. 215)

Associate Data to a Grouped Data Item


Description
You can associate one or more data items with a grouped data item. An associated data item should have a one-to-one relationship with the grouped data item. For example, Order No. is a grouped data item. For each order number, there is an Order Date. Order No. and Order Date have a one-to-one relationship. You can associate a data item to a grouped data item to suppress duplicate information if you know that the associated data item repeats in every row of the grouped item.

Example

Steps
1. From the Report menu, click Query and click the Group tab. 2. Select the data item you want to associate to a grouped data item. 3. Click Associate. A black and white bar across the top of the data icon indicates an associated data item. Associated data item 4. Click OK.

Administration Guide 219

Chapter 27: Group, Sort, or Associate Data in a Report

More Info Notes


When you associate a data item, the data processing takes place on your computer. You can only associate a column with the last grouped column in the Group Order box. If you want to create an association with a different column, ungroup the columns, create the association, and then group them again.

Related Topics
"Group, Sort, or Associate Data in a Report" (p. 215)

220 IBM(R) Cognos(R) Impromptu(R)

Chapter 28: Filter or Find Data


Filtering Data
A filter is a set of criteria you apply to a report to change the focus of the report. You can use a filter to emphasize information that is important to you by filtering out what is unnecessary.

Example
You focus your report on the product lines that have the highest sales in Mexico. You design a filter for the report to show the Total Sales in 1995 for Mexico ...

... so that it shows only sales over 100,000.

What You Can Do


Use filters to retrieve data based on a data item in the report or on any data item in the catalog. For example, you can create a customer mailing list that shows just mail order customers. that falls between a range. For example, you can retrieve all the sales data that was collected between January and June of last year. based on summarized information. For example, you can retrieve information about branches with total sales exceeding $3,000. based on a previously calculated data item in the report or in the catalog. For example, you can retrieve information about product sales based on a complex exchange rate calculated in the catalog. based on a prompt that asks you to select the values on which to filter the report when you open or run the report. Each time you filter data in a report, Impromptu automatically retrieves the data you require from the database. To save time when filtering data in a report, you can turn automatic data retrieval off. For more information, see "Retrieve Data from the Database" (p. 209).

Finding Specific Data


You can find the next occurrence of a specified value in your report. For example, you use a filter to find the next occurrence of "Los Angeles" in a customer address list, then the next, and so on. This is useful when you want to locate a specific value without removing data from the report.

Administration Guide 221

Chapter 28: Filter or Find Data

Related Topics
"Filter a Report Using a Filter Stored in the Catalog" (p. 224) "Filter Using Crosstab Titles" (p. 225) "Find Specific Data in a Report" (p. 226) "Quickly Filter Data Using the Filter Button" (p. 222) "Quickly Filter Data Using the Filter Drop-down Button" (p. 223)

Quickly Filter Data Using the Filter Button


Description
You can quickly filter the data in a report by selecting one or more values and clicking the Filter button on the toolbar. When you select values from the same row, such as Environmental Line and Telephone Sales, your report shows only the data that contains both of these values. When you select values from the same column, such as Telephone Sales and Mail Sales, your report shows data that contains either of these values.

Example
You have a report that lists the Product and Price. You select tent in the Product column and $500 in the Price column and click the Filter button. The report shows only tents with a price of $500.

Steps
1. Select one or more values in the report. 2. Click the Filter button. Filter button Impromptu retrieves only the data based on the values you selected.

More Info Notes


You can use the Filter button on the toolbar to eliminate rows based on values from one or more columns in the existing report the Filter drop-down button on the toolbar to define a filter a predefined catalog condition that you access from the Filter tab (Query dialog box, Report menu) the Filter tab (Query dialog box, Report menu) to create complex expressions You can also define a filter using the Report Wizard or the Filter drop-down button. For information about using the filter drop-down button, see "Quickly Filter Data Using the Filter Drop-down Button" (p. 223). The Filter button is unavailable if you Ctrl+click more than one sub-report frame. To find out which frames in your report are sub-report frames, from the View menu click Boundary Lines.

What if ...
You want to remove all filters from a report? Press Esc to ensure that nothing is selected in your report, click the Filter button on the toolbar, and confirm that you want to delete the existing filters.

Related Topics
"Filter or Find Data" (p. 221)

222 IBM(R) Cognos(R) Impromptu(R)

Chapter 28: Filter or Find Data

Quickly Filter Data Using the Filter Drop-down Button


Description
You can quickly filter the data in a report by selecting one or more values in a report and using the Filter drop-down button.

Example
You have a report that lists Customer Name, Order Date and Total Sales. You click the Filter drop-down button and select Between to filter the report so that it shows only the sales that took place within the last six months.

Steps
1. Select one or more values in a column. 2. Click the Filter drop-down button. A drop-down menu appears.

3. Select a filter operator from the drop-down menu. To filter on the selected values, click In. To filter out the selected values, click Not In. To filter the selection on a given range, click Between. To filter out the selection on a given range, click Not Between. To filter the selection based on one or more values, click an operator such as =, <, < , <=, , =. Note: The contents of the Filter drop-down menu vary depending on the selection you made in step 1. 4. Position the cursor over the arrow that appears at the right of the drop-down menu. A fly-out menu appears.

5. From the fly-out menu that lists available options, do one of the following: To filter a report on one or more data items currently highlighted, click Selection. To enter one or more numbers upon which to filter, click Number. To select from a list of values upon which to filter, click Select Values. To enter one or more text strings upon which to filter, click String. To enter one or more dates upon which to filter, click Date. To enter one or more times upon which to filter, click Time.

Administration Guide 223

Chapter 28: Filter or Find Data To enter a date and time variable upon which to filter, click Date-time. To enter one or more intervals upon which to filter, click Interval. Note: The contents of the Filter fly-out menu vary depending on the selection you made in step 1. 6. If you chose Selection, the filter is automatically applied to the report Select Values, the Select Values dialog box appears, where you can choose from all the values for the selected data item any of the other options, the Enter Values dialog box appears, where you can enter or select the required value or values and click OK

More Info Notes


You can also define a filter by using simply the Filter button. For information about using the Filter button, see "Quickly Filter Data Using the Filter Button" (p. 222). The Filter button is unavailable if you ctrl-click more than one sub-report frame. To find out which frames in your report are sub-report frames, from the View menu click Boundary Lines.

Tips
To select two or more data items not found next to each other, select one data item and Ctrl+click to select the other data items. To remove all filters from a report, press Esc to ensure that nothing is selected in the report, click the Filter button on the toolbar, and confirm that you want to delete existing filters.

What if ...
You only see Filter Definition when you click the Filter drop-down button? Nothing in your report is selected, you have selected an entire column, or you have selected values from different columns upon which to filter. You can use Filter Definition to create a custom filter. Your report data disappears when you filter between two values you have entered manually? The first number you entered in the Enter Values dialog box is greater than the second number. Ensure that the first number is less than the second number.

Related Topics
"Filter or Find Data" (p. 221)

Filter a Report Using a Filter Stored in the Catalog


Description
You can filter a report using a predefined filter in the catalog. A predefined filter is a condition created by your administrator or someone else in your company, and stored in the catalog. When you use a predefined filter, Impromptu retrieves the information that meets the criteria expressed by this filter condition. Predefined filters save you time when you filter a report, because they define frequently-used or complex expressions. Filter conditions appear with the other data items in the catalog. You can recognize a filter condition by the filter symbol in front of its name. Filter symbol

Example
You open a report called Order Details that lists Customer Name, Order Number, Order Date, and Closed Date. You want a list of all the sales that were not closed on time so that you can determine the reasons for the delays. From the catalog, select a predefined filter condition called Sales Closed Late.

224 IBM(R) Cognos(R) Impromptu(R)

Chapter 28: Filter or Find Data

Steps
1. From the Report menu, click Query and click the Filter tab. 2. In the Available Components box, double-click Catalog Columns. 3. In the Catalog dialog box, double-click the folders until you locate the required predefined filter condition. A filter symbol in front of the filter name identifies a predefined filter condition. Filter symbol 4. Select the filter condition and click OK. The selected filter condition appears in the Filter Definition box. You can use the filter condition on its own or you can add to it. 5. Click OK.

More Info Notes


You can retrieve unique rows of data by clicking the Eliminate Duplicate Rows check box in the Filter tab (Query dialog box, Report menu) to filter out repetitive information in the database. You can run a report without its filter by clicking the Suspend the Filter check box in the Filter tab (Query dialog box, Report menu) to retrieve data for your report without applying a filter.

What if ...
You want to remove all filters from a report? Press Esc to ensure that nothing is selected in your report, click the Filter button on the toolbar, and confirm that you want to delete the existing filters.

Related Topics
"Filter or Find Data" (p. 221)

Filter Using Crosstab Titles


Description
You can select a crosstab title and create a filter for it using the Filter button. If you selected a crosstab column title when you created a filter, the filter is applied as a detail filter. If you selected a crosstab cell when you created a filter, the filter is applied as a crosstab detail filter or the crosstab summary filter, depending on whether the selected cell shows detail or summary values. The Filter button is available if all of the following conditions are true: All selected titles are titles for columns that contain data from the database, not metadata. In the example below, you can use the Filter button on the Camping Chain title but not on the Product Type title, because the Camping Chain column contains data from the database (from the Customer Type table) while the Product Type column is metadata. All selected titles belong to the same layer in the column titles. In example below, you can use the Filter button on both the Fresh Air Co 1 and 2 titles together, but not on the Camping Chain and Fresh Air Co 1 titles together because they do not belong to the same layer. Only crosstab titles are selected.

Administration Guide 225

Chapter 28: Filter or Find Data

Steps
1. Open a crosstab report. 2. Select the crosstab titles you want. 3. Click the Filter button and create your filter.

Related Topics
"Create a Crosstab Sub-Report" (p. 208) "Filter or Find Data" (p. 221)

Find Specific Data in a Report


Description
You can quickly find a specific value in your report when you need to locate an individual record.

Example
You have a multi-page report that details customer names and mailing addresses. You want to locate each occurrence of "Los Angeles" without removing the rest of the data from the report. You find the first occurrence of "Los Angeles", and then move to the next occurrence using the Find Next command. If you want to search across the entire report, ensure that your report is in Screen Layout view. If your report is in Page Layout view, Impromptu searches only the current page of the report.

Steps
1. Select a value in a list. Note: If you do not see the value you want, select any value to open the Find dialog box. 2. From the Edit menu, click Find. If you are in Page Layout view, the Edit menu command is Find (on this page). 3. In the Find What box, type the value you want to find. 4. Do any of the following: If you want the value in the Find What box to match whole words only, click the Match Whole Word Only check box. If you want to match the case of the value in the Find What box, click the Match Case check box. 5. Click the Up or Down option button to determine the direction of the search. 6. Click Find Next. Each time you repeat step 6 or use the Find Next command (Edit menu), Impromptu scrolls through the report, finding the next occurrence of the specified value.

Note
To search an entire report, ensure that you are in Screen Layout view. In Page Layout view, your search is limited to the current page.

226 IBM(R) Cognos(R) Impromptu(R)

Chapter 28: Filter or Find Data

Related Topics
"Filter or Find Data" (p. 221)

Copy, Cut, and Paste in the Expression Editor


You can cut, copy, and paste expressions from one expression editor and paste them into another. This is a convenient way to generate expressions and is useful when you create filters for reports. You can copy a report filter from one source report and paste it into other reports, with changes if required. For example, you can cut a filter from the Filter Definition box of the Filter tab (Query dialog box) and paste it into the Expression box of the Calculation Definition dialog box. Select an expression and then cut, copy, and paste using the standard Windows shortcuts, or using a right-click menu. You can copy and paste text from other applications into a constant value component such as character strings or dates. However, not all expression components can be copied and pasted into various expression editors. When it is inappropriate to paste, the Paste command is unavailable. Note: If you paste a reference to a column into the data definition of another column, using a database that doesn't contain the first column, the query will fail when you execute it.

Administration Guide 227

Chapter 28: Filter or Find Data

228 IBM(R) Cognos(R) Impromptu(R)

Chapter 29: Work with Summaries


Reports frequently require a summary of the data. With Impromptu, you can add summary data items to your report. For example, you can add a Total Sales Amount or a Running Total for Orders. While it is more efficient to add a summary data item when you create the query, you can also add a summary after you run the report.

What is a Summary?
A summary is a predefined calculation that takes one or more values, performs an operation on these values, and returns a value that summarizes the data. The summary always identifies the type of summary, such as total, and the name of the data item that you want to summarize. For example, Total (Sale Amount), Average (Product Margin). Summaries are also called aggregates.

Types of Summaries
You can create both simple summaries complex summaries

Simple Summaries
You create simple summary expressions using the Summary button. Summary button When you click the Summary button (Query dialog box) or Ctrl+click the Total toolbar button, the Summary dialog box appears. From this dialog box you can create many summaries, including total average count maximum minimum percentage

Example
A summary with the definition Total (Sales) calculates the total sales for each branch if you put it in the Branch footer:

It calculates the total sales for the country if you move it to the Country footer:

Administration Guide 229

Chapter 29: Work with Summaries

Why Use Summaries?


Use summaries to see a roll-up view of the data in your report or to perform exploratory analysis on the data.

Summaries and Association


A simple summary, such as total, average, and count, is a dynamic calculation that is automatically associated with its location. When you move a simple summary, the summary changes to reflects its new location. You can explicitly associate a summary with a group so that the value does not change when you move it from one place to another in a report. This is called fixed association. For example, if Total (Sales) is associated with the Country group, you can move the Total (Sales) to the footer of the City column and the value remains as the total sales for each country. Summaries that have fixed association include running-average running-count running-maximum running-minimum running-total standard deviation Each time you summarize report data, Impromptu automatically retrieves the data you require from the database. To save time when summarizing report data, you can turn automatic data retrieval off. For more information, see "Retrieve Data from the Database" (p. 209).

Related Topics
"Add a Total to a List Report" (p. 232) "Create a Summary" (p. 230) "Move a Summary to Another Location" (p. 233) "Use a Summary Stored in the Catalog" (p. 233)

Create a Summary
Description
You can create a summary that is a dynamic calculation that performs common calculations such as total, average, count, minimum, maximum, and percent of total. This type of summary is "smart" because it has a value that changes with its location.

Example
You want to know the total sales generated by each of your branch offices. You open a report that lists the Branches and the Sales for each branch. The Branch column is grouped. You create a summary that totals the sales for each branch.

Steps
1. From the Report menu, click Query. 230 IBM(R) Cognos(R) Impromptu(R)

Chapter 29: Work with Summaries 2. From the Catalog box (Data tab), select the column that you want to summarize. 3. Click the Summary button. Summary button 4. In the Summary dialog box, do one of the following Click... To Calculate... The total for the selected data items. Total The minimum value of the selected data items. Minimum The maximum value of the selected data items. Maximum The average of the selected data items. Average The count (number) of selected data items. Count The percentage of the total that the data item represents. Percentage Note: The buttons that are available in the Summary dialog box depend on the data type of the selected column. For example, if you select a column with character data, such as Products, the Total, Average, and Percentage buttons are not available. However, the Minimum, Maximum, and Count buttons are available. 5. Click OK. The summary appears in the Query Data box of the Data tab (Query dialog box). 6. Click OK. The summary appears in the report. If a summary is in the body of a list that is grouped, the summary is calculated for the lowest group in the list. If a summary is in a list group header or footer the summary is calculated for that group. If a summary is in a form frame with the scope of the form frame set to a group, the summary is calculated for that group. If none of the above are applicable, the summary is calculated for the entire report. You can move the summary to different areas of your report. See "Move a Summary to Another Location" (p. 233).

More Info Tip


To see the type of frame, click Boundary Lines from the View menu. Refer to the table in the Steps tab if you want to know where the summary appears in the report.

Administration Guide 231

Chapter 29: Work with Summaries

Note
When you create a summary report directly, summarization takes place on the server. When you create a summary report from a detail report, summarization may take place locally on your computer. You can also set the client/server balance (Access tab, Query dialog box) to limit local processing so that the summary is done using a separate database query. This is more efficient than processing summaries on your computer.

What if ...
You don't want totals in a report you created using the Report Wizard? Clear the Automatically Generate Totals check box on the Grouping page of the Report Wizard. You want to remove a summary from the report or the query? You can remove a summary from the report or query in the same way that you remove any other data item. For more information, see "Remove Data from a Report" (p. 212).

Related Topics
"Move a Summary to Another Location" (p. 233) "Work with Summaries" (p. 229) "Use a Summary Stored in the Catalog" (p. 233)

Add a Total to a List Report


Description
Reports frequently require a summary of the data. For example, you can add the Total Sales Amount for each Product in your list report.

Steps
1. Select a column header, a column, or a value in an existing list report. 2. Click the Total button on the toolbar. Total button

More Info Note


If there is no grouping in the report, Impromptu puts the total in the list footer. If there is grouping in your report, Impromptu automatically creates footers (if they do not exist already) for every group in the report and inserts a group total into each footer.

What if...
You want to count the number of selected data items excluding blank cells? Select a column header, a column, or a value in the existing list report and click the Count button on the toolbar. Count button

Related Topics
"Work with Summaries" (p. 229)

232 IBM(R) Cognos(R) Impromptu(R)

Chapter 29: Work with Summaries

Use a Summary Stored in the Catalog


Description
You can use an existing summary that the administrator has stored in the catalog rather than creating your own summary. This saves you time and makes reporting easier. Each time you add the summary to a report, Impromptu calculates the value based on where you add the summary. If you add the same summary in three different locations (such as an overall list footer and two different levels of group footers), Impromptu automatically calculates the appropriate summary for each location. When you select a summary from the available catalog columns for a report, the icon looks like this:

You can tell that this calculation is a summary when you view the icon in the Group tab (Query dialog box, Report menu). The icon looks like this:

To insert a catalog summary into both a list footer and a group footer, add the summary data item twice to the Query data (once for each location in the report that requires the summary).

Example
You add the Average Sale Amount summary to the Query data and insert it into an overall list footer. Impromptu associates the summary with the list report and calculates an overall average. You move the Average Sale Amount summary into the Customer footer. Impromptu associates the summary with the Customer group and calculates the average Sale Amount for each customer.

Steps
1. From the Report menu, click Query and click the Data tab. 2. In the Catalog box, locate the summary calculation you want to use. 3. Double-click the summary calculation to add it to the Query Data box and click OK. The summary calculation is added to your report. The summary you inserted from the catalog is automatically associated with its location.

Related Topics
"Create a Summary" (p. 230) "Work with Summaries" (p. 229)

Move a Summary to Another Location


Description
Some types of summaries, such as total, average, count, maximum, minimum, percentage of total, percentile, and rank value, are affected by their location. When you move one of these summaries to another location, how the summary is calculated and its associated group changes.

Example
You move a data item from the Total (Sales) column to the list footer. The move changes the value from the Total (Sales) for the lowest group in the report to the Total (Sales) for the whole report.

Steps
1. Select the summary that you want to move. 2. Drag and drop the summary to the new location.

Administration Guide 233

Chapter 29: Work with Summaries Note: By default, a summary, such as total, average, count, maximum, minimum, percentage of total, percentile, or rank value, is automatically associated with its location and the value of the summary changes when it is moved to a new location. If the association of the summary is not automatic, the value of the summary does not change.

Related Topics
"Add a Total to a List Report" (p. 232) "Create a Summary" (p. 230) "Work with Summaries" (p. 229)

234 IBM(R) Cognos(R) Impromptu(R)

Chapter 30: Insert Text, Pictures, and Other Report Variables


To heighten the impact and appearance of your report, you can insert text, pictures, or other report variables into the header or footer of your report.

What You Can Do


You can add comments to an Impromptu report to clarify or stress aspects of your report. insert a picture. A picture can appear once or several times in a report and can be static or dynamic. Unlike a static picture, a dynamic picture is associated with a data item or calculation. The database must contain a data item that identifies the dynamic picture file. For example, you insert a dynamic picture of each product into your report. If the database is updated and the picture changes, your report will reflect this change. You can also insert static pictures such as a bitmap of the company logo at the top of every order. For an example of a report that contains both a static picture (the company logo) and a dynamic picture (the product picture), see the sample report Annual Product Sales supplied with Impromptu. use report variables to enhance your report. A report variable is a dynamic item such as the date, time, page number, and page count. Impromptu or your computer continually updates the report variables in your report. For example, you show the system date and time when the report is printed. Also, you include the page number and the total pages in your header or footer for quick reference.

Related Topics
"Format a Report" (p. 247) "Insert a Report Variable" (p. 239) "Insert a Static Picture" (p. 236) "Insert Text" (p. 235)

Insert Text
Description
You can add a comment or a title to your report to make it easier to understand. A comment can explain the source of the report data so that other people can easily understand your report, and a title can clarify the purpose and content of the report.

Steps
1. From the Insert menu, click Text Frame. 2. On the report, position the pointer where you want to locate the upper-left corner of the text. 3. While holding down the mouse button, drag the mouse diagonally to size the area where your text will appear, and release the mouse button. Impromptu shows a flashing I beam. I beam 4. Type or insert the text you want in your report.

Administration Guide 235

Chapter 30: Insert Text, Pictures, and Other Report Variables

More Info Tips


To quickly insert text, click the Text Frame button on the toolbar. Text Frame button To edit existing text, double-click the text until the flashing I-beam appears. Edit the text and click anywhere outside the text area. To have a text frame within a list frame span pages when the text exceeds a single page, set the height property to dynamic.

What if ...
You want to delete the text? Select the text so that the selection handles appear and press the Delete key. The text you insert repeats for every row in a list? The active report is based on a Simple List template, or the insert pointer was placed over the list when you clicked to insert text. When using the Simple List template you can only add text to the page headers or footers of the report, or you can modify existing text in the list by double-clicking the text.

Related Topics
"Insert Text, Pictures, and Other Report Variables" (p. 235)

Insert a Static Picture


Description
You can insert a picture and show any of the following image file formats that are stored in a location your computer can access: Windows bitmap file (.bmp) Joint Photographic Experts Group (JPEG or JPG) Portable Network Graphics (PNG) Device Independent Bitmap (DIB) A picture can appear once or repeatedly in a report. The picture can be static or dynamic. A dynamic picture is associated with a data item or calculation. The database must contain a data item that identifies the picture files.

236 IBM(R) Cognos(R) Impromptu(R)

Chapter 30: Insert Text, Pictures, and Other Report Variables

Example

Steps
1. From the Insert menu, click Picture Frame. 2. Position the pointer where you want to locate the upper-left corner of the picture. Your pointer changes to the following:

3. While holding down the mouse button, drag the mouse diagonally to size the picture, and then release the mouse button. The Source tab (Picture Properties dialog box) appears. 4. Click the Load From File option button. 5. In the Load From File box, locate and select the name of the image file that you want to appear in the picture frame. 6. Select the Make a Copy Within the Report check box. 7. Click OK.

More Info Notes


Use small footprint JPEG (Joint Photographic Experts Group) and PNG (Portable Network Graphics) image files for improved download performance in Web-based applications.

Tips
To paste a picture from another application, use the Copy and Paste commands. To quickly insert a picture, click the Picture Frame button on the toolbar. Administration Guide 237

Chapter 30: Insert Text, Pictures, and Other Report Variables Picture Frame button

What if ...
You want to update the picture? Clear the Make a Copy Within the Report check box (Picture Properties dialog box) You want to remove a picture from your report? Select the picture and press the Delete key. You want to resize a picture? Click the picture and, while holding down the pointer over one of the handles for the selected picture, drag to size the picture, and then release the mouse button. The static picture you insert repeats for every row in a list? The active report is based on a Simple List template, or the pointer was placed over the list when you clicked to insert the picture. When using the Simple List template, static pictures can only be added to the page header or footer, the list header or footer, or the group header or footer.

Related Topics
"Insert Text, Pictures, and Other Report Variables" (p. 235)

Insert Page Numbers


Description
Number pages in your reports to provide a point of reference when you are reviewing your printed report. You can insert page numbers into your report. For example, if you want the current page number to appear in the bottom-right corner of your report, you can insert the <Page Number> report variable into the right corner of the page footer so the page number repeats on every page. format page numbers in your report. For example, if you want the page number to be easier to read, you can make it bold, red, and 15 point size. remove page numbers from your report. For example, if you added a page number, and the final report was one page, you no longer need a page number.

Example
You set the current page number to show in the bottom-right corner of your report. You insert the <Page Number> report variable into the page footer so the page number repeats on every page.

Steps
1. From the Insert menu, click More Objects. 2. Select the Page Number report variable and click Insert. Your pointer changes to the following:

3. On the report, position the pointer where you want the upper-left corner of the page number and drag to size the area where the page number will appear.

More Info Notes


Page numbers should only be inserted in the Page Layout view. If you insert page numbers into a list, the page numbers are inserted as a column.

238 IBM(R) Cognos(R) Impromptu(R)

Chapter 30: Insert Text, Pictures, and Other Report Variables

Tips
To format page numbers, select the page number. From the Format menu, click Font, and select the font type, style, size, effects, and color. To remove the page numbers, select the page number and press the Delete key.

Related Topics
"Insert Text, Pictures, and Other Report Variables" (p. 235)

Insert a Report Variable


Description
You can insert report variables in your report to ensure that your report contains accurate dynamic information such as the date, time, page number, and page count. Report variables are continually updated in the report by your computer or by Impromptu.

Example
You are going to print a multi-page report.To ensure that all the pages are printed, and that the page sequence is clear, you include the page number and the total pages in the report footer.

Steps
1. From the Insert menu, click More Objects. 2. From the Available Objects box, select the report variable you want to insert in the report. 3. Click Insert. The pointer changes to a shape that corresponds to the report variable you are inserting. 4. On the report, position the pointer at the point where you want to locate the upper-left corner of the report variable, and drag to size the report variable. Note: When you insert a running page total, the Running Page Totals dialog box appears. Select the column you want to use in the running page total, and click OK.

More Info Notes


You can cut and paste, copy and paste, and drag and drop report variables within a single report or between different reports. If you paste a running page total variable into a text frame, the name of the running page total variable shown in the status line changes to the name of the text frame. For example, when you select the running page total variable inserted for Sales 2003, the status line shows "Running Page Total [Sales 2003]." If you paste the running page total variable into a text frame and select the variable, the status line shows the name of the text frame, not the name of the running page total variable. If you have not saved your report with a report name, then Impromptu uses the default report name (REPORT1). When you save the report and provide a name, Impromptu updates the report name. A running page total variable cannot be used in an expression or calculation. The system date variable is updated automatically each time you open or print a report. The <Date> format is based on your settings in the Data Format tab (Options dialog box, Tools menu). The system time variable updates automatically each time you open or print a report. The <Time> format is based on your settings in the Data Format tab (Options dialog box, Tools menu).

Tip
To format a report variable, right-click the variable, and click Format. In the Format dialog box, click the Font tab, select the font type, style, size, effects, and color that you want and click OK.

Administration Guide 239

Chapter 30: Insert Text, Pictures, and Other Report Variables

What if ...
You want to remove a report variable? Select it and use the Delete command (Edit menu). You remove a column with a running page total variable? The running page total variable is removed as well. You cannot see the running-total in a report? From the View menu, click Page Layout.

Related Topics
"Insert Text, Pictures, and Other Report Variables" (p. 235)

240 IBM(R) Cognos(R) Impromptu(R)

Chapter 31: Hide, Show, Group or Resize Parts of a Report


Hiding, Showing, or Unhiding Part of a Report
You can hide, show or unhide parts of a report at different times. Hiding parts of a report does not remove them from the report. The hidden parts of a report no longer show, however, you can continue to use them. For example, you can use the values for hidden data items in filters and calculations, and the data items still appear in the Data tab (Query dialog box). In a list report, you can hide, unhide or show headers and footers. This is useful when you want to concentrate on the report details and not view headings and summary information in headers and footers. individual columns. You can control the information that appears in the finished report. For example, you want the item Salary as the detail lines in an employee report, but you do not want the salaries shown when you distribute printed copies of the report to others so you hide the Salary data item.

Grouping Parts of a Report


You can group parts of a report so that they are treated as a single entity. This makes it much easier for you to show, hide, resize, or format the entire group at once without having to deal with the individual parts of a report one at a time. You can ungroup a grouped section at any time.

Resizing Part of a Report


You can resize part of a report to improve its overall appearance. There are several resize options you can use to format your report. You can use the mouse to resize areas of your reports or you can use the following resize options. Snap to Parent. You can snap a part of a report to match the size of its parent frame. For example, if you want to create a list that takes up the entire width and height of a page, use Snap to Parent. Dynamic Height. You can vary the height of part of a report based on the data using the Dynamic Height option. This option can only be used with text. Specify Width and Specify Height. You can set the exact width and height of a selected report part to meet your specific requirements. For example, you can specify a 3.5 in. x 5 in. (8.75 cm x 12.5 cm) area in the top left area for the customer address. Scan Data for Best Width and Scan Data for Best Height. You can size part of a report to fit the data using the Scan Data for Best Width or Height options.

Related Topics
"Group Parts of a Report" (p. 243) "Hide Part of a Report" (p. 242) "Resize Part of a Report" (p. 244) "Show Part of a Report" (p. 242) "Stack Parts of a Report" (p. 244) "Unhide Part of a Report" (p. 242)

Administration Guide 241

Chapter 31: Hide, Show, Group or Resize Parts of a Report

Hide Part of a Report


Description
Hiding parts of a report enables you to optimize the presentation of the report to maximize data analysis.

Example
You have many columns, in a list report but you want to compare the first and last columns. You hide all the columns in between and see the first and last columns side-by-side.

Steps
1. Select the row, column, picture, or report variable that you want to hide. 2. From the Format menu, click Hide.

More Info Note


Hiding any row in the detail lines of a list report hides all the detail rows.

Related Topics
"Hide, Show, Group or Resize Parts of a Report" (p. 241) "Show Part of a Report" (p. 242) "Unhide Part of a Report" (p. 242)

Show Part of a Report


Description
Showing hidden parts of a report makes them temporarily visible, but if you unhide parts of a report, they are shown permanently.

Example
In a list report you have several hidden columns. You show the hidden columns so that you can compare the values in the hidden columns.

Step
From the View menu, click Show Hidden. Any hidden parts of the report are now visible.

Related Topics
"Hide Part of a Report" (p. 242) "Hide, Show, Group or Resize Parts of a Report" (p. 241) "Unhide Part of a Report" (p. 242)

Unhide Part of a Report


Description
Unhiding parts of a report makes them permanently visible.

Example
In a list report you have three hidden columns, but you want to compare the first column with one of the hidden columns. You unhide the hidden column.

242 IBM(R) Cognos(R) Impromptu(R)

Chapter 31: Hide, Show, Group or Resize Parts of a Report

Steps
1. From the View menu, click Show Hidden to show all hidden parts of a report. 2. Select the hidden row, column, picture, or report variable. 3. From the Format menu, click Show. The part of the report you selected is no longer hidden.

More Info What if ...


You want to see parts of the report that are hidden? If you do not want to permanently change them from being hidden, click the Show Hidden command (View menu).

Related Topics
"Hide Part of a Report" (p. 242) "Hide, Show, Group or Resize Parts of a Report" (p. 241) "Show Part of a Report" (p. 242)

Group Parts of a Report


Description
When you group parts of a report, aligning and formatting is applied to the entire group, not just the individual parts of a report. You can align a grouped section of a report. For example, if you left-align a grouped section of a report, the entire group moves to the left of the report. The left-alignment is maintained even if you change the report page layout from landscape to portrait or vice versa. If you select parts of a report and align them without grouping them first, they align with each other, for example, Ctrl+click two text frames and then click Align Left. Apply a pattern or border to a group to emphasize important information in the report. You can maintain spacing between parts of a report by grouping them and moving the group as a single unit. You can remove one or more objects from a group or ungroup the entire group at any time. Note: Grouping parts of a report is not the same as grouping data.

Steps
1. Select the parts of the report you want to group. 2. From the Format menu, click Group Objects.

More Info Note


You cannot group two grouped sections together. However, you can add to a group by dropping a new object into the group form frame and you can remove from a group by dragging an object out of the group form frame.

Tip
To quickly select several parts of a report, such as a picture and a comment, Ctrl+click each part of the report.

What if ...
You want to ungroup one object in a group? Select that object and drag it outside the group form frame. You want to ungroup all objects in a group? Select the group form frame and, from the Format menu, click Ungroup. Administration Guide 243

Chapter 31: Hide, Show, Group or Resize Parts of a Report

Related Topics
"Hide, Show, Group or Resize Parts of a Report" (p. 241)

Resize Part of a Report


Description
You can resize parts of a report using the mouse. snap a part of the report to match the size of its parent frame. vary the height of part of a report based on the data using the Dynamic height option. This option can only be used with text. set the exact width and height of a selected report part to meet your specific requirements. size part of a report to fit the data by using the Scan Data for Best Width and Scan Data for Best Height options. align the width of the header and footer in a list report to the width of the report columns.

Steps
1. Select the part of a report you want to resize. 2. From the Format menu, click Size. 3. In the box indicating height or width, do one of the following: To match the size of the parent frame, click Snap to Parent. To vary the height of text frames depending on their content, click Dynamic Height. To set the exact height and width of part of a report, click Specify Height and Specify Width, and type the height and width you want. To size part of a report to fit the data, click Scan Data for Best Height. To align the header and footer to the width of the report column, click Snap to Columns. Note: The sizing options available depend on the type of object you select. 4. Click OK.

More Info Note


When you select a part of your report to resize, you will see a border with handles that you can drag to resize.

Related Topics
"Hide, Show, Group or Resize Parts of a Report" (p. 241)

Stack Parts of a Report


Description
Parts of a report can be stacked on top of the other.

Example
You use your company logo as the background for an existing report. You insert the bitmap and size it to fill the page and then place it behind the existing report.

Steps
1. Click the part of the report you want to stack. 2. From the Format menu, click Stacking, and click one of the following. Click Bring Forward to move on layer forward in the stack. Click Send Back to move one layer back in the stack.

244 IBM(R) Cognos(R) Impromptu(R)

Chapter 31: Hide, Show, Group or Resize Parts of a Report Click Bring to Front to move directly to the front of the stack. Click Send to Back to move directly to the back of the stack.

Related Topics
"Hide, Show, Group or Resize Parts of a Report" (p. 241)

Administration Guide 245

Chapter 31: Hide, Show, Group or Resize Parts of a Report

246 IBM(R) Cognos(R) Impromptu(R)

Chapter 32: Format a Report


There are many things you can do to enhance the format of your reports. You can assign data formats to numbers, characters, dates, times, date-times, and intervals. A data format applies pre-determined characteristics to the selected data items, that affect how they appear in your report customize data formats by editing the standard formats or by creating your own with the available format symbols. use conditional formats. change the font type, style, color, and size add colors, patterns, and borders to parts of a report resize part of a report apply a style to selected parts of a report stack text or graphics on top of each other to create special effects use the grid to position parts of a report Each time you make changes to a report, Impromptu automatically retrieves the data you require from the database. To save time when formatting a report, you can turn automatic data retrieval off. For more information, see "Retrieve Data from the Database" (p. 209).

Related Topics
"Add a Page Header or Footer" (p. 248) "Adjust Margins" (p. 249) "Align Parts of a Report" (p. 249) "Apply a Template to an Existing Report" (p. 247) "Format Data" (p. 253) "Insert Text, Pictures, and Other Report Variables" (p. 235) "Position Part of a Report Using Snap to Grid" (p. 250)

Apply a Template to an Existing Report


Description
A template contains placeholders and stores formatting information such as margin settings, page orientation, and font choices. If the template you are applying contains placeholders, Impromptu tries to match each placeholder to a data item in your report. If a match is found, Impromptu applies the data definition from the placeholder to the data item. When you apply a different template to a report, Impromptu automatically transfers all the formatting from the selected template to the report.

Example
There is a placeholder in the template with a currency format, and a data item in your report that is a number. They are both in the same position in the query (they are both the third item listed in the Query Data box in the Data tab of the Query dialog box). Impromptu applies the formatting from the placeholder to the data item. The data item in your report that is a number now appears in a currency format.

Administration Guide 247

Chapter 32: Format a Report

Steps
1. From the Report menu, click Apply Template. 2. Locate the template you want and click OK.

More Info Note


Impromptu does not apply any grouping, sorting, or filtering from the template to your report except when you apply the Grouped List template or the Grouped Crosstab template.

What if ...
You apply a template to a report that contains sub-reports? The template is only applied to the main report.

Related Topics
"Format a Report" (p. 247) "Use a Template to Quickly Create a Report" (p. 205)

Add a Page Header or Footer


Description
A page header appears at the top of every page, and a page footer appears at the bottom of every page. The page header and the page footer areas are separate parts of a report. A page header or footer can contain text pictures report variables calculations that contain summary values for the detail lines in the list

Example
You add a page header to show a company logo and a page footer to provide page numbers on every page.

Steps
1. From the File menu, click Page Setup and click the Page Setup tab. 2. Do one of the following: To insert a page header at the top of every page of the report, click Page Header. To insert a page footer at the bottom of every page of the report, click Page Footer.

3. Click OK.

More Info Note


Although you can insert page headers and footers in Screen Layout view, you can only see them in Page Layout view. When you print a report from Screen Layout view, the page headers and footers will print.

248 IBM(R) Cognos(R) Impromptu(R)

Chapter 32: Format a Report

Tips
To add data to a page header or footer, drag and drop data from the report into the header or footer. To remove a page header or footer, clear the check mark beside the Page Header or Page Footer item in the Page Setup tab (Report Properties dialog box).

Related Topics
"Format a Report" (p. 247) "Insert a Report Variable" (p. 239)

Adjust Margins
Description
Margins are the outer perimeters of your report. You can control how much space is on the top, bottom, left, and right of the report.

Example
You want to include white space on the report for writing notes. You set the left and right margins to 2 in. or 5 cm to provide space on either side of your report data.

Steps
1. From the File menu, click Page Setup. 2. Type values into the Margins boxes. 3. Click OK.

More Info Tip


To see the page margins, click Page Layout from the View menu.

Related Topics
"Format a Report" (p. 247)

Align Parts of a Report


Steps
1. Select the parts of the report that you want to align. 2. From the Format menu, click Align. 3. In the box indicating vertical alignment, do one of the following. Click Align Top Edge to align the selected report parts to the top edge and specify whether to align them to the top edge of the selection box or the top edge of the report. Click Align Center to align the selected report parts to the center and specify whether to align them to the center of the selection box or the center of the report. Click Align Bottom Edge to align the selected report parts to the bottom and specify whether to align them to the bottom edge of the selection box or the bottom edge of the report. Click Evenly Space to space the selected report parts evenly and specify whether to align them to the selection box or to the report. This option is only available when you select more than one part of a report. 4. Click the down arrow next to the box indicating horizontal alignment and do one of the following. Click Align Left Side to align the selected report parts to the left and specify whether to align them to the left edge of the selection box or the left edge of the report.

Administration Guide 249

Chapter 32: Format a Report Click Align Center to align the selected report parts to the center and specify whether to align them to the center of the selection box or the center of the report. Click Align Right Side to align the selected report parts to the right and specify whether to align them to the right edge of the selection box or the right edge of the report. Click Evenly Space to space the selected report parts evenly and specify whether to align them to the selection box or to the report. This option is only available when you select more than one part of a report. 5. Click OK.

More Info Note


You cannot align parts of a report in different group footers. For example, you cannot align a part of the report in a Product Type group footer with a part of the report in the Product Line group footer. You can, however, align parts of a report in a list header or footer to details in the report.

Tip
To quickly align selected report parts, click one of these buttons on the toolbar Align Left Align Right Align Center (Vertical) Align Center (Horizontal) Align Top Align Bottom

What if ...
You do not want to align parts of a report? Click No Alignment in the box for the vertical or horizontal alignment. None appears in the box indicating that no vertical or horizontal alignment is applied. The None option automatically appears when the selected report parts have conflicting alignment options. For example, if you select text in a list report and a rectangle, the None option appears.

Related Topics
"Format a Report" (p. 247)

Position Part of a Report Using Snap to Grid


Description
You can position parts of a report using a hidden grid. When Snap to Grid is enabled, you can move report parts in half-character jumps. This enables you to align report parts with precision. By default, Snap to Grid is enabled.

Steps
1. From the Tools menu, click Snap to Grid. Note: A check mark beside to the Snap to Grid command indicates that the option is selected. 2. Move a part of the report.

More Info Tip


To position a selected report part and maintain the current horizontal and vertical position, hold down the Shift key while positioning the selected report part. Impromptu moves the selected report part vertically or horizontally in a straight line.

250 IBM(R) Cognos(R) Impromptu(R)

Chapter 32: Format a Report

What if ...
You want to change the spacing between the grid? You can change the grid spacing by specifying the number of inches or centimeters between grid intervals. From the Tools menu, click Options, and click the General tab. Ensure that the Snap to Grid check box is selected. In the Grid Interval box, type the value for the spacing.

Related Topics
"Format a Report" (p. 247)

Administration Guide 251

Chapter 32: Format a Report

252 IBM(R) Cognos(R) Impromptu(R)

Chapter 33: Format Data


Description
The database from which Impromptu retrieves data for your reports contains several types of datanumeric, character, date, time, date-time, and interval. This data can be formatted using standard formats or custom formats you create. A data format applies pre-determined characteristics to the selected data items that affect how they appear. You can create new data formats by editing the standard formats or by creating your own formats using the available format symbols. A format symbol represents a value supplied by your database. For example, "MMM" is a format symbol that represents the month in a three-character form, such as "Jan". A variety of format settings are established when you install Windows or when you change the country selection. For example, the currency format can default to $ or depending on your default settings.

Steps
1. Select the columns or values that you want to change. When you format a value, the format is applied to all the values in that column. 2. From the Format menu, click Data. 3. Select a pre-set data format or create a custom data format using the available format symbols. To format Number data, see "Numeric Format Symbols" (p. 254). Character data, see "Character Format Symbol" (p. 255). Date data, see "Date Format Symbols" (p. 255). Time data, see "Time Format Symbols" (p. 256). Date-time data, see "Date-Time Format Symbols" (p. 257). Interval data in days or dates, see "Interval Format Symbols" (p. 258). You can specify different formats for positive and negative numeric values, zero values, and missing values. 4. Click OK. If you specify an invalid format, Impromptu shows #FORMAT# for the selected data items.

More Info Notes


If you use characters in your format other than those documented as format symbols, they must be surrounded by quotation marks or preceded with the backward slash symbol (\).

Tips
To quickly apply the currency format to numeric data, select a value or column, and then click the Currency button on the toolbar. Impromptu automatically applies the format to all values in the column in accordance with the default settings in the Data Format tab (Options dialog box, Tools menu). Currency button To quickly format columns or values, right-click the columns or values, and then click Format.

Related Topics
"Justify Data" (p. 258) Administration Guide 253

Chapter 33: Format Data "Enhance Data Display" (p. 259) "Using the Currency Symbol List" (p. 259)

Numeric Format Symbols


Format Symbols General Number Currency 0 Description Shows the numeric value in the General format. Shows the numeric value in the format set by the locale settings. For information about using the Number format, see (p. 262). Shows the numeric value with the currency symbol. For information about using the Currency format, see (p. 262). Shows the numeric value in the number of digits indicated in the format and, if necessary, adds zeros to the number to comply with the format. It rounds the number off if the data item has more significant digits to the right side of the decimal than the format specifies. For example, #.00 shows 8.9 as 8.90 and shows 8.912 as 8.91. Shows the numeric value in the number of digits indicated in the format but constrains the number of digits shown on the right of the decimal to the number of #s in the format. For example, ##.### shows 12.345678 as 12.345 and shows 123.45 as 123.45. Shows the numeric value in the number of digits indicated in the format but, if necessary, adds spaces on both sides of the decimal point so that decimal points align. For example, ?#.0? shows 1.23 (with a space before the 1) and 12.3 (with a space after the 3). Inserts a period. Inserts a comma. Inserts the currency symbol from your locale settings. For example, ## ###.##$ with "" selected as the currency symbol shows as 12345.67 as 12 345.67. Shows the number as a percentage with a percent sign. Shows the number in scientific notation. A negative sign before the exponent indicates a number less than one. The number of digits in the exponent is not constrained by the number of #s. For example, 12,500,000,000 shows 1.25E10. Skips the width of the next format character. Use this symbol to align positive numbers properly in numeric formats where negative values are indicated by parentheses. For example, the data format 0.00_) for positive numbers and (0.00) for negative numbers aligns both numbers on the decimal point as follows. (21753.00) 717.00 "" ' (apostrophe) Shows whatever is between the quotation marks. Shows the symbol as entered. When you return to the Format dialog box, you will see a backward slash to indicate that the apostrophe has significance as a format.

. (period) , (comma) $

% E-# E+# e-# e+# _ (underscore)

254 IBM(R) Cognos(R) Impromptu(R)

Chapter 33: Format Data

Format Symbols \

Description Shows the next character in the format. Use this symbol to treat a format symbol as a standard character. Enter two backward slashes to show a backward slash.

Character Format Symbol


Format symbol General - (hyphen) / : space ' Description Shows the character value in the General format. Shows the symbol as entered.

Shows the symbol as entered. When you return to the data formatting dialog box, you will see a backward slash to indicate that the apostrophe has significance as a format. Shows remaining characters in the string. Shows the next character in the format. Use this symbol to treat a format symbol as a standard character. Enter two backward slashes to show a backward slash. Skips the width of the next format character. Use this symbol to align positive numbers properly in numeric formats where negative values are indicated by parentheses. Shows a single character, uppercase. Shows a single character, lowercase. Shows one character, as is. Shows the rest of the string, as is. Skips this character. Shows whatever is between the quotation marks.

* \

_ (underscore)

A a @ @* | ""

Date Format Symbols


Format symbol General D DD DDD DDDD M MM Description Shows the date value in the format set by the locale settings. Shows the day of the week as one or two digits
(1-31).

Shows the day of the week as two digits (01-31). Shows the day of the week as a three-letter abbreviation (Mon). Shows the full name of the day of the week (Monday). Shows the month as one or two digits (1-12). Shows the month as two digits (01-12).

Administration Guide 255

Chapter 33: Format Data

Format symbol MMM MMMM YY YYYY - (hyphen) / : space '

Description Shows the month as a three-letter abbreviation (Jan). Shows the full name of the month (January). Shows the last two digits of the year (00-99). Shows all four digits of the year (1900-2100). Shows the symbol as entered.

Shows the symbol as entered. When you return to the Format dialog box, you will see a backward slash to indicate that the apostrophe has significance as a format. Shows the next character in the format. Use this symbol to treat a format symbol as a standard character. Enter two backward slashes to show a backward slash. Shows whatever is between the quotation marks.

""

Time Format Symbols


Format symbol General H Description Shows the time value in the General format. Shows the hour as one or two digits in 24-hour format (0-23). If the format includes the format symbols AM/PM, am/pm, A/P, or a/p, then H shows the hour as one or two digits in 12-hour format (1-12). HH Shows the hour as two digits in 24-hour format (00-23). If the format includes the format symbols AM/PM, am/pm, A/P, or a/p, then HH shows the hour as two digits in 12-hour format (01-12). M MM S SS SSS AM/PM am/pm A/P a/p - (hyphen) / : space Shows the minutes as one or two digits (1-59). Shows the minutes as two digits (01-59). Shows the seconds as one or two digits (1-59). Shows the seconds as two digits (01-59). Shows the milliseconds (000-999). Shows the time in 12-hour format, followed by AM (midnight to 11:59:59 AM) or PM (noon to 11:59:59 PM).

Shows the symbol as entered.

256 IBM(R) Cognos(R) Impromptu(R)

Chapter 33: Format Data Format symbol ' Description Shows the symbol as entered. When you return to the Format dialog box, you will see a backward slash to indicate that the apostrophe has significance as a format. Shows the next character in the format. Use this symbol to treat a character that has significance as a format literally. Enter two backward slashes to show a backward slash. Shows whatever is between the quotation marks.

""

Date-Time Format Symbols


Format symbol General D DD DDD DDDD M MM MMM MMMM YY YYYY H Description Shows the date-time value in the format set by the locale settings. Shows the day of the week as one or two digits (1-31). Shows the day of the week as two digits (01-31). Shows the day of the week as a three-letter abbreviation (Mon). Shows the full name of the day of the week (Monday). Shows the month as one or two digits (1-12). Shows the month as two digits (01-12). Shows the month as a three-letter abbreviation (Jan). Shows the full name of the month (January). Shows the last two digits of the year (00-99). Shows all four digits of the year (1900-2100). Shows the hour as one or two digits in 24-hour format (0-23). If the format includes the format symbols AM/PM, am/pm, A/P, or a/p, then H shows the hour as one or two digits in 12-hour format (1-12). HH Shows the hour as two digits in 24-hour format (00-23). If the format includes the format symbols AM/PM, am/pm, A/P, or a/p, then HH shows the hour as two digits in 12-hour format (01-12). M MM S SS SSS AM/PM am/pm A/P a/p Shows the minutes as one or two digits (1-59). Shows the minutes as two digits (01-59). Shows the seconds as one or two digits (1-59). Shows the seconds as two digits (01-59). Shows the milliseconds (000-999). Shows the time in 12-hour format, followed by AM (12:00AM to 11:59:59 AM), or PM (12:00 PM to 11:59:59 PM).

Administration Guide 257

Chapter 33: Format Data

Format symbol - (hyphen) / : space '

Description Shows the symbol as entered.

Shows the symbol as entered. When you return to the Format dialog box, you will see a backward slash to indicate that the apostrophe has significance as a format. Shows the next character in the format. Use this symbol to treat a format symbol as a standard character. Enter two backward slashes to show a backward slash. Shows whatever is between the quotation marks.

""

Interval Format Symbols


Format symbol D H HH M MM S SS SSS : . space "" Description Shows the number of days. Shows the hour as one or two digits in 24-hour format (0-23). Shows the hour as two digits in 24-hour format (00-23). Shows the minutes as one or two digits (1-59). Shows the minutes as two digits (01-59). Shows the seconds as one or two digits (1-59). Shows the seconds as two digits (01-59). Shows the milliseconds (000-999). Shows the symbol as entered. Shows the symbol as entered. Shows the symbol as entered. Shows whatever is between the quotation marks.

Justify Data
Description
You can enhance the appearance of your report by centering or aligning data items. By default, data items in numeric columns are right-aligned while all other data items are left-aligned. You can also specify that text wraps.

Steps
1. Select one or more data items in your report. 2. From the Format menu, click Properties and click the Layout tab. 3. Justify the data items to the left, center, or right by selecting the appropriate button in the Justification box. 4. To set how text wraps, do one of the following:

258 IBM(R) Cognos(R) Impromptu(R)

Chapter 33: Format Data To show text on a single line, click the Single Line option button. Text exceeding the width of the frame is not visible. To show text on multiple lines, click the Multi-Line option button. Text exceeding the width of the frame is not visible. To show text on multiple lines and wrap text inside the frame, click the Multi-Line with Word Wrap option button. Text wraps if it exceeds the width of the frame. 5. Click OK.

More Info Note


All values in a selected column are justified. For example, if you select a single value in a column and specify right justification, all the values in the column are right justified.

Related Topics
"Format Data" (p. 253) "Enhance Data Display" (p. 259)

Enhance Data Display


Description
You can enhance the appearance of your report by changing the font, font size, style and color of data in your report.

Steps
1. Select one or more data items in your report. 2. From the Format menu, click Font. The Format dialog box appears. 3. In the Font box, click a font. 4. In the Font Style box, click a font style. 5. In the Size box, click a font size. 6. To set text color, click Customize. 7. In the Color dialog box, click a color from the basic colors or define a custom color, then click OK. 8. In the Format dialog box, click OK.

More Info Tip


To quickly add color to data in a report, click the Color tool and set the color using the Color dialog box. Color Tool

Related Topics
"Format Data" (p. 253) "Justify Data" (p. 258)

Using the Currency Symbol List


You are provided a list of currency symbols in the Currency Symbol list to format numeric data. Currency formatting can be set independently of number formatting on a column-by-column basis. You can select an explicit currency symbol that persists with the data, or select the Default option. Default uses the currency setting defined by your locale.

Administration Guide 259

Chapter 33: Format Data You can change what currencies are listed in the Currency Symbol list. For more information see "Maintain Currency Symbols" (p. 260).

Steps to Use a Currency Symbol that Persists with the Data


1. With a report open, click a column with numeric values. 2. From the Format menu, click Data. 3. In the Positive box, click Currency. The Currency Symbol list is enabled. 4. In the Currency Symbol list, select a currency symbol, such as the euro. The data in the report shows the number values in the default number format with the currency symbol. This symbol persists with the data values when the report is distributed.

Steps to Use a Currency Symbol that Defaults to the Users Locale


1. With a report open, click a column with numeric values. 2. From the Format menu, click Data. 3. In the Positive box, click Currency. The Currency Symbol list is enabled. 4. In the Currency Symbol list, select Default. Default uses the currency setting defined by your locale. For more information about modifying locale settings, see the Configuration Manager User Guide.

Related Topics
"Format Data" (p. 253)

Maintain Currency Symbols


Description
You are provided a list of currency symbols that you can apply to numeric data. You can edit the Currency Symbol list by adding, deleting, and re-ordering currency symbols. To make changes to the Currency Symbol list, you must edit the XML file i18n_res.xml. The file is located in the directory installation_location\bin. The currency symbols that appear in the Currency Symbol list exist as elements in the i18n_res.xml file. Each currency element begins with the opening tag <currency> and ends with the closing tag </currency>. Nested within the currency element is a name element. The name element creates text that displays to the right of the currency symbol. It has the opening tag <name> and the closing tab </name>. Both the currency and name elements have attributes. To add, delete, or re-order symbols in the Currency Symbol list, you must edit these elements and attributes. Here is a sample of a currency element.
<currency code="CAD" symbol="$" ID="CAD"> <name lang="en">Canadian Dollar</name> </currency>

The list of currencies that shows in Impromptu is created as follows:


<currency_symbol> - <currency_description>

For example, $ - US Dollar The currency element attributes are: Attribute Code Description Standard ISO three letter currency code. It is recommended that you do not edit this value.

260 IBM(R) Cognos(R) Impromptu(R)

Chapter 33: Format Data

Attribute Symbol

Description Symbol displayed at the start of the list (on the left-hand side). This symbol can have multiple values, for example, $ and US$. However, each symbol value must have a unique identifier such as "USD" for $ and "USD1" for US$. Internal identifier. The ID value must be unique in the file.

ID

The name element has a single attribute. Attribute Lang Description Identifies the two letter ISO code for the language of the text. You can define multiple names for a single currency symbol. For example,
<name lang="en"> South Korea, won</name> <name lang="de"> Korea (Sd-Korea), Won</name> <name lang="fr"> Core du Sud, won</name>

Steps to Add a Currency Symbol


1. Open the i18n_res.xml file in Notepad. 2. Add a currency element using the following structure:
<currency code="currency_code" symbol="currency_symbol" ID="currency_id"> <name lang="language_code">Currency_description</name> </currency>

3. Define the currency element by adding values to the currency and name elements: in the name-value pairs, code="currency_code", symbol="currency_symbol", and ID="currency_id", replace placeholder text in quotation marks with specific values add a currency description For example,
<currency code="SGD" symbol="S$" ID="SGD"> <name lang="en">Singapore Dollar</name> </currency>

Most currencies are listed in the file but commented out. To display them, remove the "<!--" on the left-hand side. 4. From the File menu, click Save. To view the changes to the Currency Symbol list, restart the product.

Steps to Remove a Currency Symbol


1. Open the i18n_res.xml file in Notepad. 2. To delete a currency element, delete the currency opening tag <currency> and the closing currency tab </currency> tag and all the content framed by these tags. Note: To suppress the display of a currency element, without removing the entry from the file, insert the comment tag <!-- before the currency opening tag, and the comment tag --> after the currency closing tag. For example,
<!-- <currency code="ALL" symbol="Lek" ID="ALL"> <name lang="en">Lek</name> -->

3. From the File menu, click Save. To view the changes to the Currency Symbol list, restart the product.

Steps to Change the Order of Currency Symbols


1. Open the i18n_res.xml file in Notepad. 2. Select the currency element to move. Be sure to select the opening and closing currency tags <currency> and </currency>. 3. Cut the currency element and paste it in the new location in the currency symbol list. 4. From the File menu, click Save.

Administration Guide 261

Chapter 33: Format Data To view the changes to the Currency Symbol list, restart the product.

Notes
XML syntax is case-sensitive. the i18n_res.xml file is encoded in UTF-8. Ensure that you use an appropriate editor.

Tip
To avoid the loss of existing information, backup the currency symbol file before modifying the XML tags.

Related Topics
"Using the Currency Symbol List" (p. 259) "Format Data" (p. 253) "Justify Data" (p. 258) "Enhance Data Display" (p. 259)

Data Formats and Locale Settings


Data formats depend on the locale configuration settings for your IBM Cognos Series 7 product. By default, IBM Cognos Series 7 server products and IBM Cognos Impromptu use a data format configuration file named cerlocale.xml. IBM Cognos Architect, IBM Cognos Visualizer, IBM Cognos PowerPlay for Windows, and IBM Cognos Transformer use Windows Regional Settings for locale settings and data format information. However, these products can also be configured to use the data format configuration file. For information about managing data formats, copying data format information, or editing the data format configuration file, see the Configuration Manager User Guide, or contact your administrator.

Number and Currency Data Type Formatting


When you format numeric data, you can apply a custom format explicitly, or you can choose to format data with the Number or Currency options. If you use Number or Currency, the data format is set to the values retrieved from the cerlocale.xml file. For example, if you specify Number, the data items are formatted using the elements such as SDecimal, SThousand, and so on. If you use Currency, the data items are formatted using the elements such as SCurrency, SMonCurrencySep, SMonThousandSep, and so on. If you want, you can edit the cerlocale.xml file and change the default data formats. For information about managing data formats, copying data format information, or editing the data format configuration file, see the Configuration Manager User Guide, or contact your administrator. For information about the impact of using the cerlocale.xml file with existing reports, see "Data Formats and Locale Settings" (p. 262). When Number and Currency are used, some rules apply. If the data type is float or double, the number of decimal places will be set to the value of IDigits (for number format) or ICurrDigits (for currency format) set in your cerlocale.xml file. If the data type is integer, small integer, packed decimal, or quad, the number of decimal places will be set to the column scale value set during database creation. If the scale is less than 0, the number of decimal places is 0. The maximum number of decimal places is 8. If the scale is greater than 8, the value is changed to 8. Number format is not rendered in scientific notation. Tip: To find the data type and scale of a number, in Impromptu Administrator version, from the Report menu, click Query, and then in the Profile tab, click Query columns.

262 IBM(R) Cognos(R) Impromptu(R)

Chapter 34: Add a Border Around Part of a Report


Description
You can add borders around part of a report to emphasize it, to create structure, or to improve the overall report appearance.

Example
You borders to part of a report and you specify colors for your borders.

Steps
1. 2. 3. 4. 5. 6. Select the part of a report you want to put a border around. From the Format menu, click Borders. From the Style box, select the type of line. Select the border lines for your border. To add color to the border, click Customize. In the Color dialog box, select the border color and click OK. The border color displays in the Color box. 7. Click OK.

More Info Note


For information about adding borders to list reports, see "Hide or Show Grid Lines" (p. 267).

Tips
To quickly add a single-line border around a selected part of a report, click the Borders button on the toolbar. Borders button To remove a border from a selected part of a report, click the Borders button on the toolbar. To quickly select several parts of a report, such as a picture and a comment, Ctrl+click each part of the report.

Related Topics
"Add Color or a Pattern to Part of a Report" (p. 263) "Change the Font" (p. 264) "Apply a Style to Part of a Report" (p. 265)

Add Color or a Pattern to Part of a Report


Description
You can enhance the appearance of a report by changing the background color of part of the report. You can also add patterns to selected parts of a report to emphasize important data. By mixing the foreground and background colors, you can create a range of patterns to use in your report.

Administration Guide 263

Chapter 34: Add a Border Around Part of a Report

Example

To make one column in your report stand out from the rest, you give it a pattern.

Steps
1. 2. 3. 4. 5. 6. 7. Select the part of the report that you want to change. From the Format menu, click Patterns. From the Pattern box, select a pattern. To select a foreground color, under Foreground:, click Customize. In the Color Dialog Box, select a color and click OK. To select a background color, under Background:, click Customize. In the Color dialog box, select a color and click OK.

More Info Tips


To quickly change the color of a selected part of a report, click the Pattern button on the toolbar. Pattern button Impromptu adds a 25% gray shading to the selected part of a report. To quickly remove patterns from selected parts of a report, click the Pattern button on the toolbar. To remove patterns from selected parts of a report, use the Patterns command (Format menu), and then click Transparent in the Patterns box. To print your report in black and white, use patterns instead of colors.

Related Topics
"Add a Border Around Part of a Report" (p. 263) "Apply a Style to Part of a Report" (p. 265) For information about conditional formatting, see Mastering Impromptu Reports.

Change the Font


Description
When you create a new report, Impromptu uses default font attributes for text. You can override these defaults and change the type, size, style, and color of the font.

Example
You show selected data items in boldface and increase the font size of selected text in a header.

264 IBM(R) Cognos(R) Impromptu(R)

Chapter 34: Add a Border Around Part of a Report

Steps
1. Select the text you want to format. 2. Click the appropriate formatting button on the toolbar to make the change. You can choose a font type, size, color, and any or all of three styles: bold, italic, and underline.

More Info Notes


If you are creating reports for others, use standard fonts available to all users. Impromptus minimum font size is 6. If you type in a lesser value and click OK, the text size remains unchanged.

Tips
To take advantage of additional font attributes or to make several changes at one time, use the Font command (Format menu). To change the default font for all new reports, use the Object Format tab (Options dialog box, Tools menu).

Related Topics
"Apply a Style to Part of a Report" (p. 265)

Apply a Style to Part of a Report


Description
You can apply a style to a selected part of a report. Use the convenience of styles to apply several pre-defined formats to your report in one step.

Example
You apply a style called "Sales Up" to summary data that represents an increase in sales for a given month. This style applies a specific font, font size, and color to the selected report part.

Steps
1. Select the part of the report to which you want to apply a style. 2. From the Format menu, click Styles. 3. From the Style box, select a style. The Style box contains several styles that come with Impromptu and any styles you have created. 4. Click Apply and then click Close.

More Info Note


You can apply more than one style to part of a report.

What if ...
You change your mind after applying a style? From the Style box, select None.

Related Topics
"Add a Border Around Part of a Report" (p. 263) "Add Color or a Pattern to Part of a Report" (p. 263) "Change the Font" (p. 264)

Administration Guide 265

Chapter 34: Add a Border Around Part of a Report

266 IBM(R) Cognos(R) Impromptu(R)

Chapter 35: Format a List or Crosstab Report


There are many ways to format a list report: "Hide or Show Grid Lines" (p. 267) "Select Parts of a List Report" (p. 268) "Move a Column" (p. 269) "Change a Column Title" (p. 270) "Change the Width of a Column" (p. 270) "Change the Height of a Row" (p. 271) "Add a Group or List Header or Footer" (p. 272) "Change the Height or Width of a List Header or Footer" (p. 273) "Keep Details and Group Headers (or Footers) Together" (p. 273) "Insert a Page Break in a List Report" (p. 274) There are several ways to format a crosstab report: "Select and Format Parts of a Nested Crosstab Report" (p. 274) "Set the Default Format for Crosstab Columns" (p. 276)

Hide or Show Grid Lines


Description
You can enhance the appearance of a list report by adding grid lines. Grid lines visually separate different areas in a report. You can show or hide grid lines around the outside edge of the detail area to show or hide the detail boundaries around the individual columns to show or hide the column boundaries around the individual rows to set the detail lines apart clearly from any grouped columns above and below group data items to show where group data values change in any combination of the preceding four grid line settings

Steps
1. 2. 3. 4. Select a cell, row, or column in the list. From the Edit menu, click Select Parent. Right-click the list, and select Format. Click the Grid tab and do one of the following: Click ... To add or remove ... An outline grid from the selected list frame. Outline The border above and below each group. Group

Administration Guide 267

Chapter 35: Format a List or Crosstab Report

Click ...

To add or remove ... Column grid lines. Impromptu adds a border around each column except the left-most and right-most columns. To add an outside border around the left-most and right-most columns, add an outline border in addition to the column border. Row grid lines.

Columns

Rows 5. 6. 7. 8. If you want to change the line style for the grid, select a new line style from the Style box. If you want to change the line color for the grid, click Customize. In the Color dialog box, select a new color, and click OK. In the Format dialog box, click OK.

Related Topics
"Format a List or Crosstab Report" (p. 267)

Select Parts of a List Report


Description
You can select a value, row, column, or entire list to perform actions such as changing format or properties applying a style adjusting size or position of items inserting a new data item copying items to the Clipboard moving items by dragging them to a new location sorting adding a summary operation

Step
Do one of the following: To select ... A single value Do the following: Select the value that you want within the list.

A row

Position the pointer over the left edge of the row that you want to select and click the mouse button.Your pointer changes to the following:

Select Row pointer

268 IBM(R) Cognos(R) Impromptu(R)

Chapter 35: Format a List or Crosstab Report To select ... A column Do the following: Position the pointer over the top edge of the column that you want to select and click the mouse button. Your pointer changes to the following:

Select Column pointer An entire list Headers and footers Click the mouse to the right of the right-most column. Click any part of the header or footer that is empty.

More Info Tips


To select a range of adjacent columns, select the first column you want in the range by positioning the pointer over the selected column title header. The pointer changes to a down arrow. Click to select the first column. Shift+click to select the last column you want in the range. Impromptu selects all the columns in between the two columns you selected. To select non-adjacent columns, select the first column by positioning and clicking the pointer over the column title header. Ctrl+click each additional column you want to select.

Related Topics
"Change the Height of a Row" (p. 271) "Change the Width of a Column" (p. 270) "Format a List or Crosstab Report" (p. 267) "Move a Column" (p. 269)

Move a Column
Steps
1. Position and click the pointer over the selected column title header. Your pointer changes to the following:

2. Drag the selection to the right or left. As you drag the column, Impromptu uses highlighting to indicate the columns new position. If two vertical lines appear between adjacent columns, then the column is inserted between the adjacent columns. If two vertical lines appear on the outer border of the first column, the column is inserted to the left of the first column. If two vertical lines appear on the outer border of the last column, the column is inserted to the right of the last column. 3. Release the mouse button when the column is in the correct position.

More Info Notes


You can also move a column by selecting a single data value in the column that you want to move and dragging the selection to the right or left. If you move a column to the top of the list, you create a crosstab.

What if ...
The pointer changes to the following when you move it over the column headers.

Administration Guide 269

Chapter 35: Format a List or Crosstab Report Column pointer You will create a crosstab report if you drop columns in the column headers.

Related Topics
"Change a Column Title" (p. 270) "Change the Width of a Column" (p. 270) "Format a List or Crosstab Report" (p. 267) "Select Parts of a List Report" (p. 268)

Change a Column Title


Description
You can change a column title so that it is more descriptive and meaningful.

Steps
1. Double-click the column title you want to change. 2. Change the text in the title. 3. When you finish editing the text, click anywhere outside the column title.

Related Topics
"Change the Width of a Column" (p. 270) "Format a List or Crosstab Report" (p. 267) "Move a Column" (p. 269) "Select Parts of a List Report" (p. 268)

Change the Width of a Column


Description
Impromptu sets the column width to the best fit based on the data in the column. You can also change the width of columns in a list to meet specific reporting requirements by using the mouse to drag-size the width of a column changing the column width using precise specifications

Example
To fit a list exactly within the boundaries of a specific paper size, you set the size of each column in the list to a specific value, such as 1 inch and 2.5 cm.

Steps to Change the Width of a Column


1. 2. 3. 4. Select any cell in the column that you want to resize. Position the pointer over one of the handles that controls the horizontal size of the cell. While holding down the mouse button, drag the handle until the cell is the size you want. Release the mouse button.

Steps to Change Column Width Using Precise Specifications


1. Select any cell in the column that you want to resize. 2. From the Format menu, click Size. 3. In the box indicating the width, do one of the following. To show the Width Measurement box, click Specify Width. You can enter a specific value for the column width. The unit of measurement depends on your current settings.

270 IBM(R) Cognos(R) Impromptu(R)

Chapter 35: Format a List or Crosstab Report To determine the best fit for the column based on a specified number of rows, click Scan Data for Best Width. In the Rows box, type the number of rows you want Impromptu to scan. 4. Click OK.

More Info Note


When you resize a cell to show multiple lines of text, the text in the cell does not wrap unless you set its properties appropriately. For information about setting properties, see "Justify Data" (p. 258).

Related Topics
"Change a Column Title" (p. 270) "Format a List or Crosstab Report" (p. 267) "Move a Column" (p. 269) "Select Parts of a List Report" (p. 268)

Change the Height of a Row


Description
By default, Impromptu sets the row height to the height of the largest text string, picture, or report variable in the detail lines. When you change the cell font, Impromptu automatically adjusts the row height. You can change the height of a row by sizing it with your mouse using precise specifications You cannot change the height of a single row in a list. When you change the height of one row, all rows in the report are changed to the same height.

Example
To fit a list exactly within the boundaries of a specific paper size, you set the height of each row in the list to a specific value such as 1.25 cm or 0.5 inch.

Steps to Change the Height of a Row


1. Select the largest vertical text string, picture, or report variable from the row. 2. Position the pointer over one of the handles that control the vertical size of the row. 3. While holding down the mouse button, drag the handle vertically until the text string, picture, or report variable is the height you want. 4. Release the mouse button.

Steps to Change the Height of Rows Using Precise Specifications


1. Select the largest vertical text string, picture, or report variable from the detail lines of the list. 2. From the Format menu, click Size. 3. In the box indicating the height, do one of the following. To show the Height Measurement box, select Specify Height. You can enter a specific value for the row height. The unit of measurement depends on your current settings. To determine the best fit for the row based on a specified number of rows, click Scan Data for Best Height. In the Rows box, type the number of rows you want Impromptu to scan. To set the height of each row based on the contents of the cell you selected in step 1, select Dynamic. 4. Click OK.

Administration Guide 271

Chapter 35: Format a List or Crosstab Report

More Info Note


When you resize a cell to show multiple lines of text, the text in the cell does not wrap unless you set its properties appropriately. For information about setting the text properties, see "Justify Data" (p. 258).

Related Topics
"Change the Width of a Column" (p. 270) "Format a List or Crosstab Report" (p. 267) "Select Parts of a List Report" (p. 268)

Add a Group or List Header or Footer


Description
You can enhance the appearance of a list as well as highlight grouped data by adding headers and footers to a list. You can add or remove the following headers or footers at any time: List header and footer. They appear at the top and bottom of a list, and have a default height of one row (about 1 cm or .39 inches). You can change this height. Group header and footer (if you have grouped items). You can add a group header and group footer for each distinct group within the list. You can also insert calculations that show summary values such as totals, averages, or maximums in the group header or footer.

Example
You add a group header to your report to show the number of sales made by each sales representative in your organization. To clarify the report data, you also add a list header to your report and insert a title and the date.

Steps to Add a Group Header or Footer


1. Select one or more data items for which you want to create a group header or group footer. 2. On the toolbar, click the Header or Footer button. Header button Footer button If the selected data items are not grouped, Impromptu groups them, sorts them and adds a group header or footer for each. In addition, Impromptu automatically inserts the data items that you selected in step 1 into the group headers (but not into the group footers). Note: Impromptu does not cancel any groups that have already been set. The new group items are added to any existing group items.

Steps to Add a List Header or Footer


1. 2. 3. 4. 5. Select a cell in the list to which you want to add a list header or footer. From the Edit menu, click Select Parent. From the Format menu, click Properties and click the Layout tab. Click List Header or List Footer check box to add it to the list. Click OK.

More Info Tip


To delete a header or footer, select it and press the Delete key.

What if...
You want to add a title to the list header?

272 IBM(R) Cognos(R) Impromptu(R)

Chapter 35: Format a List or Crosstab Report From the Insert menu, click Text Frame. While holding down the mouse button, drag the mouse diagonally to size the area within the list header where your text will appear and release the mouse button.

Related Topics
"Change the Height or Width of a List Header or Footer" (p. 273) "Format a List or Crosstab Report" (p. 267) "Keep Details and Group Headers (or Footers) Together" (p. 273)

Change the Height or Width of a List Header or Footer


Description
The default height of list headers and footers is two row heights (about 3/4 inches or 2 cm). The default width of the list headers and footers corresponds to the width of the list columns. You can change both the height and the width of a list header or footer to accommodate another text string, value, picture, or report variable.

Example
You change the height and width of the list header to add your company logo.

Steps
1. Select the list header or footer whose height you want to change. 2. Position the pointer over one of the handles until it changes to a two-headed arrow. 3. While holding down the mouse button, drag the handle until the header or footer is the size you want and release the mouse button.

More Info Tip


To align the header and footer in a list report to the width of the report columns, select Snap to Columns in the Size tab (Properties dialog box, Format menu).

Related Topics
"Add a Group or List Header or Footer" (p. 272) "Format a List or Crosstab Report" (p. 267) "Keep Details and Group Headers (or Footers) Together" (p. 273)

Keep Details and Group Headers (or Footers) Together


Description
For any list report that appears in Page Layout view, you can increase report readability by preventing a group header or footer from appearing on a page by itself. Use the Keep Details and Headers Together button to specify that no group header should appear at the bottom of a page by itself. Use the Keep Details and Footers Together button to specify that no group footer should appear at the top of page without at least one row of data above it.

Steps
1. 2. 3. 4. Click a cell in the list report. From the Edit menu, click Select Parent. From the Format menu, click Properties and click the Layout tab. To keep details with the group headers, click the Keep Details and Headers Together button. Otherwise, to keep details with the group footers, click the Keep Details and Footers Together button. 5. Click OK. Administration Guide 273

Chapter 35: Format a List or Crosstab Report

Related Topics
"Add a Group or List Header or Footer" (p. 272) "Change the Height or Width of a List Header or Footer" (p. 273) "Format a List or Crosstab Report" (p. 267)

Insert a Page Break in a List Report


Description
You can insert a page break in your list report before or after a group or groups of data. You can also reset the page number to 1 for each group or after several groups of data. If the report has only a few rows of information on each page, you can remove the page breaks before you print to save paper.

Example
You have a long report based on sales in different cities. You start a new page each time your report shows information for a new city, and you start each city with the number 1.

Steps
1. 2. 3. 4. Click a cell in the list report. From the Edit menu, click Select Parent. From the Format menu, click Properties and click the Layout tab. To set a page break before or after a grouped data item, click the Page Break Before or Page Break After buttons that appear beside the group item. 5. To reset page numbers for one or more groups, click the group you want to reset page numbering for from the Reset the Page Number On box. There is nothing to select from this list if there are no groups in the report. 6. Click OK.

More Info What if ...


You want to remove page breaks before you print the report? In the Layout tab (List Properties dialog box), clear the Page Break Before or Page Break After buttons.

Related Topics
"Format a List or Crosstab Report" (p. 267)

Select and Format Parts of a Nested Crosstab Report


Description
You can select a value, row, column, or you can select all the columns or column headings at a particular nesting level to perform actions such as changing format or properties applying a style adjusting size or position of items copying items to the Clipboard moving items by dragging to a new location sorting adding a summary operation

Example
You select the Sales Amount column for every sales channel in order to apply formatting. 274 IBM(R) Cognos(R) Impromptu(R)

Chapter 35: Format a List or Crosstab Report

Step
Do one of the following: To select ... A single value Do the following: Select the value that you want within the crosstab.

A row

Position the pointer over the left edge of the row that you want to select and click the mouse button. Your pointer changes to the following:

A column

Position the pointer over the top edge of the column that you want to select and click the mouse button. Your pointer changes to the following:

Select Column pointer All the column titles at a specific nesting level All the columns at a specific nesting level Click the selection pointer twice in the top half of the column title. Position your pointer over a column at the nesting level you want to select and click the mouse button. Your pointer changes to the following:

Select Column pointer Click the mouse button a second time to select all the columns. An entire crosstab Headers and footers Click the point at which the horizontal and vertical scroll bars intersect in the lower-right corner of the crosstab. Click any part of the header or footer that is empty.

More Info Notes


You cannot edit the generated column titles in a crosstab report. When you apply formatting to all the column titles or all the columns at a particular nesting level, you set the default for all formatting at that nesting level. If new columns are added, Impromptu applies the default formatting.

Tip
To format a nested crosstab, select the parts of the crosstab you want to format and apply formatting (Format menu). For information about formatting reports, see "Format a Report" (p. 247).

Related Topics
"Create a Crosstab Sub-Report" (p. 208) "Set the Default Format for Crosstab Columns" (p. 276) "Use the Report Wizard to Quickly Create a Crosstab Report" (p. 204)

Administration Guide 275

Chapter 35: Format a List or Crosstab Report

Set the Default Format for Crosstab Columns


Description
The number of columns in a crosstab report can change when you retrieve the data, apply a new filter, or change prompt values. Therefore, a crosstab report can have multiple columns. You can specify whether you want to change the default column formatting or the formatting for only one column. If you don't set a default column format, then the report uses the formats set in the Data Format tab of the Options dialog box. You can use conditional formatting to format crosstab rows. Any conditional formatting set on a row supersedes the default column formatting for the columns cells in that row.

Steps
1. Select the column item you want to set the default formatting for. To select a column title, click the bottom half of the title. To select a column, click the top half of the column title. Your pointer changes to the following: Select Column pointer To select a column total, click the total. 2. Set the default formatting for that column item (at that particular level). Column titles and totals can have many levels in a crosstab report.

Note
If you select a single column title, cell, or total and change the format, that change only applies to that column item and only for as long as that column item exists in the report.

Related Topics
"Create a Crosstab Sub-Report" (p. 208) "Filter Using Crosstab Titles" (p. 225) "Select and Format Parts of a Nested Crosstab Report" (p. 274) "Use the Report Wizard to Quickly Create a Crosstab Report" (p. 204)

276 IBM(R) Cognos(R) Impromptu(R)

Chapter 36: Reporting While Disconnected From the Database


When you are disconnected from the database, you can use a snapshot to work with reports. A snapshot is a permanent local copy of the data in your report. Like a photograph, a snapshot captures a picture of the data as it existed when you created the snapshot.

Snapshots
When you open a snapshot report, the report accesses data stored in a snapshot located on your personal computer.

Why Use Snapshots?


Snapshots let you save historical data that otherwise would be updated or lost access and manipulate data when you are unable to attach to the database minimize data processing when the network traffic for the database is heavy e-mail a report and its data to someone as a file attachment You can also save a snapshot as another file format. For more information about the file formats available see, "Export a Report" (p. 193). Used properly, snapshots can improve the efficiency of your report. Because each snapshot is its own independent, static data source, certain restrictions apply to snapshots.

What You Can Do


You can drag and drop to move parts of a report within the snapshot report Ctrl+drag to make copies of parts of a report

What You Cannot Do


You cannot add new data to a snapshot such as new tables or new filters create new calculations that are based on data items that are not part of the snapshot cut and paste or drag and drop data between snapshot reports save a report that contains sub-reports as a snapshot When you save a snapshot with your report, the data and the report are saved as one file, and the data in the report is static. If the database for your report is updated after a snapshot is taken, the data in the snapshot does not change to reflect the updates. If you want to use the updated data, you must refresh the snapshot.

Note
Do not use snapshots to send highly sensitive or confidential information. No security measures are included in a snapshot. As a result, snapshots can be accessed by anyone with Impromptu.

Administration Guide 277

Chapter 36: Reporting While Disconnected From the Database

Comparing Snapshots to HotFiles


When you use a snapshot, you separate the report from its original data source. Other Impromptu users can access a snapshot report without having to connect to the original source database or catalog. All you need is Impromptu to run the report. A HotFile is a table of data. You need a catalog to bridge the report and the HotFile it accesses. You need Impromptu and the catalog to view a report that uses a HotFile. You can save historical data using either a snapshot or a HotFile. The following table compares snapshots to HotFiles: Snapshots HotFiles

Are integrated with the report. You cannot add Are separate, local data tables. A HotFile that is new data to the report. included in the catalog enables you to add additional data to the report. Have many cut and paste restrictions. Cannot be added to your catalog. Cannot be used to create a new report with data. Stand alone. Do not require catalog access. You cannot apply filters or calculations that use data not included in the snapshot. Have no cut and paste restrictions. Can be added to your catalog. Can be used to create a new report with data. Do not stand alone. Require catalog access. You can add filters and calculations.

What You Can Do with a Snapshot but Not with a HotFile


With a snapshot, you can have all the data you need for your report in one file e-mail your report to someone as a single file attachment open a report without accessing a catalog

Related Topics
"Retrieve Data from the Database" (p. 209) "Create a Local Copy of the Report Data" (p. 278) "Refresh a Local Copy of the Report Data" (p. 279) "Remove a Local Copy of the Report Data" (p. 280)

Create a Local Copy of the Report Data


Description
A snapshot is a permanent local copy of the data in your report. Like a photograph, it captures the data as it existed when you created the snapshot.

Example
You create and save a snapshot of the current monthly sales report to compare it to future monthly sales reports.

Steps
1. From the Report menu, click Query and click the Access tab. 2. In the Data Source box, click the Local Snapshot option button and click OK. The indicator on the lower-right corner of the Impromptu window shows the Snapshot icon.

278 IBM(R) Cognos(R) Impromptu(R)

Chapter 36: Reporting While Disconnected From the Database Snapshot icon

More Info Notes


You cannot save a report that contains sub-reports as a snapshot. You can save a snapshot as another file format. The file formats available in Impromptu include Delimited ASCII, Excel with Format, HotFile, PDF, XML, Hypertext Markup Language and text. The Show SQL box (Profile tab, Query dialog box) shows the SQL required to create the snapshot. If you add filters or calculations to the snapshot, the SQL box doesn't change.

Tips
To quickly create a snapshot, click the Snapshot button on the toolbar. Snapshot button To save your report as a snapshot, from the File menu, click the Save As command and select the Save a Snapshot with the Report check box.

What if...
The Save a Snapshot With the Report option (Save As dialog box) and the Snapshot button are not available? The report is already a snapshot or the report contains sub-reports. You cannot save a report that contains sub-reports as a snapshot. You do not have an Access tab? From the Tools menu, click Options, and click the General tab. Select the Show Advanced Tabs in the Query Dialog Box check box.

Related Topics
"Reporting While Disconnected From the Database" (p. 277)

Refresh a Local Copy of the Report Data


Description
You can refresh a snapshot with the current data to reflect the most recent changes in the database. When you refresh a snapshot, the data from the original snapshot is lost.

Example
The latest sales data for the last quarter has been updated in the database. Before you go away on business, you add the new sales data by refreshing your snapshot.

Steps
1. From the Report menu, click Query and click the Access tab. 2. In the Data Source box, click the Database option button and click OK to reconnect to the database. 3. Repeat step 1 to show the Access tab (Query dialog box). 4. Click the Local Snapshot option button and click OK to capture the new database information. Impromptu refreshes your snapshot with the new data from the database.

More Info Tip


To quickly refresh a snapshot with the current data, click the Snapshot button on the toolbar. In the Report Snapshot dialog box, click Refresh the Snapshot and click OK.

Administration Guide 279

Chapter 36: Reporting While Disconnected From the Database

What if ...
You do not have an Access tab? From the Tools menu, click Options, and click the General tab. Select the Show Advanced Tabs in the Query Dialog Box check box.

Related Topics
"Reporting While Disconnected From the Database" (p. 277)

Remove a Local Copy of the Report Data


Description
When you need more data than is in the snapshot, you can remove a snapshot from a report and retrieve data from the database instead.

Example
The snapshot you created last month for your accounts payable report only contains the data from the San Diego office. Since you now need data from the entire west coast, you remove the snapshot from the report and redirect your query to the database.

Steps
1. From the Report menu, click Query and click the Access tab. 2. In the Data Source box, click Database, and then click OK. Your query retrieves the data from the database. The indicator on the lower-right corner of the Impromptu window now shows the database icon.

More Info Tip


To quickly remove a snapshot from a report, click the Snapshot button on the toolbar. In the Report Snapshot dialog box, click Remove the Snapshot and then click OK.

What if ...
You do not have an Access tab? From the Tools menu, click Options, and click the General tab. Select the Show Advanced Tabs in the Query Dialog Box check box.

Related Topics
"Reporting While Disconnected From the Database" (p. 277)

280 IBM(R) Cognos(R) Impromptu(R)

Chapter 37: Drill Through to IBM Cognos Query


Description
If you use Impromptu Web Reports to distribute your reports over the Web, you can set up drill-through access to IBM Cognos Query. Impromptu Web Report users can view your Impromptu reports in PDF format, drill through to IBM Cognos Query, and then explore the data in their Web browsers. Before you publish the report in Impromptu Web Reports, you can test drill-through access by drilling through from the Impromptu report.

Steps
1. Open the report to drill through to IBM Cognos Query. 2. Select a report item that has drill-through access set up. 3. From the Report menu, click Drill Through and then click IBM Cognos Query. The Drill Through URLs to IBM Cognos Query dialog box appears. 4. Click the query that users will drill to and then click Execute URL.

Related Topics
"Import a Query from IBM Cognos Query" (p. 207) "Select the IBM Cognos Query Server" (p. 281) "Set Up Drill-Through Access to IBM Cognos Query" (p. 282) "View the Details of a Value in a Report" (p. 182)

Select the IBM Cognos Query Server


Description
Specify an IBM Cognos Query server before you test drill-through access from the Impromptu report.

Steps
1. Open Impromptu. 2. From the Tools menu, click Options and then click the Drill Through tab. 3. In the IBM Cognos Query Server box, for a simple install, type your Web server name (for example, wotalaventus1). for a distributed install, type the location and name of the IBM Cognos Query gateway. 4. Click OK.

More Info Note


The default protocol for drill through to IBM Cognos Query is /cognos/cgi-bin/cqcgi.exe.

Related Topics
"Drill Through to IBM Cognos Query" (p. 281)

Administration Guide 281

Chapter 37: Drill Through to IBM Cognos Query

Set Up Drill-Through Access to IBM Cognos Query


Description
You can use Impromptu Query Definition files (*.iqd) to set up drill-through access to IBM Cognos Query. However, before you save a query in IBM Cognos Query, click the Enable Drill Through Properties check box to store information about the query in an Impromptu Query Definitions file (*.iqd).

Steps
1. Open Impromptu. 2. Open the parent report (the one that users will drill from) and click any data item. 3. From the Report menu, click Drill Through and then click Properties. The Drill Through Properties dialog box appears. Note: If the Drill Through Properties command (Report menu) is unavailable, click Options (Tools menu), select the Drill Through tab, and then select the Enable Drill Through Properties check box. 4. Select the column you want to drill through to a query from IBM Cognos Query and click Add. The Add Drill Through Query/Report dialog box appears. 5. Select any additional columns that you want to include in the drill-through report filter. 6. Type file name for the drill-through query (*.iqd), or click Browse to find it. 7. Click OK twice. Impromptu validates the file name for the query report, but does not verify whether the selected columns exist in the query from IBM Cognos Query.

Related Topics
"Drill Through to IBM Cognos Query" (p. 281) "Import a Query from IBM Cognos Query" (p. 207)

282 IBM(R) Cognos(R) Impromptu(R)

Chapter 38: Prepare a Report for Impromptu Web Reports


Prepare a Report for Impromptu Web Reports
You can deliver Impromptu reports to the Web either by using Impromptu Web Reports or by publishing them directly to Upfront via the IWR server. When you change Impromptu reports to package them for Impromptu Web Reports, be aware of the report characteristics described in this chapter. For information about publishing reports directly to Upfront, see the Impromptu Administration Guide.

Bookmark with Undefined Destination


If you use a data item to group the data in a report, but do not include it in the report, then Impromptu Web Reports generates a bookmark that has no destination in the PDF report.

IBM CognosScript and Macros


Impromptu Web Reports does not support IBM CognosScript or AutoRun macros. If your report uses these features, your report administrator can automate the reports using events. The report administrator may also need to create HotFiles for dependent reports, because these reports are usually executed in Impromptu by using macros.

Connection String and Multiple Servers


Work with the report administrator to determine a strategy for providing all report servers with the same database connection string. If the current database connection string in the catalog cannot be used by the report servers, you may have to modify the string before the catalog is published to the Web. For more information, see your report administrator.

Database Userid and Password


If you are using your Impromptu catalog for security, ensure that the Impromptu catalog you package contains a database userid and password in each user profile. If you are using Access Manager for database security, you don't need to do this. Note: Catalogs generated in Architect always use Access Manager for database security.

Distributed Catalogs
You should disconnect personal catalogs used in Impromptu Web Reports from the master catalog. Any changes to the master catalog are not reflected in your personal catalogs. If you package reports that access an Impromptu distributed catalog and the master catalog is updated, you must repackage your reports with the updated personal catalog. Ensure that you dont include the master catalog with your repackaged reports and personal catalog.

Drill-Through Access to More Than One Report or Query


You can set up drill-through access to more than one report or query from the same report column. After you publish the report in Impromptu Web Reports, drill-through access is available to PDF and HTML report formats. With this access, report consumers can drill through to any of the reports or queries you set up. For more information about setting up drill-through in Impromptu Web Reports, see the IBM Cognos Web Portal User Guide.

Administration Guide 283

Chapter 38: Prepare a Report for Impromptu Web Reports

Failure to Publish From Impromptu to Impromptu Web Reports with Anonymous Access Configured in Access Manager
If anonymous access is enabled in Access Manager, you cannot publish from Impromptu to Impromptu Web Reports. Instead, you will receive an error saying that there was a failure to obtain a ticket. To publish from Impromptu to IWR disable anonymous access in Access Manager.

Fit to Page
The Fit to Page feature only affects how Impromptu prints your report; it does not affect how Impromptu Web Reports displays your report in PDF format.

OLE automation and OLE Objects


If some reports contain links to OLE objects, you need to copy those objects manually to the Impromptu Web Reports server. Note: OLE objects may not always behave as expected in the Web environment, and are valid only under Windows. In Web reporting applications, you should consider other alternatives.

Prepare HotFiles
If the report set contains HotFiles, you must know which operating systems the report set is going to be published on. For example, the format of HotFiles is different for UNIX and Windows. HotFiles for use on an Impromptu Web Reports server running on UNIX must be generated in UNIX. If your report set is being published to Impromptu Report Servers that run only in Windows, include the HotFile in the report set both Windows and UNIX, you must repackage the HotFile each time you update the report set only in UNIX, the report administrator must create the HotFile in UNIX for you to include in the final report set For more information, see "Package HotFiles" (p. 285).

Repeated Bookmarks in PDF Reports


When you create reports in Impromptu, do not insert a data item into the page header. If you do, Impromptu Web Reports generates the report with repeated bookmarks that link only to the page where the page header changes.

Restriction on Using Equals Sign in Prompt Names


Report authors and administrators who publish to Impromptu Web Reports should be aware of the following restriction when creating report prompts: if the prompt name contains an Equals sign (=), users will be unable to run a report based on that prompt. Only by deleting the non-supported character from the prompt name and republishing the report can the user successfully select a prompt and run the requested report.

Screen Layout View


You must change all reports in Screen Layout view to Page Layout view because Impromptu Web Reports shows all reports in Page Layout view.

Using a Locked Catalog


Impromptu administrators can add a lock to a catalog. In Impromptu Web Reports, the catalog Creator user class cannot run reports using a locked catalog. If a user attempts to run a report using the catalog Creator user class, they receive an error message. To run the report successfully, use a non-Creator user class.

View Reports in Excel


Some limitations apply when exporting reports to Excel. For more information, see Mastering Impromptu Reports. 284 IBM(R) Cognos(R) Impromptu(R)

Chapter 38: Prepare a Report for Impromptu Web Reports

Related Topics
"Create Burst Reports" (p. 285) "Notify the Report Administrator" (p. 286)

Create Burst Reports


Description
You have to add some user classes and filters when creating a report that will be a burst report in Impromptu Web Reports. In the Impromptu Administrator, set up the catalog then

Steps
In the Impromptu Administrator, set up the catalog. 1. Open Impromptu. 2. Open the catalog from which you want to generate reports. 3. From the Catalog menu, click User Profiles. 4. Click the User Classes tab and add the user classes you want for your burst report. For more information on adding user classes, see the Mastering Impromptu Reports book. 5. Click the Filter tab. 6. In the User Class list, click one of your user classes and create a specific filter for it. 7. Repeat step 6 for each user class for which you want to apply a filter. Using either the Impromptu User or Impromptu Administrator, 8. Create a new report as the Creator user class and add the required columns (the columns that have a filter or prompt on them). 9. From the Catalog menu, click User Class and click one of your user classes. 10. From the Report menu, click Retrieve to verify that this user class displays a unique report. 11. Repeat steps 9 and 10 for each user class. For more information on setting up a burst report in Impromptu Web Reports, see the Report Administrator's Guide.

Package HotFiles
Description Package HotFiles for Both Windows and UNIX
To ensure that a report set can be published to Impromptu Web Reports servers running in either Windows or UNIX, you must package both the original report and the HotFile that it creates in the same directory. This ensures that the directory can be used to publish the report set to either operating system. After the report set is published, the instructions that you give to the report administrator depends on the operating system that the Impromptu Web Reports server runs on: If the report set is published to an Impromptu Web Reports server running in Windows, you only need to tell the report administrator to hide the original report from report consumers. Reports that source Hotfiles published to UNIX must be run at least once before other IWR reports can access them. You must tell the report administrator to perform this procedure every time you publish or update this report set.

Package HotFiles for UNIX


The format of HotFiles is different for UNIX and Windows. HotFiles for use on an Impromptu Web Reports server running on UNIX must be generated in UNIX.

Administration Guide 285

Chapter 38: Prepare a Report for Impromptu Web Reports

Steps for UNIX only


1. Find the report that creates the HotFile from the report set and package it in the same directory. 2. Tell the report administrator to publish that report set to an Impromptu Web Reports server running on UNIX, run the report (.imr), and save the results in a HotFile using the same name as the original HotFile. 3. Have the report administrator FTP that HotFile back to you. 4. Add the new HotFile to the same directory containing all the reports in the report set. 5. Tell the report administrator to publish the report set to UNIX. This ensures that the directory always contains a HotFile that works in UNIX.

Notify the Report Administrator


After you package reports sets, you need to tell the report administrator the location of the database and any connection parameters the amount of disk space the report set uses if the catalog contains a database ID and password if the report set is new or updated if the report set has been updated, any changes to user profiles which reports should be generated as HotFiles which reports read or write which HotFiles which reports are used as a data source for other reports which reports contain links to OLE objects which reports use stored procedures or prompts which reports use PowerPrompts applications or user-defined functions (UDFs) which reports need to be scheduled to run and when which reports are dependent on other reports or events if any reports contain access to drill-through reports who needs to see the reports For more information about what the report administrator needs to know after the report sets are packaged, see the Impromptu Web Reports Administrator Guide.

286 IBM(R) Cognos(R) Impromptu(R)

Chapter 39: PowerPrompts Developer Studio


A PowerPrompts application guides report consumers through a series of HTML pages where they select the information that they want in a report. The report consumer then sees the report that is generated based on the selections. For example, using a PowerPrompts application report consumers can modify columns in a report column formatting a report template conditional formatting filters prompts and prompt values Use PowerPrompts Developer Studio to create these Web-based applications for Impromptu Web Reports; it is available with both the Administrator and the User versions of Impromptu. PowerPrompts applications do not interfere with the use of report or catalog prompts. For more information about PowerPrompts, see the PowerPrompts online help.

Administration Guide 287

Chapter 39: PowerPrompts Developer Studio

288 IBM(R) Cognos(R) Impromptu(R)

Chapter 40: Report Specifications

Attribute bitmap size Column width Number of group headers and footers Height of headers and footers Height of report Largest allowed negative number Largest allowed positive number Number of characters in a column name Number of colors available Number of report columns Number of tables in query Number of fonts per report Number of open reports Number of sub-reports in report Number of Toolbar buttons per Toolbar Number of parameters in a stored procedure call Number precision Number of printed pages Row height Smallest allowed negative number Smallest allowed positive number SQL character length Report width

Maximum Limited only by available memory Limited only by available memory 10 Limited only by available memory Limited only by available memory Database dependent Database dependent No known limit Limited by the number of colors supported by your monitor or printer Limited only by available memory. However, your database may impose a lower limit. 128 Limited only by available memory Limited only by available memory Limited only by available memory. 100 15 Database dependent Limited only by available memory Limited only by available memory Database dependent Database dependent 32,766 characters Limited only by available memory.

Administration Guide 289

Chapter 40: Report Specifications

File Searching
Impromptu catalogs and reports use other files. For example, a catalog may use a HotFile contain a prompt that is a report picklist be a distributed catalog pointing to the master distributed catalog A report includes a reference to a catalog file and can also include references to picklist reports bitmaps HotFiles other files The fully qualified paths for these associated files are stored in the catalog or report. For users to easily share catalogs and reports, Impromptu incorporates file searching capabilities to locate the associated files when a catalog or report is opened. When a user wants to share a catalog or report, the paths to at least some of the associated files may be different on the other user's computer.

Example
For example, you receive the following from another user: a report containing a reference to a .bmp file on the LAN a catalog When you save these files and open the report, Impromptu recognizes that the paths in the report are not current and attempts to find the associated files.

How the Search Works


If you create a catalog or report using an associated file on a network, the path of the associated file is stored in Universal Naming Convention (UNC) format. Paths for local files are stored using local drive letters (LDLs). When an associated file cannot be found using the LDL or UNC path stored in the catalog or report, Impromptu searches for the file in this order: 1. In the current folder. 2. Using the stored path, but replacing the drive letter with the letter of the drive where the catalog or report file currently resides. For example, the stored path is D:\1998\Reports. The report is opened on C:. Impromptu searches for C:\1998\Reports. 3. By deriving a relative path from the stored paths. For example, the report was in C:\1998\Reports, and the associated file was in C:\1998\Reports\Bitmaps, then Impromptu searches for a \Bitmaps folder where the report file currently resides. 4. Using the actual catalog or report path. 5. Using the workspace path specified in Preferences. 6. Using the catalog path specified in Preferences (if Impromptu is looking for a catalog). 7. Using the report path specified in Preferences (if Impromptu is looking for a report). 8. Using a standard Windows search. This includes a search of Impromptus main folder, the Windows folders and the path variable. If the search is unsuccessful, Impromptu asks you to help locate the file.

Notes
You can store both LDL and UNC paths for a file on a network. Impromptu does not use the search capability when you attempt to open a file from the most recent file list in the File menu. Enhanced file searching is not available through OLE automation.

290 IBM(R) Cognos(R) Impromptu(R)

Chapter 40: Report Specifications

Command Line Switches


Description
You can use command line options when you start Impromptu to execute a macro open a specific report The complete command line syntax is as follows:
IMPADMIN.EXE [-m macro-filename] [report-name]

or
IMPUSER.EXE [-m macro-filename] [report-name]

Notes
You can also execute a macro from within Impromptu or using the IBM Cognos Scheduler. Use double quotes to define a file name or pathname containing a space.

Related Topics
"-m macro-filename" (p. 291) "macro-filename" (p. 291) "report-name" (p. 291)

-m macro-filename
Opens the macro text file and runs the commands within the file.

Discussion
Use the -m command line option for macros written using the Impromptu Macro Editor.

Example
This command starts Impromptu and specifies the macro to execute:
C:\Program Files\Cognos\cer3\bin\IMPADMIN.EXE -m monthly.mac

Limit
127 is the maximum number of characters for commands entered on the command line.

Related Topics
"Command Line Switches" (p. 291)

macro-filename
Specifies the name of the macro file. You can also specify the path for the macro file. By default, Impromptu looks first in the catalog directory and then in the current directory.

Related Topics
"Command Line Switches" (p. 291)

report-name
Opens the specified report

Administration Guide 291

Chapter 40: Report Specifications

Discussion
Impromptu retrieves data depending on the settings in the Access tab (Query dialog box) that you access from the Report menu the preferences you set using the Options command (Tools menu)

Example
This command starts Impromptu and opens a report named summary:
C:\Program Files\Cognos\cer3\bin\IMPADMIN.EXE summary.imr

Limit
127 is the maximum number of characters for commands entered on the command line.

Related Topics
"Command Line Switches" (p. 291)

292 IBM(R) Cognos(R) Impromptu(R)

Chapter 41: Configuration Files


When you install Impromptu, the setup program automatically creates several .ini (configuration) files. Some of the initialization files created are Cognos.ini Cern.ini Impromptu.ini If you upgrade from an earlier version of Impromptu, the setup program automatically updates your .ini files with new information and maintains the settings that still apply from the earlier version. Setup ignores settings that no longer apply. When you start Impromptu, it reads the .ini files and uses the settings that were used at the end of the last Impromptu session. Impromptu uses the .ini files to define your Impromptu environment and configure it to match your preferences. The .ini files store preferences for environmental settings, such as formats and styles for report objects toolbar buttons data access options file locations for catalogs and reports

Warning
Normally, Impromptu or the setup program updates initialization files automatically. If you edit .ini files manually, use caution. Always back up an .ini file before you change it so you can restore the original file if necessary.

Related Topics
"Cern.ini" (p. 294) "Cognos.ini" (p. 294) "Function Definition Table (FDT) Files" (p. 294) "Impromptu.ini" (p. 295) "ini File Format" (p. 293) "Use Type Libraries" (p. 307)

ini File Format


.ini files contain several sections of related settings. Each section is in the following format:
[section name] keyname=value

[section name]
The name of a section. The starting square bracket must be in the left-most column of the line.

keyname=value
Defines and names the value of a setting. A keyname can consist of any combination of uppercase or lowercase letters, digits, and spaces. The keyname must be followed immediately by an equal sign. The value can be an integer, a string, or a string enclosed in quotation marks. You can include comments in the .ini files by starting a line with a semicolon (;). Blank lines are ignored.

Administration Guide 293

Chapter 41: Configuration Files

Related Topics
"Configuration Files" (p. 293)

Function Definition Table (FDT) Files


FDT files mirror the information in the database function initialization files (.ini) and are created by Impromptu to improve its performance. FDT files are created for a new or modified .ini file the first time the .ini file is read while opening the catalog. Updating the FDT files requires write privileges in the working directory. Your LAN users may not have the required privileges to create and modify the FDT files. To provide these users with FDT files, open a catalog that accesses the database supported by your enterprise when you first copy the Impromptu setup files to the LAN each time you modify the .ini file for the supported database

Related Topics
"Configuration Files" (p. 293)

Cognos.ini
Previous versions of Impromptu created this file in your Windows folder to store configuration information. Impromptu stores that information in Cern.ini in the Bin folder where Impromptu is installed. The exception is database connection information which remains in the Cognos.ini file. Cognos.ini includes [Databases] preferences. Each user must have a Cognos.ini file that contains the appropriate database connection strings.

Related Topics
"Configuration Files" (p. 293)

Cern.ini
Configuration Manager is the user interface for maintaining your rendition settings. For information about these settings, see the Configuration Manager documentation. The Impromptu state file location setting is Impromptu-specific and must be added explicitly to the rendition file. For a description of this setting, see [IBM Cognos Locations].

Related Topics
"Configuration Files" (p. 293)

[IBM Cognos Locations]


Specifies other locations of IBM Cognos applications and components.

294 IBM(R) Cognos(R) Impromptu(R)

Chapter 41: Configuration Files

Impromptu state file location=<path>


Default The Impromptu state file location setting is not enabled by default. It must be explicitly added to the cern.ini file, where n represents the product rendition number. Identifies where to create or find the Impromptu.ini file for an Impromptu User, Administrator, or workstation installation. When an Impromptu state file location is specified, Impromptu searches for the Impromptu.ini file in the state file location rather than in the default location. If the Impromptu.ini file does not exist in this location, it is created. Use an Impromptu state file location when you want to maintain one Impromptu.ini file for several users. In a workstation installation, the cern.ini file in the shared LAN location must contain the Impromptu state file location. Users specify this location in the Application Destination Folder dialog box during installation. The Impromptu state file location must be the same for each workstation installation. Example To change Impromptu state file location=C:\Program Files\State Edit the Impromptu state file location entry added to the cern.ini file, where n represents the product rendition number.

Description

Related Topics
"Cern.ini" (p. 294) "Configuration Files" (p. 293)

Impromptu.ini
Specifies Impromptu preferences. This file is created or updated when you start Impromptu. Some entries in this file can be updated in Configuration Manager. Impromptu.ini includes the following preferences: [Data Attributes] [Default Directories] [Startup Options] [Query Options] [Object Attributes] [Styles] [Graph Default Colors] [Query Statistics] [MRU Files]

Note
If you are distributing reports to users, ensure that the Impromptu.ini settings are consistent for all the users. For example, if you define styles in Impromptu.ini, use those styles in standard reports, and then distribute the reports to users without those styles in their Impromptu.ini files, the reports won't display properly for those users. You must modify their Impromptu.ini files to include the same styles included in your Impromptu.ini file.

Related Topics
"Configuration Files" (p. 293)

Administration Guide 295

Chapter 41: Configuration Files

[Data Attributes]
Stores application-wide data format settings. By default, data is formatted using the General option which uses the users locale settings.

numeric format=<setting>
Default Description To change No default. Shows the format of numeric data. From the Tools menu, click Options and then click the Data Format tab.

date format=<setting>
Default Description To change No default. Shows the format of date data. From the Tools menu, click Options and then click the Data Format tab.

date time format=<setting>


Default Description To change No default. Shows the format of date-time data. From the Tools menu, click Options and then click the Data Format tab.

time format=<setting>
Default Description To change No default. Shows the format used for time. From the Tools menu, click Options and then click the Data Format tab.

interval format=<setting>
Default Description To change No default. Shows the format of intervals. From the Tools menu, click Options and then click the Data Format tab.

string format=<setting>
Default No default.

296 IBM(R) Cognos(R) Impromptu(R)

Chapter 41: Configuration Files

Description To change

Shows the format of string expressions. From the Tools menu, click Options and then click the Data Format tab.

[Default Directories]
Defines the default directories for storing and locating the following files: Impromptu catalogs Impromptu reports temporary files (used for sorting and grouping)

temporary data path=<path>


Default Description To change temporary data path=C:\TEMP Sets where Impromptu creates temporary files. From the Tools menu, click Options and then click the File Locations tab or edit the parameter in Configuration Manager.

catalog path=<path>
Default Description To change catalog path=C:\Program Files\ Cognos\cern\Samples\Impromptu\Reports Sets where Impromptu looks for catalogs. From the Tools menu, click Options and then click the File Locations tab or edit the parameter in Configuration Manager.

report path=<path>
Default Description To change report path=C:\Program Files\ Cognos\cern\Samples\Impromptu\Reports Sets where Impromptu looks for reports. From the Tools menu, click Options and then click the File Locations tab or edit the parameter in Configuration Manager.

user template path=<path>


Default Description To change user templates path=C:\Program Files\ Cognos\cern\Samples\Impromptu\Templates Sets the location of user template files. User template files provide users with consistent access to templates across the entire application. From the Tools menu, click Options and then click the File Locations tab or edit the parameter in Configuration Manager.

Administration Guide 297

Chapter 41: Configuration Files

workgroup templates path=<path>


Default Description To change workgroup templates path=C:\Program Files\Cognos\cern\Samples\Impromptu\Templates Sets the location of workgroup templates. Workgroup templates provide uses with consistent access to templates across the entire application. From the Tools menu, click Options and then click the File Locations tab or edit the parameter in Configuration Manager.

default template=<path>
Default default template=C:\Program Files\ Cognos\cern\Samples\Impromptu\templates\ standard\simple list.imt Sets the location of the default template to use when creating a new report. From the Tools menu, click Options and then click the File Locations tab or edit the parameter in Configuration Manager.

Description To change

Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)

[Startup Options]
Sets Impromptu's startup attributes.

show QuickHelp=<setting>
Default Description To change show QuickHelp=1 Sets whether Impromptu shows QuickHelp as the mouse pointer moves over buttons on the toolbars. From the Tools menu, click Toolbars, and then clear the Show the Toolbar QuickHelp check box.

connect to database=<setting>
Default Description To change connect to database=1 Sets whether Impromptu automatically connects to the database when opening a catalog. From the Tools menu, click Options, click the Start-up tab, and then clear the Auto Attach to Database When Catalog is Opened check box.

298 IBM(R) Cognos(R) Impromptu(R)

Chapter 41: Configuration Files

ruler displayed=<setting>
Default Description To change ruler displayed=0 Sets whether to show the ruler. From the View menu, click Ruler.

last used catalog=<CatalogName>


Default Description To change Determined when a new catalog is opened. Sets the name of the last catalog opened. Not applicable. This option resets each time a new catalog is opened.

ruler in centimeters=<n>
Default ruler in centimeters=1 Ruler displays measurements in centimeters. Description To change Sets whether the rulers displays measurements in centimeters or inches. To display measurements in inches set the value to 0. Open a report and then under View, click Ruler.

catalog defrag threshold=<n>


Default Description catalog defrag threshold=66 Sets a threshold for the percentage of useful information. If a catalog becomes fragmented and falls below this threshold, the catalog defragments when explicitly closed. Click Close from the Catalog menu to explicitly close a catalog. Defragmenting a catalog makes it smaller by removing wasted space in the catalog. Defragmentation does not happen if the catalog is read-only there is insufficient disk space to perform defragmentation To change Use a text editor to edit the Impromptu.ini file. You can set the following values: 0 = Do not defragment the catalog. 100 = always defragments the catalog. 66 = value not set.

Administration Guide 299

Chapter 41: Configuration Files

report defrag threshold=<n>


Default Description report defrag threshold=66 Sets a threshold for the percentage of useful information. If a report becomes fragmented and falls below this threshold, the report defragments when file is closed. If you set Report Defrag Threshold to any value other than 0, the value is read as a percentage of the amount of accessible data in the report before the report is defragmented. If the percentage of accessible data falls below the threshold value you set, the report is defragmented and the unused data in the report is removed. To change Use a text editor to edit the Impromptu.ini file. You can set the following values: 0 = Do not defragment the reports. 100 = Always defragments the reports. 66 = The default value.

windows maximized=<setting>
Default Description To change window maximized=0 Sets whether Impromptu maximizes on startup. Maximize the Impromptu window.

window size=<setting>
Default Description Example To change Determines when the Impromptu window is resized. Defines the size of the Impromptu window. window size=0, 0, 1020, 690 Close Impromptu after resizing the Impromptu window.

show invocation dialog=<n>


Default Description To change Show invocation dialog=1 Determines whether to show the Welcome dialog box. Use the Show this dialog in future check box in the Welcome dialog box or use the Show the Welcome to Impromptu dialog box check box in the Options dialog box.

300 IBM(R) Cognos(R) Impromptu(R)

Chapter 41: Configuration Files

Always show catalog logon dialog=<setting>


Default Description To change Always show catalog logon dialog=1 Determines whether the Catalog Login dialog box appears when Access Manager can provide all the required logon information. Use the Always Show this Dialog check box in the Catalog Logon dialog box or the Always Show Catalog Logon Dialog check box in the Options dialog box.

maximize document=<setting>
Default Description To change maximize document=1 Sets whether to show Impromptu reports as maximized. Maximize or restore a report.

file picklist delimiter=<c>


Default Description To change No default entry. When there is no entry, the value is a , (comma). Specifies the picklist file separator. Use a text editor to add and then edit this entry in the Impromptu.ini file.

export HTML metadata=<n>


Default Description To change No default. You must add this entry. Specifies that HTML metadata is included in a report you save as HTML. The metadata describes report contents and individual values. Use a text editor to add the following to the Impromptu.ini file: [Startup Options] Export HTML Metadata=1

open lock warning message=<n>


Default Description To change No default. You must add this entry. Specifies that a warning message doesn't appear when you try to open a report that another user has open or that is read-only. Use a text editor to add the following to the Impromptu.ini file: [Startup Options] Open Lock Warning Message=0

Administration Guide 301

Chapter 41: Configuration Files

OverrideDistributed = <n>
Default Description No default. You must add this entry. Specifies that you can continue to use the Tables and Joins commands when you edit personal distributed catalogs. In Impromptu 6.0, these commands are unavailable unless you add this entry. In earlier versions of Impromptu Administrator, when using personal distributed catalogs the Tables and Joins commands (from the Catalog menu) were available. They shouldn't have been available and using them resulted in a loss of information. Use a text editor to add the following to the Impromptu.ini file: [Startup Options] OverrideDistributed=1

To change

Allow Lazy Path Matching=<setting>


Default Description No default. You must add this entry. Add this setting when you are updating a report with a modified or different catalog than the one it was created with, and you want to enable matching on the first folder item with the same name as the report item. By default, matching on the first folder item is disabled, because if all folder items in the new catalog dont have unique names, then matching on the first folder item can generate SQL queries improperly. To change Use a text editor to add the following to the Impromptu.ini file: [Startup Options] Allow Lazy Path Matching=T

Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)

[Query Options]
Sets query options, such as minimum free disk space and the number of rows to bulk fetch. Impromptu can retrieve more than one row of data in a single fetch call. Since none of the entries in this section appear in the Impromptu.ini by default, you may have to add this section before you add one its entries.

minFreeDiskSpace=<n>
Default Description No default entry. When there is no entry, the value is 0 (meaning unlimited diskspace). Sets the size of the internal swap file (in bytes) that Impromptu uses to cache query results. Defaults to unlimited disk space. If you want to reserve free disk space for other applications, set this entry to the desired level, for example, 100000 (approx. 100 KB). When the swap file reaches maximum size, performance may slow down if you scroll repeatedly across a large number of pages in a report. Use a text editor to edit the Impromptu.ini file.

To change

302 IBM(R) Cognos(R) Impromptu(R)

Chapter 41: Configuration Files

bulk fetch rows=<n>


Default Description No default entry. When there is no entry, the value is 100. Specifies how many rows Impromptu retrieves in one fetch call if your database supports bulk fetch. Note: A limit may have been placed on the number of rows Impromptu can retrieve. If that limit is lower than the bulk fetch rows value, Impromptu uses that limit instead. For more information on limiting the number of rows retrieved, see your Impromptu administrator. Use a text editor to edit the Impromptu.ini file.

To change

use parameterized query=<n>


Default Description No default entry. When there is no entry, the value is 0 (meaning that parameterized queries are not used). Specifies whether SQL parameters are used for prompt values in query statement. In large queries with prompt values, use parameters in queries to increase performance. To use parameterized queries, add this entry and set the value to 1. Use a text editor to edit the Impromptu.ini file.

To change

use automatic ORACLE Decode=<n>


Default Description No default entry. When there is no entry, the value is 1 (meaning that automatic ORACLE Decode is turned on). Specifies whether to automatically generate Decode statements when running queries against an ORACLE database. If an Impromptu query contains If statements, then a Case When statement is written into the SQL query for the database. However, ORACLE databases cannot process Case When statements, which must be processed locally. For queries against ORACLE databases, use the automatic ORACLE Decode statements to increase performance. However, if these queries return the wrong results (possibly because of null or floating point numbers), turn off the automatic ORACLE Decode setting by adding this entry and set the value to 0. Use a text editor to edit the Impromptu.ini file.

To change

generate isnull join=<n>


Default Description To change No default entry. When there is no entry, the value is 1. Specifies whether isnull joins are created during SQLGroup transformation. To turn off isnull join creation, create this entry and set it equal to 0. Use a text editor to edit the Impromptu.ini file.

Administration Guide 303

Chapter 41: Configuration Files

Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)

[Object Attributes]
Sets default formatting attributes, such as patterns or borders, for Impromptu report objects.

<ObjectAttribute>=<setting>, <setting>...
Default Form Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 Report Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 List Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 Crosstab Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 OLE Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 Graph Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 Bitmap Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 ColumnTitle Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 Rectangle Border=1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 Text Pattern=0,255,255,255,0,0,0 ColumnTitle Pattern=0,255,255,255,0,0,0 Form Pattern=1,255,255,255,0,0,0 Report Pattern=1,255,255,255,0,0,0 List Pattern=0,255,255,255,0,0,0 Rectangle Pattern=0,255,255,255,0,0,0 Sets the default format for Impromptu report objects. From the Tools menu, click Options and then click the Object Format tab.

Description To change

Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)

[Styles]
Stores defined style names used in reports and templates.

Note
If you deploy reports to other users, ensure that the [Styles] section of their Impromptu.ini files contains <Stylename=> entries for the styles used in your reports, and that there is a [Style - <Stylename>] entry for each style defined in the [Styles] section.

304 IBM(R) Cognos(R) Impromptu(R)

Chapter 41: Configuration Files

<StyleName>=
Default Light Emboss= Dark Emboss= Column Title Emboss= Light Etch= Dark Etch= Transparent= Heading 1= Heading 2= Heading 3= Heading 4= Heading 5= Poor (Color)= Normal (Color)= Good (Color)= Poor (Mono)= Normal (Mono)= Good (Mono)= Blue Sky 1= Blue Sky 2= Blue Sky 3= Blue Sky 4= Sea Blues 1= Sea Blues 2= Sea Blues 3= Sea Blues 4= Seeing Red 1= Seeing Red 2= Seeing Red 3= Seeing Red 4= Mellow Yellow 1= Mellow Yellow 2= Mellow Yellow 3= Mellow Yellow 4= Grass Green 1= Grass Green 2= Grass Green 3= Grass Green 4= Stores names of Impromptu report styles. [Styles] Raised Button= Lowered Button= High Risk= Add new styles or modify existing ones, use the Styles dialog box. To access the Styles dialog box, with a report open, under the Format menu, click Styles.

Description Example

To change

Each style listed in the [Styles] section, is followed by a separate [Style - <Stylename>] entry that looks like this:
[Style - Light Emboss] Border=1,255,255,255,1,128,128,128,1,128,128,128,1,255,255,255 Pattern=1,192,192,192,0,0,0

The Style entries define borders, a pattern, a font, and a color for each Impromptu default style as well as any styles you have defined.

Administration Guide 305

Chapter 41: Configuration Files

Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)

[Graph Default Colors]


Specifies the default colors for color palettes and patterns.

<ObjectAttribute>=<setting>, <setting>...
Default Custom Colors=65793,8388608,32768,8421376, 128,8388736,32896,12632256,8421504,16711680,65280, 16776960,255,16711935,65535,16777215 Custom Pattern IDs=1,2,3,4,5,6,7,8,9,10,11, 12,13,14,15,16 Description Specifies the default colors for color palettes and patterns.

Related Topics
"Cern.ini" (p. 294) "Configuration Files" (p. 293)

[Query Statistics]
Stores statistics for Impromptu queries.

<ReportName> = <statistic>, <statistic>...


Default Description Created or updated automatically when a report is run. Stores statistical information about Impromptu queries. Impromptu uses the entries in the Query Statistics section to provide query feedback. This information is shown in the Profile tab (Query dialog box) as the average number of seconds to execute the query and the average number of rows the query returns. Impromptu updates the Query Statistic entry each time a report is run, resulting in increasingly accurate statistics as reports are used. C:\Program Files\Cognos\cer3\Samples\Impromptu\Reports\Ppview.imr=793994733,0, 0.000000,0.000000,2,54.000000,1458.000000 Do not change these entries. If you delete this information, you will lose the query performance information shown in the Profile tab (Query dialog box). Note: Impromptu automatically deletes these entries based on file existence. If a query statistics entry is more than 60 days old, Impromptu checks for the existence of the file containing the associated report. If the file no longer exists, Impromptu deletes the Query Statistic entry.

Example

To change

Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)

306 IBM(R) Cognos(R) Impromptu(R)

Chapter 41: Configuration Files

[MRU Files]
Stores a list of the most recently used reports and templates.

MRUF<n>=FileName
Default Description Example Not applicable. Determined when you work with reports and templates. Stores the names of the most recently used reports and templates. Impromptu shows the names in the recent file list in the File menu. [MRU Files] MRUF1=C:\Program Files\Cognos\cer3\Samples\Impromptu\Reports\Report1.imr MRUF12=C:\Program Files\Cognos\cer3\Samples\Impromptu\Reports\Xform01.imr Changes when you work with a new report or template.

To change

Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)

Use Type Libraries


Description
Type libraries contain the available components of the OLE automation server, including information about those components and how to use them. The type library can show arguments and return types of the methods properties for objects defined by the server application definitions for custom data types such as enumerations, unions, data structures, and non-interface functions that can be called from a .dll be used with C++ If you use macros for Impromptu, you can use the type library file, ImpClient.tlb, that comes with Impromptu. ImpClient.tlb contains information about automation objects and collections, along with their properties and methods. Instead of using the IBM Cognos Script Editor, you can use the information in ImpClient.tlb to build macro scripts in Visual Basic or create header files and implementation files in Visual C++. You can also use other applications, such as, Word or Excel, to open the type library (through a Visual Basic-compatible editor).

Notes
The use of the Impromptu type library with Visual Basic is not supported. Type libraries and OLE automation only work in Windows deployment environments. They do not work in other environments, such as, UNIX.

Steps
1. 2. 3. 4. 5. Open Developer's Studio. Open a project. From the View menu, click Class Wizard. Click Add Class and then click From a Type Library. Select ImpClient.tlb. Administration Guide 307

Chapter 41: Configuration Files 6. In the Confirm Classes box, click the classes you want and click OK. 7. In the Workspace, click Class View to show the selected classes and their objects. Note: Only methods are shown for objects, not properties. 8. In the Workspace, click File Viewer to view the object definitions in the ImpClient.h file. You can now create objects in implementation files (*.cpp). 9. Use both types of files in the application you are writing or editing.

Note
Always refer to the Macro online help if there is a discrepancy in object and collection names.

308 IBM(R) Cognos(R) Impromptu(R)

Chapter 42: Get Help on Basic and Advanced Topics


This Help File
The Impromptu online Help is structured to meet the needs of its primary audiences: the report viewer and report creator. Report viewers view, print, or export information found in existing reports. Report creators create reports using the Report Wizard or a template, and apply essential skills, such as sorting, grouping, formatting, and basic filtering. All the information needed to perform essential tasks in Impromptu is in the online Help.

Mastering Impromptu Reports


If you are an advanced report author (you create complex reports for others), see the topic in the Mastering Impromptu Reports online help file that is provided with Impromptu.

Comprehensive Index
A comprehensive index for the online Help contains keywords for topics within both the online Help files.

Administration Guide 309

Chapter 42: Get Help on Basic and Advanced Topics

310 IBM(R) Cognos(R) Impromptu(R)

Chapter 43: Troubleshooting


For information about errors during the installation, see the readme file. The following error messages may be resolved by following the suggestions in the solution section. Problem Cannot Access the Datasource Cannot Open a Catalog Created with Architect Cannot Open a Catalog with the Current User Class or Version of Impromptu Cannot Connect to the SQLServer Database Description Occurs when you attempt to open a catalog or when you connect to the database through Impromptu. Occurs when you attempt to open a catalog created with Architect. Occurs when you attempt to open a catalog using the User version of Impromptu or if your User Class does not exist in the catalog security. Occurs when you attempt to connect to a catalog or an SQLServer database.

Cannot Connect to the MS SQL Occurs when you attempt to connect to a MS SQL Server. Server Cannot Find the Report or One Occurs when you attempt to open a report by double-clicking of Its Components on the file within Windows Explorer. Unable to Connect to the Database Occurs when you attempt to execute a report or query immediately after installing and setting up a connection to DB2, Sybase Adaptive Server Enterprise, or Teradata

Cannot Access the Datasource


Error Message
DMS-E-DBACCESS, It was not possible to access <logical database name> database. [Microsoft][ODBC DLL] datasource name not found and no default driver specified.

Information
Occurs when you attempt to open a catalog or when you connect to the database using Impromptu. Impromptu cannot open the target datasource.

Solution
Check the following information That the ODBC driver has been installed and configured correctly through the Microsoft ODBC Administrator. Verify that the entry for your data source is in the Odbc.ini file. That the Impromptu logical database definition is correct, confirm that the correct ODBC data source is specified. Check that the database definition is in the [Databases] section of the Cognos.ini. That you are using a 32-bit ODBC driver. That you have the latest version of the ODBC driver, including all available patches. That the Odbc.dll and Odbcint.dll are version 2.10 or later. That the AS/400 ptf must be sf34548, if you are using IBM's Client Access. Administration Guide 311

Chapter 43: Troubleshooting That you verify the path with the SQL Lib IBM ACE. Run an ODBC Trace to help identify the problem. Compare the ODBC driver settings with a successful connection from another PC.

If the above is verified, then the database definition for this catalog may be incorrect. Try creating a database definition.

Steps
1. From the Impromptu Help menu, select Contents and Index. 2. In the Help Topics dialog box, select the Contents tab and double click Database Definition Manager. 3. Double click Setup Up Database Access and double click Create a Database Definition. Note: This topic is available only in the Impromptu Administrator online help.

Cannot Open a Catalog Created with Architect


Error Message
The catalog's available user classes do no correspond to any defined by the Common Logon Server.

Information
This error occurs when you attempt to open a catalog created with Architect. The catalog contains security information stored as authentication data in Access Manager. The current user ID does not have permission to access the data in the catalog.

Solution
You must log on to this catalog as the Creator.

Steps
1. In Access Manager, add a user class called Creator and associate the user logging on to the Common Logon Server, to it. 2. Shut down the Common Logon Server and reconnect to the catalog. 3. Use the Creator User Class at the Catalog Logon dialog box. Note: By default every catalog has a Creator User Class.

Cannot Open a Catalog with Current User Class or Version of Impromptu


Error Message
Catalog has no User Class that is valid with this edition. Contact the catalog administrator. Or when using the Impromptu User edition. Cannot open a catalog nor query a report, because an Impromptu warning message is displayed: Catalog has no user class that is valid with this edition. Contact the catalog administrator.

Information
This error occurs when you attempt to open a catalog using the User version of Impromptu or if your User Class does not exist in the catalog security.

Solution
The current user ID does not have permission to access the data in this catalog with the User version of Impromptu. Either the current user class does not exist in the catalog or there are no user classes defined in the catalog. An Impromptu administrator must create and define additional user classes for this catalog. For information about creating user classes, see the Impromptu Administrator online help or the Impromptu Administration Guide.

312 IBM(R) Cognos(R) Impromptu(R)

Chapter 43: Troubleshooting If setting the user classes in the catalog does not fix the problem, than ensure that the report has the correct path to a valid catalog which has user classes defined in its User Profiles: 1. Open the report. 2. From the Report menu, click General and review the Catalog path. If necessary, click Browse to find the correct catalog location and file. 3. Upgrade the catalog and all reports to the same version of Impromptu. You should also synchronize the versions between the Administrator and User editions. Note: The above suggestions do not apply if the catalog was created using Architect.

Cannot Connect to the SQL Server Database


Error Message
Error 53 dms-e-yv_systemerr, an unexpected Windows error (1157) occurred while attempting to load the gateway.

Information
This error occurs when you try to connect to a catalog or a SQLServer database. Note: If you are using Windows authentication for SQL Server login you can connect to SQL Server without logging in again.

Solution
Check the following information The 32-bit MS SQL client software is properly installed and configured on your PC. The Path environment variable contains the path to the \MSSQL\bin directory You can successfully connect to the database outside Impromptu. The files Dbnmpntw.dll and Ntwdblib.dll are in the \MSSQL\bin and \WinNT\System32 directories.

Cannot Connect to the MS SQL Server


Error Message
Unexpected Windows error (1157) occurred while attempting to load the gateway 'msdbak.dll'.

Information
This error occurs when you attempt to connect to a MicroSoft SQL Server. The MS SQL Server Client software does not appear to be installed or is not properly configured.

Solution
If the MS SQL Sever Client software appears to be configured properly, than verify that the following DLLs exist under <drive>:\MSSQLl\bin directory Dbnmpntw.dll Ntwdblib.dll If you have a server without SQL Server or SQL Enterprise Manager, you must verify that these DLLs also exist under <drive>:\WinNT. If the MS SQL Sever Client software does not appear to be configured properly, install or reinstall the MS SQL Server Client software.

Cannot Find the Report or One of Its Components


Error Message
Cannot find the file'<path>\<report>.imr' or one of its components.

Administration Guide 313

Chapter 43: Troubleshooting

Information
This error occurs when you attempt to open a report by double-clicking on the file within Windows Explorer. The Impromptu report does not have a valid application associated with it.

Solution
Impromptu must be identified as the associated application. To do this 1. In Windows Explorer, highlight the .imr file by selecting it. 2. Hold the shift key down, right click the .imr file and select Open With. 3. In the Open With dialog box navigate to either ImpAdmin, if the Administrator version is installed, or ImpUser, if the User version is installed. 4. Select the Always use this program to open this type of file check box. 5. Click OK.

Unable to Connect to the Database


Error Message
Unable to connect to database.

Information
When you try to execute reports or queries immediately after installing and setting up a connection to DB2, Sybase Adaptive Server Enterprise, or Teradata, you may receive an error message that there is a problem connecting to the database or executing the report.

Solution
You must reboot your system to solve this problem.

314 IBM(R) Cognos(R) Impromptu(R)

PART 3: Mastering Impromptu Reports

Administration Guide 315

316 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data


You use Impromptus powerful tools to create effective reports. You can shape your report by customizing the data source data that appears in the report security features

Getting the Results You Want


You use Impromptu to answer business questions, such as Which sales representative sold the most products? How do sales representatives rank in terms of their total sales? Which product sells best? To get the results you want, you need to understand how Impromptu generates what you see in your reports. Your administrator develops and implements a data model by defining information in the database creating a catalog that presents a business view of the data and defines what information from the database you see and how the information in the database is structured You then use the catalog to access the database and create the reports you need. You can adjust the information that appears in your report by creating groups defining filters defining prompts creating summary fields adding calculated fields highlighting data

Specify the Catalog for Your Reports


You can specify, change or clear the catalog to which a report is attached. This enables you to create and test a new report while attached to a small catalog, and then move the report to a production catalog once your testing is complete. You can also create and test a report at one location, then ship the report to another site with a similar catalog and database.

Steps
1. Select the report. 2. From the Report menu, click General. 3. In the Catalog box, type the path and name of the new catalog to which you want to attach the report. You can also click Browse to locate and select the new catalog. 4. Click OK.

Administration Guide 317

Chapter 44: Report Data

Tip
You can also disconnect the report from the catalog to which it is attached by saving the report with a snapshot of the data. However, you must reconnect to the catalog if you want to refresh the data.

Group Automatically
If a report does not include a grouped data item and you add a summary data item, Impromptu automatically groups all data items in the report. This is called Auto-Grouping. Use this default to quickly produce a summary report. When auto-grouping is enabled, Impromptu assumes full control of grouping and association: the Group and Associate buttons are unavailable (unless you select a data item) any previously grouped data items become ungrouped data items are grouped in the order in which they appear in the Group tab (Query dialog box) summaries are automatically associated with the last group listed in the Group Order box of the Group tab (Query dialog box) For example, you create a report that consists of Branch, Rep Name, and the Total Sale Amount summary. Impromptu automatically groups Branch and Rep Name, and associates the summary with Rep Name, the lowest-level grouped data item.

Steps
1. From the Report menu, click Query, and click the Group tab. 2. Select the Auto-Group check box and click OK. If you include a summary data item in the query and click the Auto-Group check box, then the data items are grouped in the order that they appear in the Group Order box of the Group tab (Query dialog box).

Notes
Selecting the Auto-Group check box has no effect until a summary data item is included in the query data. By default, the auto-group checkbox is selected whenever you create a new report. The Auto-Group check box is cleared if you select and group a data item or if you change the automatic association of a summary data item.

Define Filters
You use filters to focus a report and minimize processing time by excluding any data that is irrelevant to the report. For example, you can filter a report to show only the customers who placed orders with a total sales amount greater than $500 during the past year. You can create detail and summary filters. Note: You cannot use text binary objects in filters.

Detail and Summary Filters


Your report can contain a combination of detail and summary filters. A detail filter applies one or more specified conditions to each row of data. If the conditions are true for a row, the row is retrieved and appears in the report; if the conditions are not true, the row is not retrieved and does not appear in the report. For example, here is a report with a detail filter that includes only branches that start with the letter M.

318 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data

You can filter summary data items that you select from a report query or the catalog. For example, here is the same report listing branches and total sale amounts. Instead of a detail filter, this report uses a summary filter that retrieves only the rows where total sale amount is greater than $100,000.

Unlike a detail filter, which can include only detail data items, a summary filter can include both summary and detail data items. If youre familiar with SQL, you can think of a detail filter as having a predicate in the WHERE clause and a summary filter as having a predicate in the HAVING clause. The WHERE clause is processed first, followed by any grouping and summarization, and then the HAVING clause is processed. For information about creating summaries, see "Summaries" (p. 336).

Create Filters
You can create filters by using filter definitions in the Filter tab (Query dialog box, Report menu).

Steps
From the Report menu, click Query. Click the Filter tab. Select either Detail or Summary in the Filter Type box. From the Available Components box, insert the components into the Filter Definition box to build your filter. 5. Click OK. Note: You can only include crosstab filters in crosstab reports. For information about crosstab filters, see "Filter Data in Crosstab Reports" (p. 389). 1. 2. 3. 4.

Use Filter Expressions


Use the OR operator and the AND operator to create the filter expressions you need. Follow these guidelines when using filter expressions. Use the OR operator to indicate that a row must meet at least one of the conditions on either side of the OR operator. Use the AND operator to indicate that a row must meet both of the conditions on either side of the AND operator. For example, retrieve only the rows of data where the product price is less than $10.00 or the product margin is less than or equal $5.00, use this expression.
Product Price < 10 OR Product Margin <= 5

To retrieve only the rows of data where the product price is less than $10.00 and the product margin is less than or equal to $5.00, use this expression:

Administration Guide 319

Chapter 44: Report Data


Product Price < 10 AND Product Margin <= 5

Tip
To enhance performance, use limited local processing (Client/Server tab, Query dialog box) instead of flexible processing.

For information about performance issues, see "Optimize Performance in Impromptu" (p. 435).

For Example
You want to filter a report to show only those products from the GO Sport Line. Of the rows that meet this condition, you want to retrieve only the rows in which the product price is less than or equal to $10.00 or the product margin is less than or equal to $5.00. Because expressions that use the AND operator are processed before expressions that use the OR operator, the following filter returns results that you do not expect:
Product Type = GO Sport Line AND Product Price <= 10 OR Product Margin <= 5

Impromptu retrieves rows that meet the condition "Product Type = GO Sport Line AND Product Price < 10." Impromptu then retrieves rows that meet the condition "Product Margin <= 5", regardless of their Product Type. Instead, you use parentheses to indicate which expressions to evaluate first. The following expression returns the correct results:
Product Type = GO Sport Line AND (Product Price < 10 OR Product Margin <=5)

Because parentheses are processed before other operators, Impromptu first evaluates the expression in the parentheses and retrieves all the products with a product price less than $10.00 and a product margin less than or equal to $5.00. Impromptu then checks these products for those that are from the GO Sport Line. There is often more than one way to filter data and get the same results. Depending on how your database processes requests, one method may be more efficient than another.

For Example
You want to retrieve only the rows for three product lines: Recycled Products, Sport Wear, and Back Packs. You define this filter:
Product Line = 'Recycled Products' OR Product Line = 'Sport Wear' OR Product Line = 'Back Packs'

Because the values in the example are from the same column of data, you can use the IN operator to achieve the same results:
Product Line IN ('Recycled Products', 'Sport Wear', 'Back Packs')

Filter Without Changing Your Summaries


You can filter values from your report without affecting the summaries that are based on those values. For example, a summary in your report shows that the total number of orders is 1,122. When you filter to show only orders with a total sale amount over $25,000, the total number of orders is reduced to 39. You can calculate the summary first, then filter, so that the total number remains at 1,122.

320 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data To specify that a summary is calculated before the summary filter is applied, do one of the following: Click the Calculate Before the Summary Filter Is Applied check box in the Data Definition dialog box of the summary data item. The summary calculation is prefiltered in this instance, but not if you use it elsewhere. Add a Prefilter component to the summary expression. The calculation is always automatically applied before the summary filter. You can add the Prefilter component to a summary expression even when there is no summary filter in the report. When you add or delete a summary filter, you do not change the summary expression.

Steps
1. From the Report menu, click Query, and click the Data tab. 2. In the Query Data box, select the summary data item that you want to calculate before the summary filter is applied. 3. Click Edit Definition. 4. In the Data Definition dialog box, select the Calculate Before the Summary Filter Is Applied check box or double-click Prefilter in the Available Components box to add it to the Expression box. If you add the Prefilter component to the Expression box, the data definition in the Expression box becomes: "<summary data item> prefilter". 5. Click OK to return to the Query dialog box.

What You Can Do Using Filters


This section covers some of the things you can do using filters. You can retrieve data that contains missing values that starts with or contains a specific value using another report based on a rolling time period that matches a pattern of characters

Retrieving Data that Contains Missing Values


You can limit your report to retrieve just those rows of data that contain missing values for a specified data item. Missing values can be a blank, a variable length character field with a length of 0, or a null value (a cell that contains nothing and is marked with a flag in the database). For example, you want to determine which customers have not paid their invoices. You create the following filter:
Payment is missing

Steps
1. In the Available Components box (Filter tab, Query dialog box), add the data item from the Report column or the Catalog column. 2. In the Available Components box, double-click Is Missing and click OK.

Note
If no rows appear in the report, there are no missing values.

Tip
To show null values when you filter on another condition, you must include the null value condition in the filter expression. For example, the following filter retrieves all product types except Outdoor Products.
Product Type not in (Outdoor Products) OR Product Type is missing

If the product type is a null value, the filter retrieves the row.

Administration Guide 321

Chapter 44: Report Data

Retrieve Data that Contains a Specific String or Value


You can retrieve data that begins with or contains a specified string or value. For example, the following filter retrieves only the rows in which the postal code or zip code begins with 3 specific characters:
Postal Code Starts With 'K2G'

You can also filter a report to retrieve only the product numbers that contain a specific value. The filter expression looks like this:
Product Number Contains '60'

Steps
1. In the Available Components box (Filter tab, Query dialog box), add the data item from the Report Columns or the Catalog Columns. 2. In the Available Components box, double-click Starts With or Contains. 3. Double-click String or Value. 4. In the Filter Definition box, type the string or value in the highlighted location and click OK.

Retrieve Data Using Another Report or Snapshot


You can filter a report using the data from another report. Impromptu re-runs the report that stores the dataset to ensure that it contains the most current information. a snapshot. Impromptu filters on a fixed dataset and does not query the database. This ensures that users working with the same report filter the same dataset. For example, you have a report that contains customer details for your customers from Mexico. You want to create a new report that contains only the order information for those customers, so you create your new report, and then filter it using the customer details report. This restricts the data available for your new report to orders made by customers in the customer details report. Filters that rely on another report or snapshot always end with the filter expressions In, All, or Any.

Steps
1. In the Available Components box (Filter tab, Query dialog box), add the data item from the Report Columns or the Catalog Columns. 2. Create a filter expression ending with In, All or Any. 3. Double-click Dataset. 4. Click the report that contains the dataset and select the column on which you want to base your filter. 5. Click Open. 6. Click OK.

Filter Using a Rolling Time Period


You can retrieve data for a time period that has a fixed range, where both dates continuously move (a rolling time period). To create an expression for a rolling time period, you set the current date from either: the database using the Now function your computer using the Today function. Impromptus date functions, such as Add-years, work with date formats. If your database uses DateTime formats, you must precede a date function in the filter with the DateTime-To-Date function to convert the format.

For Example
You filter a report to retrieve the information for orders placed in the last year. Instead of including the dates in the filter and changing them each time you run the report, you use the following functions in the filter definition:

322 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data


Order Date >= add-years ((now ( )), -1) and Order Date < now ( )

The first part of the expression restricts the data to records dated one year earlier than the current date according to your PC, while the second part restricts the data to records from the previous day or earlier. When you apply the filter, Impromptu captures current information for use in the expression. For example, if the now function returns a date of September 7, 1998, this expression will return all records dated between September 7, 1997 and September 6, 1998.

Steps
1. In the Available Components box (Filter tab, Query dialog box), add the data item from the Report Columns or the Catalog Columns. 2. In the Available Components box, double-click a comparative operator (>,>=,<,<=,=, and so on) Functions and Add-years( ) Functions and Today( ) the minus sign Number 3. Do the following in the Filter Definition box: Type 1 in the highlighted area between quotation marks. Double-click the ellipse (...). 4. In the Available Components box, double-click AND the report or catalog column a comparative operator (>,>=,<,<=,=, and so on) Functions and double-click Today( ) 5. Click OK.

Retrieve Data that Matches a Pattern of Characters


You can create an expression that retrieves data that matches a specific pattern. The pattern can include wildcard characters as follows: the percent sign (%) represents any number of characters the underscore (_) represents one character For example, you want to mail out flyers to specific regions of the city. You filter a report to retrieve customer addresses that match a postal code or zip code pattern.
Postal Code Like 'H_Y%'

Impromptu retrieves only the codes that begin with "H", followed by any single character, a "Y", and any number of characters to complete the sequence. For example, Impromptu retrieves "H2Y 2W2", "H8Y 2R5", and so on. When you use the Like function to retrieve data that ends with a specific value, use the Trim-Trailing function to remove blanks at the end of the data. For example, the following expression removes blanks at the end of each Customer Name value and retrieves rows where the last character of the customer name is n: TRIM-TRAILING (Customer Name) LIKE %n

Steps
1. In the Available Components box (Filter tab, Query dialog box), add the data item from the Report Columns or the Catalog Columns. 2. In the Available Components box, double-click Like String, then type the string including any wildcard characters 3. Click OK.

Administration Guide 323

Chapter 44: Report Data

Note
Impromptu is case-sensitive. Be sure the case of the characters you enter is correct.

Creating Filters Using the Like, Contains, and Starts With Operators
You can use the Like, Contains, and Starts With operators to create complex filter expressions for reports and catalogs. Any function, prompt, or component that evaluates to a string can be used with these operators. When the filter contains Report Columns or Catalog Columns, text blobs can be included in the filter (p. 324). The following components are available: Report Columns Functions Access Security Catalog Columns string Prompt Manager If The following example creates a filter that can search a column based on case insensitive prompt values:
upper (columnname) Contains upper (?Type in Prompt?)

This example uses the Starts With operator to search a column based on a conditional expression:
Product Line Starts With if (Product no. <156) then (A) else (B))

Search Text Blob Data Using the Like, Contains, and Starts With Operators
You can create report and catalog filters that use the Like, Contains, and Starts With operators to search text blob data. If you are using the Like operator, the pattern can include wildcards such as the percent sign (%) and underscores (_).

Steps
1. In the Available components box (Filter tab, Query dialog box), create the filter as follows: Double-click the Report Columns to create a report filter or the Catalog Columns to create a catalog filter. Double-click the text blob data item. Double-click the Like, Contains, or Starts With operator. Double-click string. Type a string value. 2. Click OK.

Sort Returned Values in Impromptu Selection Lists


When selecting values in a report filter or catalog condition, you can specify either an ascending or descending sort. This is an alternative to viewing the values in the default sort order set by the database.

Steps
1. On the Filter tab, in the Filter definition box, place your cursor in the condition or filter so that select values appears in the Available components box. 2. Double-click select values, and in the Select values for <data_item> box, select the values you want retrieved. The limit of the values that are retrieved and appear in the list box is set by the Picklist Limit property in Configuration Manager. 3. Click the Sort List button, and in the resulting list, do one of the following: to use the default sort order set by the database, click the No sort (As source) button to sort the values in ascending order, click the Ascending button to sort the values in descending order, click the Descending button

324 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data The values appear in the Select values for <data_item> box in the specified order. 4. Click OK.

Tips for Filters


To filter out repetitive information in the database and retrieve only unique rows of data, select the Eliminate Duplicate Rows check box on the Filter tab (Query dialog box). To remove all filters from a report, press Esc to ensure that nothing is selected in your report, click the Filter button, and confirm that you want to delete the existing filter. To provide the report user with a description of the report content, you can include filter definitions or values in a report title or text frame. For example, a report is filtered to show only the rows for North America. In the report title, you include the filter expression "Country = 'North America'". You insert filter definitions using the More Objects dialog box.

Use Prompts to Select Report Data


You can use prompts to filter data when you open a report. The types of prompts are type-in picklist catalog Each prompt type appears when you open a report. The report uses your response to filter the data. When you open a report that contains more than one prompt, Impromptu presents the prompts in the order they are listed in the Available Prompts list (Prompt Manager dialog box, from the Report menu, Prompt Manager). Drag the prompts in this list to change their order. Only prompts that are used in the report appear in the Available Prompts list in the Prompt Manager box. If the prompt is used in a filter, calculation, or condition, its uses are also listed in the reference box.

Prompt Sort Order


The sort order of data returned by a prompt is locale sensitive. Locale sensitive sorting ignores the "-" character and is not case-sensitive. For example, the order of a picklist prompt appears as follows: Enviro-Kit Envirosafe EnviroSak Enviro-T

Tips
Impromptu runs prompts for sub-reports once at the same time as the parent query. To include the prompt data in a report, click More Objects (Insert menu) and select the Prompt Variables item.

Type-in Prompts
A type-in prompt captures information that you enter into the prompt. You can define either a single value or multiple values in a type-in prompt. Type-in prompts are best suited for capturing dates or numeric values that do not require familiarity with the contents of the database. For example, a report on order information uses a type-in prompt to capture two dates. Impromptu filters the report to show only the orders placed within a specific time period.

Administration Guide 325

Chapter 44: Report Data

In the following example, a sales report uses two type-in prompts, filtering on the country and product name, where each prompt accepts multiple values. Note that each prompt value is entered on a separate line and formatted according to the users locale settings..

Tip Text
Impromptu provides tip text for type-in prompts. Tip text shows users the expected formats when entering data values for dates, time, date-time, and intervals. Except for intervals and time, which use the ISO format and English text, tip text is localized. The localized version is set by the users locale. For information about changing locale settings in Configuration Manager, see the Configuration Manager User Guide.

Ensure Case Compatibility


If you want your report to include a type-in prompt that requires text, you can control the text case entered by the user. To do so, you add a filter that converts the text to all upper case (LIKE THIS), or all lower case (like this). This expression in the Filter tab of the Query dialog box converts the user-entered response to the Customer Status prompt to upper case:
Customer Status in ( upper ( ?What type? ) )

You can also force the text to lower case by replacing the "upper" function with "lower".

Picklist Prompts
A picklist prompt presents you with a list of data items from which you select one or more values, so you need not be familiar with the database. The values listed in picklist prompts can be retrieved from a database via a catalog when you want to select information that often changes. a column in another saved Impromptu report, a snapshot, or a HotFile, when you want to select values from a subset of those available in the database. For example, a report picklist prompt based on the Customer Name data item in another report lists only the customer names included in the referenced report. When you open the new report, you are prompted to select one of the customer names.

326 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data a text file saved in a comma delimited ASCII format when you want to base a prompt on information from another application. If the text file has a single column of values, the value in the Prompts dialog box is the filter value. If the text file has two columns, the value in the Prompts dialog box comes from the second column and the corresponding value from the first column is the filter value. Use two columns in the text file to provide descriptive text for the filter values.

For example, a report can include a prompt that asks you to select a product type from a list of those available in the database. Only the products belonging to the product type you select are retrieved and displayed in your report.

Tips
By default, the maximum number of items in a picklist is 100 items. Although you should avoid using large picklists because they can be confusing to users, you can change this limit using the Picklist Limit property in Configuration Manager. Increasing the limit may have a negative impact on performance. You can sort the data values in picklist prompts in ascending or descending order, or you can use the order that exists at source. If you sort values in ascending or descending order, values are sorted alphabetically or numerically with the exception of date, time, and date-time values. These values are sorted chronologically. To change the prompt separator for a file picklist, modify the Impromptu.ini file. For information, see the Impromptu Administrator online help. In the Index tab, type startup options For information about performance issues, see "Optimize Performance in Impromptu" (p. 435).

Picklist Prompts that Allow Multiple Selections


To create picklist prompts that let you select more than one value, use the In operator and put the prompt in parentheses. For example, the filter expression
Product Type in (?Product Type?)

brings up the following prompt dialog box:

This prompt enables you to select multiple items from the list using Ctrl+click.

Add the Select All Option to Picklist Prompts


To make prompt selection more convenient, you may want to use the select all option with multi-select prompts. The select all option allows users to generate a report using all the values that are valid for the prompt. For example, if the prompt filters on product name, then all the product name values are used when the report is generated. So, if you have 5000 product names, then the report is generated with 5000 product names.

Administration Guide 327

Chapter 44: Report Data Note that if you have a picklist that prompts the user to choose ProductA, ProductB, or ProductC, but there are 5000 products in the database, then if select all is enabled and the user chooses this option, all 5000 products are included in the report. A picklist prompt does not provide data access security. If you want to control access to data, then you must have a catalog or report filter that restricts user access to data. Then, when there is a filter and a user chooses to select all, the data will still be filtered and only the allowed products will be included in the report. When you use the select all option, the picklist limit is ignored. The select all option is available in file, report and catalog picklists specified in either catalogs or reports. By default, the option is selected for new prompts. For upgraded prompts, you must edit the prompt and specify the select all option.

Steps to Add the Select All Option to a Prompt in a Catalog


1. In Impromptu Administrator, under the Catalog menu, click Folders. 2. In the Catalog Folders list, find and click the multi-select prompt you want to edit. Click the Edit button. The select all option applies to prompts used in filters that use the In operator. For example,
Country IN (?CountryPrompt?)

3. In the Prompt Definition dialog box, select the Allow the user to select all values option, click OK, and then in the Folders dialog box, click OK again. 4. Repeat steps 2 and 3 to edit any other prompts in the catalog. 5. Run a report with the updated prompt. The <All> option appears in the picklist.

Steps to Add the Select All Option to a Prompt in a Report


1. In Impromptu Administrator, open a report that contains a multi-select prompt. 2. From the Report menu, click Prompt Manager. 3. In the Prompt Manager dialog box, select the prompt you want to change, and click Edit. The select all option applies to prompts used in filters that use the In operator. For example,
Country IN (?CountryPrompt?)

4. In the Prompt Definition dialog box, select the Allow the user to select all values option and click OK. Click OK again in the Prompt Manager dialog box. When you run the report, the <All> option appears in the picklist.

Catalog Prompts
The administrator can create catalog prompts stored in a folder within the catalog. Users can also create their own catalog prompts if they have the access rights or are working with a personal distributed copy of the catalog (Folders in the Catalog menu). Because the catalog prompts reside in the catalog, they are available to any report that attaches to the catalog. You can access catalog prompts from the Filter tab (Query dialog box). A folder for catalog prompts appears under the Catalog Columns in the Available Components box. The catalog prompt symbol identifies a catalog prompt. You can move, copy or delete catalog prompts just as you can any other catalog folder item using OLE automation. 328 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data For information on OLE automation, see the Macro Online Help (IBM CognosScript Editor).

When to Use the Types of Prompts


The type of prompt you create depends on factors such as the function of the prompt, the amount of processing required, and the nature of the data (static or dynamic). Follow the guidelines listed below to choose the appropriate type of prompt for your reports. Use If

A catalog picklist prompt. This type of prompt Your report consists of a simple list of dynamic values. does not require a detailed knowledge of the database. A report picklist with a snapshot or a HotFile report as the data source. Because the report has already been generated and saved with the required data, when you run the prompt you do not have to query the database. This can save time. A type-in prompt. This type of prompt can speed up processing time because the report does not need to reference the catalog. A cascading report prompt. For information about cascading prompts, see "Calculating Data Items" (p. 334). Additional processing is required for filtering or calculations.

Your audience has a detailed knowledge of the database or you want the report to be filtered on a range of values. Your reports consist of a hierarchy of values.

Using the Prompt Manager


The Prompt Manager (Report menu) allows you to easily manage prompts in the current report. You can create prompts edit prompts remove prompts store prompts The Prompt Manager verifies links between prompts. If you attempt to create a circular link between two reports in which Report A has a report picklist prompt that references Report B and you attempt to set up a prompt for Report B that references Report A, the OK button (Prompt Definition dialog box) becomes unavailable.

Creating Prompts Using the Prompt Manager


You can create your own prompts using the Prompt Manager, or you can use prompts from the catalog. For catalog and report picklists, you can use one data item as the source for the prompt, and display a different data item in the prompt. For example, you can prompt users for a data item such as Productname, but use Productnumber in the query that generates the report. This may affect performance.

Administration Guide 329

Chapter 44: Report Data

For information about performance issues, see "Optimize Performance in Impromptu" (p. 435). You can create prompts for single values and multiple values, and you can create cascading prompts.

Steps to Create a Prompt for a Single Value


1. From the Report menu, click Prompt Manager. 2. Click New. The Prompt Definition dialog box appears.

3. In the Name box, type a prompt name. 4. In the Type box, select the type of prompt. 5. In the Message box, type the instructions users see in the Prompts dialog box when you open the report.

330 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data 6. Do one of the following: To create this type of prompt Type-in

Do this In the Data Type box, select the type of data you will enter. Depending on the expression, Impromptu may select a default data type. Date, Time and DateTime values are initialized to zeros in the ISO date-time format. If you accept the initial values, then at run time, the default prompt value is set to the current date and time and formatted according to the users locale. If you want a default value to appear in the Type-in Prompt box when the report is opened, type a default value in the Default Value box. The value must use standard ISO format. Locate and select the desired file, and click OK. In the Data Type box, select the appropriate data type. Depending on the expression, Impromptu may select a default data type. Locate and select the desired report, and click OK. In the Report Data box, select the data item you want to use to filter your report and click Use. If you want the Report Picklist to show a different data item in the prompt, select a data item and click Display. In the Catalog Columns box, select the data item you want to use to filter your report and click Use. If you want the Catalog Picklist to show a different data item in the prompt, select a data item and click Display.

File Picklist

Report Picklist

Catalog Picklist

7. Click OK. If more than one prompt is defined, the new prompt appears highlighted in the Available Prompts box.

Steps to Create a Filter With Multiple Prompts


1. 2. 3. 4. 5. 6. 7. 8. 9. Create more than one prompt. From the Report menu, click Query. Click the Filter tab. In the Available Components box, add the required data item from the Report Columns or Catalog Columns folder. In the Available Components box, click the desired operator and then double-click Prompt Manager Click the prompt you want to appear as the first prompt, and click OK. In the Available Components box, click the operator you want to use (either And or Or). Repeat steps 4 to 7 until all the prompts you want to use are included. Click OK.

Notes
Prompted values appear between question marks. For example, Country = ?Country? and Product in (?Product?) and Sale Amount >= ?Amount? You can use any combination of prompt types.

Administration Guide 331

Chapter 44: Report Data

Create a Type-in Prompt With the In Operator that Accepts Multiple Values
Report filters or conditions that contain the In operator allow report authors to specify type-in prompts that accept multiple values. By allowing multiple prompt values, report consumers can refine reports more easily.

Steps
1. With a report open, from the Report menu click Query. 2. Click the Filter tab. 3. In the Available Components box, complete the following steps to add a filter definition: double-click the Report Columns or Catalog Columns folder, and double-click the data item to filter on double-click the in operator double-click the opening parenthesis double-click Prompt Manager, and in the Available prompts box, click the prompt you want to appear as the first prompt, and click OK. double-click the closing parenthesis double-click the And or Or operator 4. Repeat step 3 to add additional prompts until you reach the last prompt. After the last prompt, omit the And or Or operator. The following is an example of a prompt filter using the In operator that accepts multiple values:
Country in (?Prompt1?) and Productname in (?Prompt2?)

5. Click OK. When the user runs the report, they can type multiple prompt values in the Prompts dialog. Each prompt value must be entered on a separate line and formatted according to the users locale settings.

Creating and Using Cascading Prompts


You can create a series of prompts that show only the values that correspond to the value selected for the previous prompt. These are called cascading prompts. To do so, you create a series of linked reports, each of which contains a filter prompt. Because Impromptu runs each report, the size of the reports affects performance. If you use a large report as the source for a prompt, Impromptu must run the report and read through the dataset to apply the filter. If the information contained in the database does not change very often, it is more efficient to create a HotFile with the data that you want in your picklist, and then use the HotFile in your Query. For example, you open a report, and a prompt appears asking you to select a product type from a list of product types. You select the Environmental Line. The next prompt asks you to select a product line from a list showing only the product lines belonging to the Environmental Line. You select the Sun Block product line, and the report appears showing only the data for the Sun Block products.

332 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data

Steps
1. Create the report that you want the user to open. 2. Save, but do not close, the report. For each cascading prompt you require, save the report again with a different name for each. 3. Go back to the first report you created. 4. From the Report menu, click Query, and click the Filter tab. 5. In the Available Components box, double click the Report Columns folder to open it. 6. Double-click the data item you want to appear in the filter expression. 7. In the Available Components box, click "In" or "=", and click the left parenthesis. For example, Product in ( 8. Double-click Prompt Manager in the Available Filter Components box. 9. Click New to create a prompt. 10. In the Prompt Definition dialog box, type a Name and a Message for the prompt. 11. In the Type box, click Report Picklist. 12. Locate and select one of the reports you saved in step 2. 13. In the Report Data box, select the data item that the current report prompts for, click Use, click Display and click OK. 14. Click OK to close the Prompt Manager. 15. Complete the filter definition by double-clicking ")" in the Available Components box, and click OK. For example, Product in (?Product Name?) 16. Open each of the reports you saved (other than the first report you created in step 1), and edit each report so it contains the required data items, and the appropriate filter definition containing the desired prompt. 17. Open the last report and edit it so it is a simple list containing the data item for which the user is prompted. 18. Save the report. When you open the report you created for users, you are presented with the series of prompts and lists of filtered values.

Notes
If a prompt in the current report is based on a report that also contains a prompt, you must respond to the prompt in the referenced report before you can respond to the prompt in your current report.

What You Can Do Using Prompts


You can use prompts to filter reports calculate data items format prompts format data

Filter Reports
Prompts are often used to filter reports. For example, a filter retrieves product information based on the product line captured by the prompt:
Product Line = ?Product Line Prompt?

Each time you open the report, you can enter a different product line, but the filter itself stays the same. Filters that use prompts are more efficient than other filtering methods. A prompt filter is applied when data is retrieved from the database on the first query. Other types of filters apply to existing queries, so Impromptu must access the database again.

Administration Guide 333

Chapter 44: Report Data For information about performance issues, see "Optimize Performance in Impromptu" (p. 435).

Steps
1. From the Report menu, click Query, then click the Filter tab. 2. Create a filter expression up to the point where you want to include the prompt. For information about creating filter expressions, see (p. 319). 3. Do one of the following: To use an existing prompt or create a new prompt, double-click Prompt Manager, select or create the prompt, and then click OK. To use a prompt stored in the catalog, double-click Catalog Columns, select the prompt, and then click OK. The path for the prompt location and the prompt name appears in the Filter Definition box. For example, a prompt called Sales Over the Catalog Prompts folder would look like this:
Sale Amount >= ?\Catalog Prompts\Sales Over?

4. Complete the filter expression, if necessary. 5. Click OK.

Calculating Data Items


Prompts can capture values that are used in calculations. For example, a calculation determines new product prices based on a markup value captured by the prompt:
New Product Price = Product Price + (Product Price * ?Markup?)

Each time you open or run the report, you can enter a different markup value without modifying the calculation itself.

Steps
1. From the Report menu, click Query, and click the Data tab. 2. Click the Calculate button. 3. In the Calculation Definition dialog box, create a calculation expression up to the point where you want to include the prompt. For information about creating calculation expressions, see "Create Calculated Fields" (p. 344). 4. Do one of the following: To use an existing prompt or create a new prompt, double-click Prompt Manager, select or create the prompt, and then click OK. To use a prompt stored in the catalog, double-click Catalog Columns, select the prompt, and then click OK. 5. Click OK to close the Prompt Manager dialog box. Your prompt name appears in the Expression box. For example, a prompt called Sales Over looks like this:
Sale Amount >= ?Sales Over?

6. Complete the calculation expression, if necessary. 7. Click OK. Impromptu shows the Prompts dialog box where you can select a value.

Format Report and Catalog Prompts


To achieve consistency in formatting, the users locale settings in Configuration Manager are used to set the default format of report and catalog prompts that use date and date-time values. The prompt types affected are type-in file picklist report picklist catalog picklist 334 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data Report authors can override the formats globally or set the format of specific data values. For information about changing locale settings in Configuration Manager, see the Configuration Manager User Guide.

Steps to Format Prompts Globally


1. Start Impromptu, and from the Tools menu, click Options. 2. In the Data Type box, click a date or date-time date type. 3. In the Normal box, click the format to use as the default, and click OK. If you select the General option, the format is set to your locale settings. When you specify global settings, the settings only apply to new reports. The settings for existing reports are not changed.

Steps to Format Selected Data Values


1. Click a date or date-time data item in the report. 2. From the Format menu, click Data. 3. In the Normal box, click the format to use as the default, and click OK. If you select the General option, the format is set to your locale settings. Although the General format for interval and time values cannot be changed, the separator characters can be changed. The format for interval values is d hh:mm:ss.sss; the format for time values is hh:mm AM/PM. Locale settings do not affect the prompt format in automated reports. Automated reports still use the ISO format so that report macros remain portable.

Format Data
Prompts can capture values used in conditions that format data. Every time you run a report, you can change the condition description without modifying the condition itself. For example, you create a condition that applies a green background color to all sales amounts greater than the number entered in a prompt. You could enter "500" in the prompt as follows:

The resulting list would have all sale amounts greater than $500 conditionally formatted.

Administration Guide 335

Chapter 44: Report Data

All sale amounts over $500 are highlighted.

Steps
1. 2. 3. 4. 5. 6. Select a data item in the report to which you want to add conditional formatting. From the Format menu, click Conditional Formats. From the Conditional Formats dialog box, click Conditions. From the Conditions dialog box, click Add Custom Condition. Create a condition expression up to the point where you want to include the prompt. For information about conditional text, see "Conditionally Format Data" (p. 354). Double-click Prompt Manager and do one of the following: If the prompt already exists, select it from the Prompt Manager dialog box. If the prompt doesnt exist, click New and create it. Click OK to close the Prompt Manager dialog box. Your prompt name appears in the Expressions box. For example: Sale Amount >= ?Sales Over? Complete the condition expression, if necessary. Click OK. Click Close. In the Change Style To box, select the style you want to apply. Click OK. Impromptu shows the Prompts dialog box where you can select a value.

7. 8. 9. 10. 11.

Summaries
Summaries, like functions, are predefined calculations that perform an operation on one or more values and return a value such as total, count, or average, that summarizes the data. You can use summaries on their own or as part of a larger expression. You can create summaries based on either the report data or the catalog to which the report is attached. If your report contains grouping, and you want your summary to take into account the groups, create the summary based on the report. This ensures that the results returned by the summary reflect the report organization. The key difference between these summary types is that summaries based on a report include an appropriate function (for example the "distinct" clause in SQL) to ensure that only one instance of each value is counted for grouped items.

336 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data For example, you have a list report of your customers addresses that is grouped by Country, City, and Customer. You want a count of the number of customers supported by each of your distribution centers, which are organized by Country. You create a Count summary of Customers based on your report. The result is an accurate count of the customers supported by your distribution centers in each country. Note: If you had created the Count summary based on the catalog, the summary would have returned a count of how often the Customer field was not empty, including all recurrences of the same customer name. For information about creating simple summaries, see the Impromptu online Help. In the Index tab, type summaries You can create more complex summaries using the summaries listed in the Available Components box. All the summaries are available in the Calculation Definition dialog box. You can access this dialog box with the Calculate button (Query dialog box) or the Calculation command (Insert menu).

Summarize Data
Some types of summaries calculate a value for each row in the report. By default, individual row summaries appear in a column of their own. For example, you create the following summary:
Running-total (Total Sale Amount)

The Running-total summary takes the value of a row in the report, adds it to the total of all of the previous rows in the group, and creates a new total in the new calculated column.

Running summaries produce a sorted result that relies on the report sorting. You shouldnt apply further sorting on running summary columns on a report. Some types of summaries calculate a single value for a group of rows. By default, these summaries appear in a group footer. For example, you calculate the average quota for all sales reps within a country. The summary looks like
average (Quota 95) for [Country]

The summary values appear in a separate column, but you move the result into the group footer.

Administration Guide 337

Chapter 44: Report Data You can also place summary values in the group header, however, this can slow down Impromptus performance. For information about performance issues, see "Optimize Performance in Impromptu" (p. 435). Each summary is associated with one of the following: its location in the report, called automatic association a specific data item, called fixed association

Automatic Association
The value of a summary with automatic association changes with the summarys current location in the report. When you add a summary to a report, the summary has automatic association by default. You can tell that a summary has automatic association by its icon in the Group tab (Query dialog box).

For Example
This report displays sales amounts for Canada and Sweden and shows the totals that Impromptu automatically calculates when you add Total (Sale Amount) to your report using the Summary button on the toolbar.

Total (Sale Amount) [for Customer No.]

Total (Sale Amount) [for Customer No.] Total (Sale Amount) [for Country] Total (Sale Amount) [for Report]

If you drag and drop a summary to a different location in the same report, the summarys value changes. For example, if you move Total (Sale Amount) [for Country] to the page header area, the summary becomes Total (Sale Amount) [for Report] and the report no longer contains a Total (Sale Amount) for [Country].

338 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data

Total (Sale Amount) [for Report]

Total (Sale Amount) [for Customer No.]

Total (Sale Amount) [for Customer No.] Total (Sale Amount) [for Report]

Fixed Association
When you add a summary to a query, you can associate the summary to a specific data item in the report or catalog, or to the entire report. If you move the summary, the value does not change. You can tell that a summary has fixed association by its icon in the Group tab (Query dialog box). The lower portion of a fixed summarys icon is blank.

For Example
You include a summary to calculate the Total Sale Amount and you manually specify that the summary is for the customer name. This for clause is hard-coded or fixed in the summary expression, so the summary does not change when you change its location in the report.
The value of this summary does not change when you copy or move it here from its original location.

The summarys association is fixed with Customer Name, regardless of where you copy or move the summary.

Different Summary Results for Grouped Columns


In a grouped report, summary results can be different if the user selects a column from the catalog, when the same column is available in the report. If the catalog column is selected, the summary is applied against all rows in the table disregarding some grouping at the report level.

Administration Guide 339

Chapter 44: Report Data In the first example, the grouping makes the summary results between the two columns different. The first count (Product No.) column is selected from Report Columns and is returning the count of Product No. from the report which is 35. (The screen capture only shows the first four rows). The second count (Product No.) column is selected from Catalog Columns and is returning the count of all Product No. from the catalog which isn't affected by the grouping.

In the second example, the grouping has been removed and both results are the same.

Create a Summary
Steps
1. From the Report menu, click Query, and click the Data tab. 2. Click the Calculate button. 3. In the Calculation Definition dialog box, type a name for the summary in the Name box. This name appears in the Data tab. 4. In the Available Components box double-click Summaries double-click the appropriate summary option add the required data item from the Report Columns or Catalog Columns folder 5. To create an automatic association, skip to Step 7. To create a fixed association, double-click For. 6. Do one of the following: Double-click To associate the summary to

Report Columns, and double-click the data item. A data item that is in your report. Catalog Columns to locate and select the data item, and click OK. Report. A data item that is not in your report. The entire report.

7. Continue to add the necessary expression components, and when the summary is complete, click OK.

Tip
To add a summary directly into your report, click Calculation (Insert menu), position the pointer where you want to insert the calculation, and click the mouse button. The Calculation Definition dialog box appears and you can create a summary.

Choose a Group Level for a Fixed Summary


The group level associated with a fixed summary determines whether one or multiple summary values appear for a group.

340 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data

For Example
The following report has an Average Product Price for Product Line. There is one summary per Product Line. Because there are multiple Product Lines per Product Type, there are multiple Average Product Price summaries per Product Type.

If you want only one Average Product Price summary per Product Type, you can change the association of Average Product Price so that it is fixed with Product Type. There is now only one summary per Product Type and the value reflects the Average Product Price for Product Type

Changing a Summarys Association


You can change a summarys association at any time from fixed to automatic and vice versa. You can also change a summary that has fixed association so that it is associated with a different group. When you change its association, you are changing how the summary column appears in the list report. In list frames, the summary appears once for each occurrence of its associated data item. the summarization results. The summary is calculated for its current associated data item. calculations performed on the associated data item. A summary operation, such as count, ignores data repeated within that group. Only one summary for each group of the associated data item is counted. the association of the summary in the Group tab (Query dialog box). the association in the Association box of the Data Definition dialog box. the order of the report data. The sort order in your report varies depending on the associations you set for the data items in your report. When you sort on An associated data item The report is sorted By the grouped data item with which it is associated For example, if Product Line is a grouped data item and Product is associated to Product Line, Impromptu sorts Product first and Product Line second.

Administration Guide 341

Chapter 44: Report Data When you sort on The report is sorted

By the detail data item A detail data item that is not associated with the grouped data For example, if Product Type is a grouped data item and item Product Price is a detail data item, the details within Product Type are sorted in the order of Product Price. The order of the groups, however, remains unchanged. You can change a summarys association by selecting the summary in the Query Data box (Query dialog box) and clicking Edit Definition.

Note
You can only change the association of a summary that is predefined in the catalog if you have the necessary permissions.

Steps
1. Select a value in the reports summary column, right-click, and click Data Definition. 2. In the Association box (Data Definition dialog box), do one of the following: Select Automatic Report A data item 3. Click OK. To calculate the summary Based on its location in the report For the entire report For a specific data item

Tip
To view the association of a selected summary in your report, look in the status line. For example, Total (Sale Amount) [for Product Type].

Create or Copy a Summary


There is an important difference between making copies of a summary and creating a summary. When a summary has automatic association (its value reflects its location in the report), you get a different result depending on whether you copy the summary or create a new summary. For information about automatic association, see (p. 338).

Copy Summaries
When you copy a summary that has automatic association, and you paste it in another location in your report, you actually copy the text frame within the report. If there is a conflict between the copied summarys group levels, Impromptu calculates the summary for the highest group level. For example, you have a summary, Total Sale Amount, in the City group footer. You make a copy of Total Sale Amount and paste it in the Country group footer (which is higher than the City group). The summary calculates Total Sale Amount for the Country, and both text frames show the Total Sale amount, for the Country. Therefore, the wrong summary value appears in each City group footer.

Create Summaries
When you create a summary, Impromptu inserts a discrete calculation in the query. You must create a new summary for each discrete summary in your report.

342 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data For example, you have a summary, Total Sale Amount, in the City group footer. You want the Country group footer to have a Total Sale Amount, so you create a new summary data item and you associate it with Country. Two summaries appear in your query; each one calculated for a discrete group in your report. The labels following the summary name in the Query Data box (Query dialog box) and the Group Order box (Group tab, Query dialog box) identify these two discrete groups.

Change a Detailed Data Item into a Summary


You may require a summary of a data item in your report rather than the details. Instead of adding a new, summarized data item to the query, you can change the definition of a data item that is already in the report. For example, a report contains the Sale Amount for each Product in an order. You create the summary Total (Sale Amount). This summary shows the total sale amount for each order, rather than the sale amount for each item in an order.
The Sale Amount column contains details.

If you add a summary, the report contains both details and a summary for Sale Amount and the report takes longer to process.

If you change Sale Amount from a detailed data item to a summary, Impromptu does not have to retrieve the details from the database.

Steps
1. In the report, select the data item you want to change into a Summary. 2. Right-click and click Data Definition. The data item you selected in the report appears in the Expression box. 3. In the Expression box, select the data item to highlight it.

Administration Guide 343

Chapter 44: Report Data 4. In the Available Components box, double-click the Summaries folder. 5. Double-click the type of summary you want to create and click OK. Impromptu changes the original definition of the data item into a summary based on the type of summary you chose. By default, the summary has automatic association.

Tips
To insert a catalog summary that has an automatic association into a list footer and a group footer, add the summary data item twice to the Query data (once for each location in the report). To re-use a calculated data item that contains a summary in another report, or to enable other users to use a calculated data item that contains a summary, you can add the calculated data item to the catalog. For information about adding calculated data items to a catalog, see your administrator.

Calculated Fields
A calculated field is a new data item based on a formula that you define. You can use calculated fields created by the administrator or you can create calculated fields of your own You can create simple calculated fields with simple mathematical calculations, such as Product Price * Quantity = Total Cost complex calculations, which may combine existing columns with summaries, functions, and value constants The number and complexity of the calculated fields in your report may affect performance. For information about performance issues, see "Optimize Performance in Impromptu" (p. 435). For example, you are creating an invoice report that contains the order number, the product names, and the quantity of each product ordered. You add some simple calculated fields: Total Sale Amount multiplies the product price by the quantity ordered. Total Profit subtracts the Product Cost column from the Total Sale Amount.

You also create a calculation called Profit Margin Ranges that uses a conditional expression and a data item as follows:
if (Profit < 500) then ('Low') else if (Profit > 500 and Profit < 1000) then (Medium) else ( 'High).

Create Calculated Fields


Use calculated fields to include information in your report that is based on a formula. A calculated field can include any combination of the following: data from your report functions summaries values that you enter

344 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data data from the catalog mathematical operations

Calculated fields are identified by their icon. For information about summaries, see "Summaries" (p. 336). To create a calculated field, you build an expression using the available components in the Calculation Definition dialog box.

Note: You can add calculated fields to the catalog for use in other reports or by other users of the catalog. For information about adding calculations to a catalog, see "Store Calculated Data Items and Summaries in Catalogs" (p. 431).

Steps to Create a Calculated Field


1. Do one of the following to access the Calculation Definition dialog box: Do this If

From the Insert menu, click Calculation, then You ran the report and you know where you click the mouse pointer in the report where want to place the calculated field in the report you want to insert the calculated field. From the Report menu, click Query, click the You do not know where you want to place Data tab, and click the Calculate button. the calculated field in the report, or you just want to add the calculated field to the query Click the Data tab and click the Calculate button. You are in the Query dialog box

2. Type a name for the new calculation in the Name box (Calculation Definition dialog box). 3. From the Available Components box, double-click the components to add them to the Expression box and build your calculation. 4. Click OK to return to the Query dialog box. Note: The types of components that appear at any given time in the Available Components box depend on the previous selection.

Steps to Insert a Predefined Calculated Field from a Catalog


1. 2. 3. 4. Open a report or template. From the Report menu, click Query, and click the Data tab. In the Catalog box, select the calculated field you want to use. Click the Add button to add the calculated field to the Query Data box, and click OK.

Administration Guide 345

Chapter 44: Report Data

What You Can Do Using Calculations


You can use calculations to compare or combine values, or to summarize information. The following examples begin with creating a calculation. For detailed steps, see (p. 345).

Calculating the Interval Between Two Dates


You can calculate the interval between two dates by subtracting one date from the other. For example, you calculate the number of days between the closed date and the order date in order to track the average number of days it takes to close a sale.

Steps
1. Do one of the following to add the first date to the expression: Double-click Report Columns, and double-click a date. If You want to use a date from your report

Catalog Columns, double-click the date from You want to use a date that is not in your the Catalog Folders box, and click OK. report 2. From the Available Components box, double-click "-". 3. Do one of the following to add the second date to the expression: Double-click If

Report Columns, and then double-click the a The date is in your report date. Catalog Columns, double-click a date from the Catalog Folders box, and click OK. The expression looks something like this:
Closed Date - Order Date

The date is not in your report

4. Click OK to close the Calculation Definition dialog box and if necessary, click OK to close the Data tab (Query dialog box).

Find the Rank and Percentile of Calculated Fields


You can calculate the rank and percentile of calculated fields in order. For example, you find the rank and percentile of branches based on their total sales. You then sort the report on the rank column to see the branches with the best sales performance.

Steps
1. Double-click Summaries and double-click Rank. 346 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data 2. Double-click Report Columns and select the calculated field you want to rank. For example: rank (Total Sale Amount) Note: If youre ranking a summarized data item, you must do the summarization before you rank the data item. For information about summaries, see "Summaries" (p. 336). 3. Click OK. 4. In the Data tab (Query dialog box), click Calculate. 5. In the Name box (Calculation Definition dialog box), type a name for the new calculated field. 6. Double-click Summaries and double-click Percentile. 7. Double-click Report Columns and select the calculated field. For example: percentile (Total Sales) 8. Change the data format of the percentile column if necessary: Select the column and click the right mouse button. Click Format and specify the required format. Click OK 9. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Tip
You can perform these operations directly in your report by selecting the column and clicking the appropriate button on the toolbar. If the required button is not on the toolbar, you can customize the toolbar. For information about customizing toolbars, see (p. 449).

Find the Average of Totals for Groups


You can calculate a summary on a summarized data item. For example, you find the total quantity of sales per product as well as the average total quantity of sales per product type. The average total quantity of sales per product type is an example of a summary within a summary.

Steps
1. Double-click Summaries and double-click Average. 2. Double-click Summaries and double-click Total.

Administration Guide 347

Chapter 44: Report Data 3. In the Available Components box, add the required data item from the Report Columns or Catalog Columns folder. 4. Delete the text <numeric column or calculation>. The calculated field looks like this:
average (total(Qty))

5. Position the pointer outside the parenthesis and double-click "for" (Available Components box). 6. Double-click "report" (Available Components box). The calculated field looks something like this:
average (total(Qty)) for product type

7. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Extract Years, Months, or Days from a Date


When you want to display only the year, month or day portion of a date, you can extract the information you need. For example, this function shows only the month portion of order dates
month (order date)

Steps
1. In the report, select the date column from which you want to extract the years, months, and/or days. 2. Right-click and then click Data Definition. The Data Definition dialog box appears with the selected column in the Expression box. 3. In the Expression box, click the column to highlight it. 4. In the Available Components box, double click Functions, and select one of the following: Day to show the day portion of a date Month to show the month portion of a date Year to show the year portion of a date 5. Click OK to close the Data Definition dialog box.

Extract Years, Months, or Days from an Interval


In order to make information easier to interpret, you can round the year, month or day portion of an interval. For example, you can convert a shipping time of 62 days into 2 months using this function:
month-of-ymd-interval(ymdint-between(Date Shipped, Date Received))

Steps
1. In the Available Components box, double click Functions, and select one of the following: Day-of-ymd-interval to show the day portion of the interval Month-of-ymd-interval to show the month portion of a date Year-of-ymd-interval to show the year portion of a date Note: The ymd interval expression only shows the interval in date-time format. 2. To change the interval from a date-time format into the year/month/date format, double-click Functions, and then double-click ymdint-between. 3. In the Available Components box, replace the first date with the required date item from the Report Columns or Catalog Columns folder. 4. In the Available Components box, replace the second date with the required date item from the Report Columns or Catalog Columns folder. 5. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

348 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data

Find the Average Interval Between Two Dates


You can calculate the average interval between two dates by subtracting one date from the other and applying the average summary. To make the information easier to interpret, you can use the year, month or day function. For example, you can calculate the average time it takes to collect payments on invoices using the following function:
average (day (InvSent - Payment))

Steps
1. In the Available Components box, double-click Summaries and double-click Average. 2. In the Available Components box, double click Functions, and select one of the following: Day to show the day portion of a date Month to show the month portion of a date Year to show the year portion of a date 3. Position the pointer after the first date. 4. In the Available Components box, double-click "-". 5. In the Available Components box, add the required data item from the Report Columns or Catalog Columns folder. 6. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Create a Date from a Number


You can create a date from a number. For example, you calculate a date by combining numbers signifying year, month, and date in order to determine the number of outstanding orders to your year end. You calculate the number of days from the order date until year end, which is your anticipated final billing date for all outstanding invoices.

Steps
1. Double-click Functions and double-click Make-datetime. 2. Double-click Number and type the year into the expression. 3. Select <integer_exp2>, double-click Number in the Components box, and type the month into the expression. 4. Select <integer_exp3>, double-click Number in the Components box, and type the day into the expression. 5. Position the pointer outside the parenthesis. 6. In the Available Components box, double-click "-". 7. Double-click Report Columns and double-click Order Date. The expression now looks something like this:
make-datetime (1995,12,31) - Order Date

8. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Use the Current Date in a Calculation


You can use the current date in calculations. You can capture the current date to use in calculations from either the database (Now function) your computer (Today function). For example, you calculate the number of days between the due date for current invoices and todays date in order to determine how many days payment is overdue.

Steps
1. Double-click Functions and double-click Now or Today. 2. In the Available Components box, double-click "-". 3. Double-click Report Columns and double-click the required column. Administration Guide 349

Chapter 44: Report Data The expression looks something like this
now ( ) - Closed Date

4. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Find the Number of Days to the End of the Month


You can determine the number of days left in a specific time period. For example, to establish how many days remain in the current sales period, you calculate the number of days remaining to the end of the current month.

Steps
1. Double-click Functions and double-click Last-of-month. 2. Select <date_exp> and double-click Value in the Available Components box. 3. Double-click Date, and overwrite the default date with the date representing the end of the current month. 4. In the Available Components box, double-click "-". 5. Double-click Functions and double-click Now. The expression now looks something like this
last-of-month (1998-12-01) - now ( )

6. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Combine Data Items


You can combine two data items into a single data item. This procedure is called concatenation. For example, to create a report that lists both the current address and the mailing address for each customer, you combine two strings, CurrentAddress1 with MailingAddress2, into a single string called All Addresses.

Steps
1. In the Available Components box, add the first required string from the Report Columns or Catalog Columns folder. 2. From the Available Components box, double-click "+". 3. In the Available Components box, add the next required string from the Report Columns or Catalog Columns folder. 4. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Note
When Impromptu performs string concatenation locally, the result of the operation is an empty cell (or null value) if any of the strings involved contain null values. This occurs because Impromptu requires any expression involving a null value to return a null value. Many databases ignore any null string when performing concatenation. For example, if you are concatenating string A, string B, and string C, and string B is a null value, the database may concatenate only string A and string C.

Create a Character Data Item from a Number Using If/Then/Else Statement


You can create a character data item from a numeric value using an If/Then/Else statement. For example, you convert a coded number into the days of the week or into the applicable department name. 1. From the Available Components box, double-click If. 2. In the Available Components box, add the first required data item from the Report Columns or Catalog Columns folder. 3. In the Available Components box, double-click "=". 4. Double-click Number. 5. Type the applicable number value into the Expression box and press Enter. 350 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data 6. 7. 8. 9. In the Available Components box, double-click ")". Double-click Value and double-click String. Type the applicable string into the Expression box and press Enter. In the Available Components box, double-click ")". The expression now looks something like this
if (Dept = 02) then (Marketing) else

10. Double-click NULL. 11. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Use a Predefined Filter Condition with an If/Then Statement


You can use an if/then statement to set a specific criterion for filtering. For example, you create a calculation to convert prices to Canadian currency without changing the original American prices:
if Country=Canada then price *1.43 else price

"Country=Canada" is a filter condition, because the action (multiply price by 1.43) is only performed if the country is Canada.

Steps
1. In the Available Components box, double-click Catalog Columns. 2. In the Catalog Folders box, select a condition. Conditions have this icon 3. Build the rest of the expression and click OK.

Create a Character Data Item from a Number Using Lookup


You can create a character data item from a number when you need to make report information more meaningful. For example, you need to indicate gender type on the personnel forms used within your company. Gender types are coded as: 1 (female), 2 (male), and 3 (unknown). You convert the gender code to the appropriate gender type using the following calculation:
lookup (Gender Code) in (1 --> female, 2 --> male) default (unknown )

Steps
1. From the Available Components box, double-click Lookup. 2. In the Available Components box, add the required data item from the Report Columns or Catalog Columns folder. 3. In the Available Components box, double-click ")". 4. Double-click Number. 5. Type a number to overwrite the default 0 value and press Enter. 6. From the Available Components box, double-click -->. 7. Double-click Value and double-click String. 8. Type a string between the quotation marks and press Enter. 9. In the Available Components box, double-click ")". Impromptu adds default to the end of your expression. 10. Double-click NULL. The expression now looks something like this
lookup (Line No) in (4 ->Naturals)default NULL

11. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Create a Character Data Item from a Number Using Number-to-String


You can convert a number to a character data item. For example, you convert a telephone number into a string.

Administration Guide 351

Chapter 44: Report Data

Steps
1. From the Available Components box, double-click Functions and double-click Number-to-string. 2. In the Available Components box, add the required data item from the Report Columns or Catalog Columns folder. The expression now looks something like this
number-to-string (Phone Number)

3. Click OK to close the Calculation Definition dialog box and click OK to close the Data tab (Query dialog box).

Highlight Data
You can format your report to highlight interesting data: Define conditions for formatting that is unique to your report. Create styles that you can use to format data. Assign a style to a condition. Apply a conditional format. Enhance the appearance of your report with 3-dimensional formatting techniques. Use predefined conditions from the catalog. Change the order of conditions. Conditionally show and hide headers, footers and rows.

Create Styles
A style is a defined set of formatting characteristics that you can apply to report objects such as font, size, color, borders, patterns, and data formatting. For example, you want to set up a style that formats numeric values with a dollar sign and two decimal places. You want the column titles to be Arial font, size 14, bold, and have a pattern. Your report now looks like this.

Once you create a style, you can apply it to objects in any of your reports. Styles are not saved with a report but are saved in the Impromptu.ini file.

Tip
To distribute a report containing custom styles, send users the Impromptu.ini file along with the report. For users to see the custom styles, they must replace the Impromptu.ini file on their computer with the Impromptu.ini file sent with the report.

Steps
1. From the Format menu, click Styles. 2. In the Styles dialog box, click Add to add a new style. 3. In the Style Definition dialog box, type a new name in the Style Name box.

352 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data 4. Select the style features you want to set up: Data, Font, Borders, Patterns. Note: The tabs for Data, Font, Borders, and Patterns are only available if you select the corresponding check box on the Content tab. 5. When you finish selecting the formats in the tabs, click OK. 6. To apply this style to selected report objects, click Apply. Otherwise, click Close. You can apply one or more styles to a report object. For information about applying styles, see the Impromptu online Help. In the Index tab, type styles

Applying 3-Dimensional Formatting Techniques


You can combine patterns and borders for report objects to give a three-dimensional appearance. For example, in the following report the frame appears raised because its borders are dark on the right and bottom, and light on the left and top, and it is filled with a light color the text frames appear recessed because their borders are light on the right and bottom, and dark border on the left and top, and they are filled with a dark color

Steps to Make an Object Appear Raised


Select the object you want to format. Right-click and click Format. Click the Patterns tab. In the Pattern box, select the solid pattern. Under Foreground or Background, click Customize, and then, in the Color dialog box, select a light color. 6. Click the Borders tab. 7. In the Border box, click the right line in the border. 1. 2. 3. 4. 5.

8. In the Line box, select a style, such as a thick line, and then click Customize. 9. In the Color dialog box, select a dark color, such as gray or black, and click OK. 10. Click the lower line in the Border box and select the same style and color.

Administration Guide 353

Chapter 44: Report Data 11. Click the left line in the Border box and select a thin style and a light color in the Line box. Repeat the steps for the top line in the Border box. 12. Click OK.

Steps to Make an Object Appear Recessed


1. 2. 3. 4. 5. 6. 7. 8. Click Customize for either the Foreground or the Background box. In the Color dialog box, select a color and click OK. Click the Borders tab. In the Border box, click the right line in the border. In the Line box, select a style, such as a thin line, and then click Customize. In the Color dialog box, select a light color, such as white, and click OK. Click the lower line in the Border box and select the same style and color. Click the left line in the Border box and select a thick style and a dark color, such as gray or black, in the Line box. Repeat these steps for the top line in the Border box. 9. Click OK.

Conditionally Format Data


You can use conditional formatting to identify exceptional data in your report. You can use predefined conditions or create your own conditions. Once you have a condition, you need to assign a style to the condition. Impromptu then formats selected report objects that meet the conditions criteria.

For Example
You want to identify sales representatives who have not met their quota. You create a condition that checks whether each representatives sales for the year is less than their quota for the year: Sales 95 < Quota 95. If the representatives sales are less than the representatives quota, you want the representatives name automatically bolded and highlighted with a border.

Create a Condition
You can create and apply a style to data that meets certain conditions.

Steps
1. 2. 3. 4. 5. 6. 7. 8. Select one or more report objects that you want to format conditionally. From the Format menu, click Conditional Formats. Click Conditions. In the Conditions dialog box, click Add Custom Condition to show the Condition Definition dialog box. In the Name box, type a name for the condition. Use the options in the Available Components box to build an expression. Click OK to close the Condition Definition dialog box. Click Close to close the Conditions dialog box.

354 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data The custom condition appears in the Condition box. The None standard style is assigned to the condition by default. 9. In the Change Style To box, select the style you want for this condition. Note: If the style you want does not exist, you can create it. For information about creating styles, see (p. 352). 10. Click OK.

Change a Condition
You can modify existing conditions in your reports. If you do not have the appropriate privileges to change a predefined condition, you can make a copy and modify the copy.

Steps
Select one or more report objects. From the Format menu, click Conditional Formats. Click Conditions. In the Conditions dialog box, do one of the following: To create and modify a copy of a catalog condition, click Add Catalog Condition, select a condition, and then click OK. To modify a condition in the report, select the required condition. 5. Click Edit in the Conditions dialog box. The Condition Definition dialog box appears. 6. If you are creating a new condition, type a name for the new condition. Then define the condition and click OK. 1. 2. 3. 4.

Assign a Style to a Condition


You can assign a style to a catalog condition or to a custom condition. When you apply the condition, any data that meets the condition is automatically formatted with the style you assigned so that the results stand out. For example, you assign a style to a condition called "Low Margin". It formats low sales with a large green font. You also assign a style to a condition called "High Margin" to format high sales with a large red font.

Steps
1. 2. 3. 4. Select one or more report objects. From the Format menu, click Conditional Formats. Select the condition to which you want to assign a style. In the Change Style To box, select the style, and click OK.

Tips
To remove a style from a condition, select the condition you want to remove. In the Change Style To box, select the None style and click OK. Impromptu applies the None style to the selected report objects. To remove all styles assigned to conditions, click Clear (Conditional Formats dialog box) and click OK. The None style appears in the Style box beside the conditions.

Applying a Conditional Format


You can apply a conditional format to one or more report objects after you create a condition and assign a style to it. For example, you want to highlight high sales for the month of December. You select the Sale Amount column in the report, and create the condition: Sale Amount > 500. You then assign a style to this condition that makes all Sale Amounts greater than 500 display in a red font.

Step
Select one or more report objects and then select the condition to apply from the Condition dialog box (Format menu, Conditional formats).

Administration Guide 355

Chapter 44: Report Data

Change the Order of Conditions


When more than one conditional format is applied to a report object, the formatting assigned to the first condition in the list takes precedence over the formats assigned to subsequent conditions in the list. The order of your conditions can be important, especially if you have conditions with similar expressions. For example, the Qty data item in your report has two conditions: "Greater than Two" has the style Blue Font "Greater Than Three" has the style Red Font If "Greater than Two" is at the top of the Conditions box, then all the Qty data is formatted with the style "Blue Font" because "Greater than Two" takes precedence. You change the order of the conditions so that "Greater than Three" becomes the top condition in the list. The effect of the change is that all quantities that are greater than three are formatted with the style "Red Font", and all the quantities that are greater than two are formatted with the style "Blue Font".

Step
Move the required conditions in the Condition dialog box (Format menu, Conditional Formats).

Conditionally Hide and Show Report Objects


For reports that include sensitive or irrelevant data, you can hide report objects and show them when you want. This is useful when you distribute printed reports. However, when you distribute reports electronically, the users can show any objects youve hidden. Therefore, do not electronically distribute sensitive information as hidden. For information about hiding, showing, and unhiding report objects, see the Impromptu online Help. In the Index tab, type hiding, part of a report showing, part of a report You can define conditional formats that automatically hide headers, footers, or entire rows.

For Example
You have a grouped report that contains details and a summary for each group. For some groups with only one row of details, the summary in the group footer is the same value as the value in the detail row. You set up conditional formatting that hides the group footer if there is only one row in a group. The Total Sale Amount and the total in the group footer are the same when there is only one order number for a customer, so you conditionally hide the group footer when there is only one row in the group. The expression for this condition is
(count (Order No.) for Customer No.)=1

356 IBM(R) Cognos(R) Impromptu(R)

Chapter 44: Report Data

The row and group footer display the same totals.

The conditionally hiding the group footer eliminates the repetition.

Steps
1. 2. 3. 4. Select the header, footer, or any rows that you want to hide based on a condition. Right-click and click Conditional Formats. In the Conditional Formats dialog box, click Conditions. Do one of the following: Do This Click the condition and click Close Add Catalog Condition. Click the predefined condition, click OK, and Click Close In the Change Style To box, click the Hidden style, and click OK Add Custom Condition Create the expression, click OK, and click Close In the Change Style To box, click the Hidden style, and click OK. The condition you want to apply to the selection does not exist If The condition you want to apply to the selection is in the Conditions box The condition you want to apply to the selection exists in the catalog

Administration Guide 357

Chapter 44: Report Data

358 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats


This chapter discusses some of the advanced formatting techniques you can use to make your reports more readable highlight important findings

Formatting Techniques
There are several ways to add formatting to your reports to enhance their readability and their general appearance. You can customize data and object formats apply templates add frames to your reports

Data Formats and Locale Settings


Data formats depend on the locale configuration settings for your IBM Cognos Series 7 product. By default, IBM Cognos Series 7 server products and IBM Cognos Impromptu use a data format configuration file named cerlocale.xml. IBM Cognos Architect, IBM Cognos Visualizer, IBM Cognos PowerPlay for Windows, and IBM Cognos Transformer use Windows Regional Settings for locale settings and data format information. However, these products can also be configured to use the data format configuration file. For information about managing data formats, copying data format information, or editing the data format configuration file, see the Configuration Manager User Guide, or contact your administrator.

Customize Data and Objects


The default format applied to report data is based on the format the data has in the database and your locale settings. For more information about locale settings, see "Data Formats and Locale Settings" (p. 359). You can also customize the data formats for your reports. Formats can be applied globally to all reports or to specific data items. Use This Data type Positive Negative Zero Missing Currency Symbol To Set A data type to format. A format to apply to positive numbers. A format to apply to negative numbers and intervals. A format to apply to numbers and intervals that are zero. A format to apply to numbers, characters, dates, times, date-times, and intervals that are missing. An explicit currency symbol for numeric values that persist with the data or set the currency symbol to default to the users locale setting. For information about modifying locale settings, see the Configuration Manager documentation.

Administration Guide 359

Chapter 45: Report Formats You can: set a default format for numeric values. For example, use the format "0,000", to show the data "1234.56" as "1,235". set numeric values to default to the users locale using the Number option in the Positive list. The Number option applies to the following data types: integer, short integer, decimal, float, double and quad. Tip: To determine the data type of a number, in Impromptu Administrator version, from the Report menu, click Query, and then in the Profile tab, click Query columns. set a default currency format for numeric values. For example, use the symbol, , to show numeric values as 250,00 or 250.00. Or, set the currency symbol to default to the users the locale using the Default option in the Currency Symbol list. set a default format for character values. For example, use the format ""Today is" DDDD, MMMM, D" to show the date as "Today is Wednesday, January 1". set a default format for date values. For example, use the format "D.MMM.YY DDDD" to show the date as "15.Jan.98 Wednesday". set a default format for time values. For example, use the format "HH.MM.SS am/pm" to show the time as "01.23.45 PM". set a default format for date-time values. For example, use the format "DDD, HH:MM am/pm" to show the date as "Wednesday, 11:30 am". set a default format for interval values. For example, use the format "DD "Days" HH:MM:SS" to show the date as "123 Days 04:30:28".

Steps to Customize Data Globally


1. From the Tools menu, click Options. 2. Click the Data Format tab, and in the Data type box, click a data type. The options available for the data type appear. 3. Set the format to use as the global default, and click OK. When you specify global settings, the settings only apply to new reports. The settings for existing reports are not changed.

Steps to Customize Selected Data Values


1. Click a data item in the report. 2. From the Format menu, click Data. The options available depend on the data item selected. 3. In the Data tab, specify a data format. Use Number to format numbers using the locale settings. Currency and click a currency format in the Currency Symbol list. Using Default in the Currency Symbol list sets the format to the users locale. 4. Click OK.

Default Object Formats


To customize objects in your report, you can set a default font so that text in a text frame is always formatted the same way. set a default border for report objects. By default, all objects (except text frames) have a border. You can set a different border, or have no border by default. set a default pattern for report objects. You cannot add a pattern to chart frames, OLE objects, or picture frames. Use This Object types Font To Set The object type to use as the default format The type, style, size, effects, and color of the font

360 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats Use This Borders Patterns To Set The location, line style and color or a border The pattern, foreground, and background colors

Define Report Layouts with Templates


A template is a pattern you can use to build reports. It is like a report without any actual data. Using templates to create new reports can save time and effort, particularly when you or other template users frequently need the same type of report. A template can contain any or all of the following report objects: formatting placeholders text pictures frames macros report variables, such as the date or time that the report was created calculations summaries OLE (Object Linking and Embedding) objects You cannot include the following items in a template: sub-reports calculated data items that are stored in the catalog filter conditions that are stored in the catalog any prompts (picklist or type-in), whether or not they are stored in the catalog Templates can increase productivity for the users because the design work is already done facilitate standardized reporting by applying pre-defined formatting enable users to create sophisticated reports that might otherwise be beyond their skill level For information about using templates to create reports, see the Impromptu online Help. In the Index tab, type creating, reports with templates

What are Placeholders?


Templates use placeholders to represent the data items that should appear in the report. For example, a mailing labels template can contain placeholders for name and address. This helps those who use a template to understand how to complete the report. You can group and sort placeholders in a template, just like data items in a report. Placeholders are data independent and allow you to assign a specific data type to each placeholder. As a result, they are useful when you use one template to create different reports based on data from different catalogs. Placeholders can accept data items of any data type or of a particular data type. Placeholders can be defined as no specific type numeric character date time Administration Guide 361

Chapter 45: Report Formats date-time interval text-blob required (they must be filled), or optional accepting only one data item, or accepting one or more data items

You can also define a placeholder so that it does not appear in a report but remains in the query.

Required placeholder

For information about adding placeholders to a template, see (p. 365). For information about filling placeholders in templates, see the Impromptu online Help. In the Index tab, type templates, creating reports with

Set a Default Template


You can select the template that you use most often and click the Set as Default button (New dialog box). Then when you click the New toolbar button or create a new report using the Report Wizard, this template automatically appears.

Customize the Templates Preview Image


In the Open dialog box, by default, Impromptu generates a preview image based on what the selected template looks like. You can customize the preview image, to more easily distinguish templates.

For Example
Each preview image includes an icon that shows the data source, such as a database or a snapshot. The following preview image shows a list style report that uses a snapshot (as indicated by the snapshot icon in the lower right corner) as its data source:

data source

The following preview image shows a list style report that uses a database (as indicated by the database icon in the lower right corner) as its data source:

362 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats

data source

You can customize the preview image so it shows a different image, such as the report title:

Steps
1. 2. 3. 4. Open the template (or report) for which you want to customize the preview image. From the Report menu, click Preview. Clear the Automatic Image Generation check box. Do one of the following: Do this To

In the Preview tab, click Copy and click OK. Paste the Modify the existing preview image image into a graphics application and edit it. In a graphics application, create a new image. Create a new preview image

5. Select and copy the new image to the Clipboard (Ctrl+C). 6. In Impromptu (Report Properties dialog box), click Paste, and click OK. Save the report and close it. Impromptu now uses the new preview image for this report in the Open dialog box.

Notes
You can use a graphics program to customize a preview image. You can either alter the default image or create a new image. You can follow the same steps to customize a reports preview image.

Set the View for Templates


You can specify the default view for a template (page layout or screen layout). Use screen layout for screen-only reports. The advantages of the screen layout view are that you can move a column from one page to the next if your report is too wide to fit on one page (which cannot be done in page layout view) and that there are no margins to reduce the visibility of the report. Use page layout view for reports that are destined for the printer.

Create Effective Templates


You can create a template for a list report a chart report forms, such as form letters and mailing labels a crosstab report

Administration Guide 363

Chapter 45: Report Formats A crosstab template contains placeholders for the rows, columns, and cells. When you fill in the placeholders, Impromptu groups the data items in the rows and columns, and summarizes the data items in the cells. You can create a nested crosstab report by allowing each placeholder to accept more than one data item. For a step-by-step tutorial on creating a nested crosstab, see Discovering Impromptu. Template file names end with the extension .imt rather than the .imr extension that Impromptu uses for reports. Impromptu automatically adds the .imt extension when you create and name a template. There are different ways to create a template. You can create a template from scratch save a report as a template

Create a New Template


When you create a new template, you begin with an existing template or the Blank template. You can then add placeholders, frames, objects, and formatting. If the template upon which you base the new template contains placeholders, objects, or formatting, you can edit or delete them as necessary.

Steps
1. From the File menu, click New. 2. Click the Template option button in the Create New box. 3. Select a template, and then click OK. If the template you select contains placeholders, they appear on the screen. 4. Customize your template. Add, calculate, edit, remove, or insert placeholders. For information about creating placeholders, see (p. 365). Add frames, format frames, or remove frames in a template. For information about frames, see "Create Complex Layouts with Frames" (p. 369). Format the template. Set the layout of the template. 5. From the File menu, click Save to save the template with the same name, or click Save As to save the template with a different name.

Tip
To save time when you create a template, begin by selecting an existing template that closely resembles the template you want to create. For example, to create a mailing labels template, you can start with an existing mailing labels template and modify it to meet your needs. This is faster than starting with the Blank template.

Save Reports as Templates


As well as creating a template from scratch, you can turn any report into a template. All the data items in the report automatically become placeholders and the template has the same formatting, grouping, sorting, and filtering that the report had.

Steps to Save Reports as Templates


1. Open a report. 2. From the File menu, click Save As. The File Name box shows a default file name. 3. If you do not want to use the default file name, type a new name in the File Name box. 4. Select Templates (*.imt) from the Save as Type box, and click Save. You can edit a list template (.imt) and change it into a crosstab template. This can save you time if you already have a template that contains all or most of the placeholders and formatting you require.

364 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats When you create a crosstab template, you can specify the placeholder locations on the Template tab by selecting each placeholder and clicking the Rows, Columns, or Cells button.

Steps to Change a List into a Crosstab Template


1. 2. 3. 4. 5. From the File menu, click Open. In the Files of Type box (Open dialog box), select Templates (*.imt). Select the list template you want to change and click Open. From the Report menu, click Query. Click the Crosstab Template button. Note: All the placeholders from the list template appear in the crosstab rows, columns and cells. 6. The following steps are optional: Do this Ensure that the Summaries check box is selected for the columns Ensure that the Summaries check box is selected for rows To Include column summaries Include row summaries

Click Placeholder in the Select a Type box Create a new placeholder and move it into the row, column or cells box Click Calculation in the Select a Type box Create a calculated placeholder. and move it into the row, column or cells box For information about creating calculated placeholders, see (p. 367). 7. Click OK.

Notes
You cannot use either multi-column or optional placeholders in filters. You can only use one multi-column placeholder in calculations. You can drag and drop a placeholder from the Select a Type box to the Rows, Columns, or Cells box. You must have at least one required placeholder in the Columns box and the Cells box. All required placeholders appear in bold. To check the properties of a placeholder, select it and click Edit. Ensure that the Optional Placeholder check box (Placeholder Definition dialog box) is cleared for all required placeholders.

Create Placeholders
Placeholders are markers in a template that tell users what data items they should add to the report. A placeholder can show which data item the user should fill it with. It can also perform a calculation using the data item the user fills it with, and show the result in the report. You can set up a placeholder to be optional or required accept only one data item, or one or more The user can fill the placeholders in any order and skip optional placeholders altogether. If you do not want the data item that a placeholder contains to appear in the final report (because, for example, you need the item for a calculation, but it is otherwise irrelevant to the report) you can choose not to generate the placeholder in the report.

Administration Guide 365

Chapter 45: Report Formats

Steps
1. Open the template. 2. From the Report menu, click Query. The following Template tab appears.

3. Click Add. The Placeholder Definition dialog box appears.

4. Type a label in the Label box. The label appears in the Query Data box (Data tab, Query dialog box) or the Rows, Columns, or Cells boxes (Crosstab tab, Query dialog box). The Label box is required when you create a filter or calculation that uses the placeholder. 5. Type the prompt text in the Prompt box. When you create a report using this template, Impromptu shows the prompt in the Data tab (Query dialog box) to indicate which data item should replace the placeholder. The Prompt box is optional. If you leave it blank, Impromptu shows the text you entered in the Label box. 6. Select a data type from the Data Type box. Note: You cannot use placeholders with the No Specific Type data type in calculated data items or filters. 7. Define the placeholder as required: If you want the placeholder to be optional, select the Optional Placeholder check box. If you want the placeholder to accept more than one data item, select the Can Be Filled By More Than One Column check box. If you dont want the data item that the placeholder contains to be displayed in the report nor added to the query, select the For Calculations Only check box. 366 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats 8. Click OK. 9. Repeat steps 3 to 9 to add more placeholders to your template. 10. Click OK.

Notes
You cannot use either multi-column or optional placeholders in filters. You can only use one multi-column placeholder in calculations.

Placement of Multi-Column Placeholders and Associated Summaries


How Impromptu inserts multi-column placeholders depends on the type of frame. If you insert a multi-column placeholder into a Text frame contained in a form frame

Impromptu Duplicates the text frame for each data item contained in the placeholder. If the form frame is scoped on a grouped data item, then only the data item used to scope the data will be inserted. Inserts each data item contained in the placeholder as a column to the right of the original. Duplicates the header or footer and all formatting associated with it for each data item contained in the placeholder. Note: If the placeholder is aligned with a list column, all the inserted columns will have the same alignment.

List frame Group header or footer in a list frame

Chart frame

Displays each column contained in the placeholder. Note: Data items that cannot be displayed in a chart are not added to the chart data.

Picture frame

Duplicates the picture frame for each data item contained in the placeholder.

When you insert a multi-column placeholder and its associated summary into a report, a summary is created for each data item contained in the placeholder. Each summary is aligned with its respective data item.

Modifying Existing Placeholders


You can change a placeholder in a template. For example, you change the prompt text that appears in the Data tab (Query dialog box) by changing the prompt you specified for the placeholder.

Steps
1. From the Report menu, click Query, and click the Template tab. 2. Select the placeholder you want to change, and click Edit. 3. Make the changes you want in the Placeholder Definition dialog box, and click OK. For information about the Placeholder Definition dialog box, see (p. 365). 4. Click OK.

Create Calculated Placeholders


Calculated placeholders enable you to include standardized calculations in your reports. You can create placeholders for numeric data and complete a calculation using these values. The results appear in the report. The template user cannot fill in calculated placeholders with data items. Administration Guide 367

Chapter 45: Report Formats For example, a Margin by Product report contains the following placeholders: product cost price margin, which is the calculation: "price - cost" % margin, which is the calculation: "((price - cost) / price) When report creators use this template, they only have to replace the following placeholders with data items: product cost price Impromptu automatically adds the margin and % margin calculations to the query.

Steps
1. 2. 3. 4. 5. 6. 7. Open a template. From the Report menu, click Query. In the Template tab, click Calculate to show the Calculation Definition dialog box. Type a name for the calculated placeholder in the Name box. Build a calculation expression. Click OK to close the Calculation Definition dialog box. Click OK to close the Query dialog box.

Notes
You cannot use placeholders of the No Specific Type data type in calculations. Calculations can only reference one multi-column placeholder (a placeholder with the Can Be Filled By More Than One Column check box selected in the Placeholder Definition dialog box). For information about building calculated data items, see "Create Calculated Fields" (p. 344).

Insert Placeholders
Once you create a placeholder, you can insert it on the report where you want the real data to appear.

Steps
1. From the Insert menu, click Data. Your pointer changes. 2. On the template, position the pointer where you want the upper-left corner of the placeholder. 3. Click and drag the mouse diagonally until the placeholder is the size you want. Release the mouse button to show the Template tab (Query dialog box). 4. Click the placeholder. A placeholder is identified by a placeholder icon. 5. Click Mark for Insertion. A placeholder that is marked for insertion is identified by an insertion icon. 6. Click OK. Impromptu shows the placeholder in the location you specified. Note: By default, the label in the Label box appears as the column header in list reports. The prompt in the Prompt box appears in the template's Query Data box.

368 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats

Link Column Titles to the Name of Query Data Items


When you create a placeholder, the name you give that placeholder appears in the report column title. You can also set up the placeholder so the name of the query data item appears in the report column title. For example, you create placeholders called Name and Description. Each user of this template fills the placeholders with different data items. For example, if a user fills the Name placeholder with Customer Name, and the Description placeholder with Customer Note, the report column titles are Customer Name and Customer Note. When you link the column title to the name of the data items, the column title is automatically updated if the name of the data changes. When you enter a name for the column, the title remains the same until you change it.

Steps
1. 2. 3. 4. 5. Select the column title. From the Format menu, click Properties. Click the Column Title tab. Select the Link the Column Title Text to the Name of the Query Data Item check box. Click OK.

Create Complex Layouts with Frames


Frames are containers for report objects such as data, text, pictures, and charts. You can use frames in your reports to organize complex data into a more readable form. You can use the following types of frames to create reports: This type of frame List frame Form frame For more information See (p. 374) See (p. 375)

Contains Data items and other report objects in a tabular row and column format. Other report objects, including other frames. You can create a form frame report or insert a form frame in another frame. A visual representation of data such as a pie chart.

Chart frame Text frame

See (p. 378)

Data items or text that you enter. You can edit the text See (p. 379) that you enter into a text frame but you cannot edit a text frame that contains a data item. A static graphic (such as a company logo that doesnt change) or a dynamic graphic (such as a unique product photo for each product number). See (p. 380)

Picture frame

Object Linking and Embedding (OLE) frame

An object such as data, pictures, charts, and so on from See (p. 401) an OLE-compliant application. If the OLE frame is linked to the source application then the information in the frame automatically reflects changes made in the source application. Impromptu treats an OLE object as a default frame.

Sub-report frame

The results of several reports combined into one report. See (p. 390)

The following report includes several types of frames.

Administration Guide 369

Chapter 45: Report Formats

Form Frame Text Frame Picture Frame List Frames Chart Frame

Frame Properties
The properties of a frame determine the format, size, alignment of data within the frame, location of the frame, and how much data is displayed in each frame. Refer to the table below for a description of each frame property available in the Properties dialog box (Format menu). Use the Align tab Size tab Layout tab To Set the vertical and horizontal position of the frame. Set the vertical and horizontal size of the frame. Set the scope of data in a form frame and position the frame on the page. Set the justification and the line control for a text frame. Add or remove headers and footers, set page breaks, control page numbering, and show or hide scroll bars for a list frame. Printing tab Hide frames on the printed page. You can also use the Printing tab to see which columns in a list frame are repeated on every printed page. Data tab Format tab Source tab Crosstab tab Determine which data is displayed and how it is displayed. Select a chart style and format the appearance of a chart. Select a source for a picture frame, or load picture files using file names from your database. Sort crosstab rows and columns in the order specified in the Query dialog box.

The Parent/Child Relationship


When you insert frames into a report or into other frames, Impromptu keeps track of which frames belong to which frame. A frame that contains another frame is the parent frame. The child frame only uses the data available to the parent frame. You can use this relationship to control the data that is available to subordinate frames and report objects. For example, you create a chart frame, picture frame and a list frame that are contained within a form frame. The form frame is the parent and the chart, picture and list frames are each child frames.

370 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats

Parent Frame

Child Frames

This is useful for building reports like invoices or orders where data in one section of the report depends on the values in other sections of the report.

Designate a Primary Frame


Impromptu automatically inserts data into the primary frame if no other frame is selected. By default, the first form frame, list frame, or text frame that you insert into a report is designated as the primary frame. When you work with templates the primary frame is the default container for any placeholders. For information about templates, see (p. 361). If you set a report to have no primary frame, Impromptu disassociates the report from the database query. That is, when you create a query, Impromptu does not automatically insert the data items in the query into your report. Instead, you must select the frame into which you want to insert data items. This can be useful when you want total control over where data is placed when you insert it into the report from the query, or when you do not know which frame should contain the data. A list frame should be the primary frame for a crosstab report.

Steps
1. From the Report menu, click General. 2. In the Primary Frame box on the General tab (Report Properties dialog box), select a frame as the primary frame and click OK. To set a report to have no primary frame, select (none) in the Primary Frame box.

Insert a Frame
Inserting one or more frames is the first step to create a template or new report.

Where Impromptu Inserts the Data in Frames


The following table describes how Impromptu inserts data items into frames: If you insert data into a Form frame

Impromptu adds the data At the position where you clicked the mouse button.

Administration Guide 371

Chapter 45: Report Formats If you insert data into a List frame

Impromptu adds the data At the highlighted position. If the space between two adjacent columns is highlighted then Impromptu adds the data item as a new column. If the group header or footer is highlighted, then Impromptu adds the data item to the group header or footer. If you position the pointer over a page header or footer, then Impromptu adds the data item to that page header or footer. Into the list of data items for the chart frame. Note: To add new data items, from the Format menu, click Properties. In the Chart Data box (Query tab), add the new data items.

Chart frame

Text frame

At the beginning of the text frame.

Tip
To identify a frame type, click Boundary Lines (View menu). You can insert frames or report variables such as Date and Time, into form frames list frames Not all frames can contain other frames. You cannot insert frames into chart frames picture frames text frames Although you cannot insert frames and report objects into text frames, you can combine text frames with one another. For information, see "Combining Text Frames" (p. 380). Note: For information on modifying the different SQL queries that can appear in frames, see "Edit Sub-Report Queries" (p. 392).

Steps
1. From the Insert menu, click a frame type. 2. On the report, position the pointer where you want to locate the upper-left corner of the frame. Your pointer changes according to the frame type you selected. 3. While holding down the mouse button, drag the mouse diagonally until the frame is the size you want, and then release the mouse button. One of the following occurs: Icon Inserts Form frame This happens An empty form frame appears.

List frame

An empty list frame appears.

Text frame

The flashing I-beam appears where you can begin inserting text.

372 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats Icon Inserts Picture frame This happens The Source tab (Picture Properties dialog box) appears. You can use this tab to select the image (.bmp,.dib) to include in the frame. The Data tab (Chart Properties dialog box) appears. You can use this tab to select the data item to include in the chart. For information about using this tab, see (p. 378). The Insert Object dialog box appears where you can locate and select the file you want to insert, or you can create a new object using the software listed in the Object Type box.

Chart frame

OLE Object

Select a Frame
You may want to select a frame so that you can move or resize it add a border or pattern to it insert data items or placeholders change its basic properties (such as its name) change its stacking order within the current report control the vertical and horizontal alignment and position set printing characteristics that hide the frame on specific pages in a multi-page report Note: Page header and footer frames are always hidden in Screen Layout view view the query for a sub-report For information about sub-report queries, see (p. 392).

Step to Select an Individual Frame


Click anywhere in the frame. Handles appear indicating that the frame is selected.

Steps to Select Multiple Frames


1. Position the pointer on the frames you want to select. While holding down the left mouse button, drag the mouse until all the frames you want to select are partially crossed by the selection rectangle. 2. Release the mouse button. All the report objects whose borders were touched by the selection rectangle are now selected.

Step to Select All the Frames and Objects in a Report


From the Edit menu, click Select All. Impromptu selects all of the frames and report objects.

Tips
To select a parent list frame or a form frame that is completely filled with subordinate report objects, click anywhere within the parent object. Then click Select Parent (Edit menu), or click the Select Parent button.

Assign Names to Frames


Reports and templates can contain a large number of frames and other report objects. At any time, you can view the names of the frames in your current report.

Administration Guide 373

Chapter 45: Report Formats When you insert new frames into a report, Impromptu assigns names based on the frame type such as "List Frame", "Text Frame", and so on. For example, you insert the first chart frame into a report and Impromptu assigns the name "Chart Frame". When you insert a second chart frame Impromptu assigns the name "Chart Frame 1". You can view the names of the frames in your current report at any time. You can also give each frame in your report a more meaningful name.

Step to Show Frame Names for all Frames in a Report


From the View menu, click Boundary Lines. Impromptu shows the frame name in the upper-left corner of each frame in your report.

Steps to Change the Name of a Frame


1. Select the frame whose name you want to change. 2. From the Format menu, click Properties. 3. In the Name box, enter a meaningful name for the frame and click OK.

List Frames
Using list frames, you can create many different types of reports. For example, you can use list frames to create detailed reports such as Product Inventory or to create summary reports such as Total Sales Per Product Line. A list frame can make up the entire report. To see an example, open the sample report named Singlepage.imr. be inserted into other frames. To see an example, open the "Annual Product Sales" sample report. be inserted as a sub-report. For information about sub-report list frames, see "Link Sub-Reports" (p. 393). List frames can be resized, moved, and formatted. You can sort, filter, group, or perform calculations on the data in a list frame. You can also specify custom formatting for all report objects in the list insert other frames (such as form frames, chart frames, text frames, or picture frames) and report objects into a list frame link column titles in a list frame to the names of query data items perform summary operations on the columns in a list frame

Insert Data
You can insert data items into a list frame to present your report data in rows and columns.

Steps
1. From the Insert menu, click Data. Your pointer changes. 2. Click the mouse button anywhere in the list frame. The Data tab (Query dialog box) appears. 3. In the Query Data box, select the data items that you want to add to the list frame. 4. Click the Mark for Insertion button. Data items marked for insertion are identified by an insertion icon. 5. Click OK.

Insert Report Objects


You can insert any type of report object into a list frame.

Step to Insert a Report Object in a List Frame


Drag and drop the existing report object onto the list frame.

374 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats

Steps to Insert a New Report Object in a List Frame


1. From the Insert menu, click the report object that you want to add to the list frame. The pointer changes depending on the type of report object you chose. 2. Within the boundaries of the parent list frame, but not over any existing cells, position the pointer where you want the upper-left corner of the report object you are inserting. 3. Hold down the mouse button and drag the mouse diagonally within the boundaries of the parent frame until the new report object is the size you want and release the mouse button.

Notes
If you want Impromptu to set the size of the new report object, click the mouse button where you want the upper-left corner of the report object. Impromptu inserts the new report object at the point where you click the mouse. Avoid inserting a frame or report object into the detail area of a list frame because the frame or report object is repeated for each row in the list.

Form Frames
Form frames are the basic building blocks for many common reports such as invoices, order forms, checks, mailing labels, and packing slips. A form frame can also be inserted into a report as a sub-report. With a form frame, you can insert any type of data item or report object, including placeholders and other frames (child report objects) align child report objects with one another and with the boundaries of the form frame limit the scope of data logically group related data items such as customer address, product descriptions and product codes repeat the form frame horizontally and vertically to show or print multiple copies of the form frame format the form frame with borders and patterns hide form frames on specific pages of a report For information about hiding frames on specific pages of a printed report, see "Conditionally Hide and Show Report Objects" (p. 356).

Notes
The Blank template consists of one form frame called the Report Body. Impromptu uses form frames for the headers and footers it automatically creates.

Insert Data
You can insert data into a form frame when you want to limit the scope of data, or logically group related data.

Steps
1. From the Insert menu, click Data. Your pointer changes. 2. Click the mouse button anywhere in the frame. The Data tab (Query dialog box) appears. 3. In the Query Data box, select the data items that you want to add to the form frame. 4. Click the Mark for Insertion button. Data items marked for insertion are identified by an insertion icon. 5. Click OK. Note: By default, you see only the first data item in the form frame.

Administration Guide 375

Chapter 45: Report Formats

Tip
To make the form scrollable, set the scope of the form frame to Single Row of Data or Data in a Group (Layout tab, Form Properties dialog box). For information about setting the scope of a form frame, see (p. 376).

Insert Report Objects


You can insert any type of report object into a form frame. You can also use a form frame to group existing report objects. To do this, drag and drop the selected report objects into the form frame. Impromptu makes the existing form frame the parent frame of the selected report objects.

Step to Insert a Report Object into a Form Frame


Drag and drop the existing report object into the form frame.

Steps to Insert a New Frame into a Form Frame


1. From the Insert menu, click a frame type. The pointer changes to reflect the type of frame or report object you chose. 2. Within the boundaries of the form frame, position the pointer where you want the upper-left corner of the report object. 3. Hold down the mouse button, and drag the mouse diagonally until the form frame is the size you want and then release the mouse button.

Notes
You can align report objects to one another or to the boundaries of the parent frame. When you group report objects, a form frame is inserted around the grouped report objects. For information on aligning and grouping report objects, see the online Help. In the Index tab, type aligning, parts of a report grouping, parts of a report

Set the Scope of the Data for a Form Frame


The scope of data determines what data appears in a form frame. Scope of data is a powerful property that you can use to create form frames that automatically show specific subsets of data. By scoping the data, the child frames within the parent form frame can access only the data specified in the properties of the parent form frame. For example, when you put a list frame inside a form frame, you can limit data values in the list to the current row of data in the query.

You can also restrict data items in a form frame to the values for a specific grouped data item such as Customer Name. Setting the scope of data to a specific grouped data item limits the data that appears in the form frame to just the grouped data items.

376 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats

If you do not want to establish any special relationship between the form frame and the values it shows, you can set the scope to All Data.

Steps
1. Select the form frame for which you want to set the scope of data. 2. From the Format menu, click Properties, and click the Layout tab. 3. In the Scope of Data box, do one of the following Click Single Row of Data To Show one row of data at a time in each form as you scroll through the report.

Data in the Group and select a grouped data Show all rows that are associated with the item from the Data in the Group box grouped data item, such as a Product. All Data Show all the data that the form frame can access.

4. Click OK.

Repeated Form Frames


You can repeat a form frame horizontally and vertically across the screen or page to view or print multiple copies of a form frame. This is useful when you create a report where a specific number of form frames must fit within the boundaries of the report body. For example, you create a single form for address labels. The single form occupies the entire height and width of the report body, and you have Impromptu partition it into a 3 x 4 matrix of identically sized form images that fit exactly within the boundaries of the form. You can automatically generate multiple, identical form frames within the selected form boundary.

Note
You cannot repeat a form frame that has been scoped to All Data.

Steps
1. 2. 3. 4. 5. 6. 7. 8. Create a form frame in the report within which you want to show multiple form images. Select the form frame that you created in step 1. From the Format menu, click Size. In the Width box, select Snap to Parent. In the Height box, select Snap to Parent. Click the Layout tab (Form Properties dialog box). In the Scope of Data box, click Single Row of Data. In the Tile box, do one of the following: Indicate the number of times that you want to repeat the form by clicking the form image buttons. Type the number of horizontal and vertical forms underneath the form image buttons. Administration Guide 377

Chapter 45: Report Formats For example, if you click the button in the fourth row, third column, or enter 4 by 3, then the form repeats 12 times in a 4 by 3 matrix. You can repeat a form up to 4 times horizontally and 4 times vertically for a maximum of 16 form images using the form image buttons.

Note: The number you type for the horizontal and vertical forms can exceed the number of form image buttons. For example, you can type 6 by 6. 9. Click OK. Impromptu automatically tiles the form frame to repeat the number of times you specified and fit exactly within the boundaries of the parent frame.

Chart Frames
A chart is a visual representation of data that you can use to quickly and easily evaluate information. Use charts to uncover trends, correlations, and exceptions. The chart changes automatically when the data changes. For instructions about inserting a chart frame, see Impromptu User Reference.

Assign Data
Using the Data tab, you pick the available data from the Query Data box that you want to appear in the chart. You can also customize the chart by pivoting the data in the chart or changing the data mode to present a different perspective of your data. For example, you create a chart to report your companys sales over the last four years.

Steps
1. From the Insert menu, click Chart Frame. 2. Place the pointer where you want to locate the upper-left corner of the frame and drag the mouse diagonally until the frame is the size you want. The Chart Properties dialog appears. 3. In the Chart Type box, click the chart type. The chart type sets whether you can plot one or more data values. 4. On the Data tab, use the right arrow to move data items from the Query Data box to the Primary Axis, Secondary Axis, and Measure(s) boxes, as required. Only numeric data items appear in the Query data box. Tip: To remove a data item, click the left arrow. 5. On the Data tab, do one or more of the following. Goal Action

Show in a chart the first row in a grouped In the Mode box, click By Row. data item. Show in a chart the first column in a grouped data item. Swap rows and columns. You must have at least one grouped data item. In the Mode box, click By Column. Click Pivot Data. If you swap rows and columns in a chart that is grouped by rows, it becomes grouped by columns.

378 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats 6. Click OK.

Formatting a Chart
You can format a chart to improve readability and presentation by changing the chart style, background color, and adding grid lines. You can also add and remove labels for the data in a chart, and specify the format for the labels, such as bold, font type, and size. For information about these topics, see the online Help. In the Index tab, type formatting, charts formatting, chart legends

Text Frames
You use text frames to add text or data items to a report. A list frame is made up of rows of text frames. For information about inserting text into your report, refer to the online Help. In the Index tab, type adding, text

Sorting or Grouping on Binary Large Objects (BLOBs)


When you put BLOBs in text frames you cannot view the text when you sort or group on your computer rather than in the database. When this occurs, the words "Text not available" appear in the text frame for the BLOB. For information about grouping locally and on the server, see "Client/Server Balancing" (p. 436).

Format the Contents of a Text Frame


You can make text in a text frame either appear on a single line on more than one line You can also truncate the text to the size of the text frame, or automatically wrap the text in a text frame.

Steps
1. Select the text frame. 2. From the Format menu, click Properties, and click the Layout tab. 3. In the Layout tab, do one of the following: Click the Single Line option button Multi-Line option button Multi-Line with Word Wrap option button To Show text on a single line, truncating the text to the width of the text frame Show text on more than one line, but truncate it to the width of the text frame Automatically wrap text in the text frame. Tip: To have large amounts of text span multiple pages, in the Size tab, set the height to dynamic. 4. Click OK.

Tip
To quickly make text in a text frame appear on a single line, select and drag one of the sizing handles to size the frame.

Administration Guide 379

Chapter 45: Report Formats

Combining Text Frames


You cannot insert other frames into a text frame. However, you can combine two text frames into one text frame (Impromptu removes all trailing blank spaces in the data before showing the data in text frames) copy and paste one text frame into another (when you paste a text frame into a list frame, the text is pasted as a new column and is repeated for each row)

Steps
1. Select one of the text frames. 2. While holding down the mouse button, drag the frame into the other text frame. Your pointer changes to the following 3. Release the mouse button. Impromptu combines the two text frames.

Picture Frames
You use picture frames to add bitmap graphics, such as company logos and product pictures, to your reports. With picture frames, you can insert any Windows bitmap (.bmp), Joint Photographic Experts Group (.jpeg or .jpg), Portable Network Graphics (.png) or Device Independent Bitmap (.dib). scale the image to fit within a specific area in the report, or use the images original size and crop it to meet your needs. insert pictures in list frames. When you insert a picture in the detail area of a list frame, the picture repeats once for every row in the list frame. When you insert a picture in a header or footer in a list frame, the picture appears in that header or footer. insert pictures into form frames. You can use scope of data to control how the pictures are displayed. For information about scope of data, see (p. 376). You cannot insert a picture frame in a text frame, a chart frame, or another picture frame.

Note
You can create a static graphic by inserting an OLE Object containing a bitmap that you create using Microsoft Paint. For information about inserting report objects, see the Impromptu online Help. In the Index tab, type inserting, report variables

By default, Impromptu inserts pictures linked to their source so that if the source picture changes, the picture in the report changes. You can also have Impromptu make a copy of the picture in the report so that changes to the original bitmap file are not reflected in the report. For information about inserting a picture frame, see the Impromptu online Help. In the Index tab, type inserting, pictures You can add a picture that changes based on the values for a data item or a calculation called a dynamic picture. For an example of a report that contains a dynamic picture based on a data item, see sample report "Annual Product Sales"

Steps to Insert a Dynamic Picture


1. From the Insert menu, click Picture Frame. 2. Position the pointer where you want to locate the upper-left corner of the frame. 3. While holding down the mouse button, drag the mouse diagonally until the frame is the size you want and then release the mouse button. 380 IBM(R) Cognos(R) Impromptu(R)

Chapter 45: Report Formats 4. Click the Load Using File Name in Column option button (Picture Properties dialog box). 5. Select the name of the column that contains the names of the picture files from the Load Using File Name in Column box. Note: The column must contain only the names of the pictures. For example, the Product Picture data item has "Tent-A" as the value in the first record. Impromptu looks for a file name such as Tent-A.bmp or Tent-A.png and shows the picture for the first record. 6. Select the Prefix with Path check box, and enter the location of the picture files. 7. In the Select the Default Image Type list, click the default file type of your picture files. 8. Click OK.

Note
When creating a picture frame by referencing an image stored in a database column, the name of the image can include the file extension, such as .jpg. If the extension is missing, Impromptu defaults to the format selected in the Source tab of the Picture Properties dialog box.

Scale and Crop a Picture


By default, Impromptu adjusts the size of a picture to a best fit within a picture frame, while maintaining the proportions of the picture.

Steps
1. Select the picture frame that contains the picture you want to scale or crop. 2. From the Format menu, click Size. 3. Do one of the following: Do this Select the Scale Image to Fit check box. Impromptu resizes the picture to the same size as the picture frame. Clear the Scale Image to Fit check box. Impromptu returns the picture to its original size and crops the picture using the frames dimensions. Select the Scale Image to Fit and the Maintain Height/Width Ratio check boxes if they are not already selected. Impromptu adjusts the size of the picture in the picture frame so that the ratio matches that of the original picture size. Generally, the picture does not fit exactly within the picture frame. 4. Click OK. 5. While holding down the pointer over one of the handles for the selected picture frame, drag to size the picture frame and then release the mouse button. Note: You can scale or re-shape a picture to fit a picture frame even if the dimensions of the picture differ from those of the picture frame. You can squash or stretch the picture to produce a desired effect, or to fit it within the boundaries of a picture frame. Maintain the aspect ratio when you resize a picture To Scale a picture to fit within a picture frame

Crop a picture

Administration Guide 381

Chapter 45: Report Formats

382 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports


This chapter discusses techniques for presenting complex data in a report.

Present Complex Data


You can present complex data in several ways, including crosstab reports sub-reports and drill-through reports

Crosstab Reports
A crosstab report is a compact table of rows and columns that shows the value for the combination of each row and column. In a typical crosstab report, the rows and columns are grouped, and the cells are summarized. You can use crosstab reports to summarize and present complex data. Both the crosstab report and the list report contain rows, columns, cells and summaries. However, in the crosstab report, the rows, columns, and cells are interrelated. For example, in the first report the data is presented in a list while in the second report the data is presented in a crosstab.
List report

Crosstab report

You cannot edit the SQL (Structured Query Language) for a crosstab report. For more information about creating crosstabs, see the Impromptu online Help. In the index tab, type crosstabs, creating templates, creating reports with

Administration Guide 383

Chapter 46: Complex Reports

Quickly Change a List Report into a Crosstab Report


You can quickly change a list report into a crosstab report by dragging one or more columns into the row titles area. However, you should be aware of the following: Because all the columns in the list report must appear in the crosstab, you have less control over the contents of the column headers and cells of the crosstab than you do when you use other crosstab creation methods Any detail data items in the list report query, even if they are not in the list report, will appear in the crosstab You can also create a crosstab from a chart or form frame if the frame is the primary frame in your report. The crosstab retains all the properties of the primary frame. For information about designating a frame as the primary frame, see (p. 371). To restore the list report use the Undo command (Edit menu) or the Undo button pivot the data again use the Build List Report button (Query dialog box)

Steps
1. Select one or more columns or column values in the list report. You must summarize the data item you use for the cells, or the crosstab shows only the first occurrence of a value. 2. Drag the selected item(s) into the column titles area. The pointer changes to indicate valid drop locations. Note: The selected items are inserted at the position indicated by the highlighting. 3. Drop the selected item(s). The report becomes a crosstab. 4. Repeat steps 1 to 3 to create a nested crosstab. Note: You determine the order of nesting with the drop position of the selected item(s).

Tip
To reduce the number of empty cells in the crosstab, select a data item for the columns with a many-to-many relationship with the data item in the rows. For example, Customer and Product, Sales Rep and Product, Year and Product, Region and Product all have a many-to-many relationship. A one-to-one relationship, such as Customer and Customer Number, results in a crosstab with many empty cells.

Build Crosstabs from a List Query


You can create a crosstab report directly or build a crosstab after you added data items to a list query or list report. This method requires a more in-depth understanding of crosstabs. Use the Build Crosstab button (Query dialog box) to view the Crosstab tab. This tab contains all the options you need to create a sophisticated crosstab report. When you add a data item to the Cells box (Crosstab tab, Query dialog box), Impromptu adds the default summary. For example, Sale Amount becomes Total Sale Amount when you add it to the Cells box (if Total is the default). If you drag Total Sale Amount from the Cells box back to the Rows box or the Columns box, the default summary is retained. You can create simple crosstabs or nested crosstabs. A simple crosstab has one data item in the rows and one data item in the columns. A nested crosstab has more than one data item in rows and/or columns. When you create crosstabs, you specify where you want summaries in the crosstab and what types of summaries you want. Turning a list report into a crosstab report works best if the data items you want as rows and columns in the crosstab are already grouped. Impromptu uses the grouping to decide where to put columns, and if there is no grouping you may end up with a crosstab that doesn't make sense. Here is an example of a simple crosstab report with both a row summary and a column summary.

384 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports

Here is an example of a nested crosstab. Again, the report has both a row summary and a column summary.

When you build a crosstab, you can include calculations using the columns generated by the crosstab. If you decide to build a crosstab after you have created a list query, you can include any columns from the existing list query in the crosstab query.

Steps
1. From the Report menu, click Query. 2. In the Query dialog box, click the Build Crosstab button. The Crosstab tab appears.

Row Summary checkbox Column Summary checkbox

3. Add data items to the crosstab and include summaries as required. 4. Click OK.

Notes
For a step-by-step tutorial on how to add data items to a crosstab and how to include summaries, see Discovering Impromptu. When you select the summary check box in the Crosstab tab (Query dialog box) to include the row or column summaries, the default summary type matches the summary type of the cell data. For example, if the cell data is averaged, then the row and column summaries will be average. Once you run the query, you can modify the data definition for any row or column summaries to show a different summary type than the cell data summary. You cannot edit the generated crosstab titles. Administration Guide 385

Chapter 46: Complex Reports

Add Summaries to Crosstabs


In a crosstab report, you can add summaries to rows columns footers For example, the following report contains summaries in the rows, columns, and footers.

You add row and column summaries by selecting one of the summary check boxes. A summary check box can be cleared, selected, or shaded (it contains a grayed check mark).

This check box is selected. Summarization exists at all grouping levels. This check box is shaded. Summarization exists at some but not all grouping levels.

You can clear or select a shaded checkbox to change the summarization.

Change Summarization Types for Crosstab Cells


Each cell data item has a default summarization type that depends on the data type of the cell data item. If the data type is Number, the default summarization type is Total. For all other data types, the summarization type is Count. You can change the summarization type.

Steps
1. From the Report menu, click Query and ensure that the Crosstab tab is selected. 2. Select a summarized data item in the Cells box and click Edit. The Data Definition dialog box appears. The summarized data item you selected appears in the Expression box.

386 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports

3. Edit the summarized data item in the Expression box and Click OK.

Summarization for Crosstab Columns and Footers


The default type of summarization for numeric values in crosstab columns and footers is Total. You can change the type of summarization using the Summarization dialog box and specify the levels of grouping to summarize in the columns and footers.

Steps
1. From the Report menu, click Query and ensure that the Crosstab tab is selected. 2. Select a summarized data item in the Cells box and click Summarize. The Crosstab Summarization dialog box appears.

3. In the Summary Type list box, select the type of summarization you want to apply. 4. In the Column <summary> box, select one or more data items to which you want to apply the summary. 5. In the Footer <summary> box, select one or more data items to which you want to apply the summary. 6. Click OK.

Tips
To apply more than one summary to column totals, add the column you want to summarize once for each summary you want.

Administration Guide 387

Chapter 46: Complex Reports For example, if you want both the Total Sale Amount and the Average Sale amount, add the Sale Amount data item to your report twice. Apply the summary you want to each column and delete the unwanted columns from your report.

Create Calculated Columns


You create calculated columns in a crosstab report the same way you create them in a list report.

Steps
1. 2. 3. 4. From the Report menu, click Query. In the Crosstab tab (Query dialog box), click the Calculate button. In the Calculation Definition dialog box, create the calculation you want and click OK. In the Calculation Placement dialog box, specify whether you want the calculation you created to appear in the rows, columns, or cells, and click OK. For information about defining calculations, see "Create Calculated Fields" (p. 344).

Use Columns Generated by the Crosstab


You can create calculated columns using columns generated by the crosstab. You can do this only after the crosstab query runs, since Impromptu must know which columns are generated. For example, you create a new sales quota for each sales representative by calculating an amount that is 25% over the sales each representative made last year. Then, you calculate the net change between the total sale amount and the sale quota for each representative. To do this, you create a calculation using columns generated by the crosstab.
Total Net Change = total (Sales Quota - Total Sales)

Steps
1. From the Report menu, click Query. 2. In the Crosstab tab (Query dialog box), click the Advanced button. Note: If you have not run the crosstab query when you click the Advanced button, you are prompted to run the query. This ensures that the crosstab columns are generated and available for use. 3. Do one of the following: Do this To

Select the Show All Crosstab Columns check See all the crosstab columns (not just the box. calculated columns) Click New. Add a new calculation

388 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports Do this Select the calculation and click Edit. Select the calculation and click Remove. To Edit a calculation Delete a calculation

4. In the Calculation Definition dialog box, create your calculation and click OK. New calculations are added as columns at the end of the report.

Filter Data in Crosstab Reports


You can filter data in a crosstab report by applying one or more of the following types of filters: detail summary crosstab detail crosstab summary For information about detail and summary filters, see (p. 318). If you're familiar with SQL, you can think of a crosstab filter as having a predicate in the WHERE clause on the second SQL pass. Crosstab filters are used with only crosstab reports. If you change the crosstab back to a list report, the crosstab filters are removed from the list report.

For Example
You create a crosstab report that displays the sales totals across the Great Outdoors line of products for all customers.

You apply the following four filters to the report. You apply The detail filter That looks like this (Product Line =Alert Devices and (Customer Type = Camping Chain and Customer Name starts with F)) or (Product Line = Alert Devices and (Customer Type = Sports Chain and Customer Name starts with A)) Total Sale Amount < 5000 Alert Devices Microwave Detective > 200 Total < 10000

The summary filter The crosstab detail filter The crosstab summary filter The report now looks like this.

Administration Guide 389

Chapter 46: Complex Reports

Steps
1. 2. 3. 4. 5. Create the crosstab report. From the Report menu, click Query and then click the Filter tab. In the Filter Type box, select either the Crosstab Detail filter or the Crosstab Summary filter. Create a filter expression using the components in the Available Components box. Click OK.

Tip
To quickly apply a filter to a crosstab report, use the Filter button on the toolbar. For example, if the cells in your crosstab report are values of Average Margin and you select a cell value of 25 and click the Filter button, the crosstab filter is Average Margin = 25.

Swap Rows and Columns


You can swap rows and columns in the Crosstab tab or you can swap them directly on the crosstab report by dragging one or more columns to the row titles area. For example, if the rows are products, and the columns are countries, you can swap them to change the rows to countries and the columns to products.

Change a Crosstab to a List Report


You can change any crosstab report to a list report. When you do so, you lose the crosstab filters. Any data items you added to the crosstab now appear in the list report.

Steps
1. Position the pointer over a column. The pointer looks like this. 2. Click the mouse once to select the column. Click the mouse a second time to select all the columns. 3. Drag the selection into the row titles area. The pointer looks like this. The crosstab becomes a list report.

Tip
You can also change a crosstab to a list report by clicking Build List Report in the Crosstab tab (Query dialog box).

Work With Sub-Reports


Sub-reports are multiple Impromptu queries contained in a single report, so that you can deliver information that would otherwise only be available with two or more reports. Sub-reports offer more flexibility for grouping and sorting data than a regular report. Sub-reports use the same catalog, but you can group each sub-report on different columns; with a regular report, you can only group data in different frames on the same columns. You can also apply different sort and filter conditions to each sub-report.

390 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports For example, you create a report that compares annual sales. You want to see the total sale amount for each year by both product and by product type. You use sub-reports and display them side by side.

You can also create reports that display information in a vertical list. For example, you create a report that lists sales information. In order to sort, group, and filter on different data items, you use sub-reports.

sub-reports

The creation of sub-reports is best suited to report authors who have a good understanding of the database that the catalog uses, and who are creating standard reports for use without modification by the user community.

What You Can Do With Sub-Reports


You can schedule sub-reports with Scheduler and print the results export the main sub-report query data to other applications using the Save As command

Administration Guide 391

Chapter 46: Complex Reports drill through to a sub-report from PowerPlay or Impromptu; however, the filters that are automatically applied from the source report to the drill-through report are always applied to the main query but never applied to the sub-report queries For information on setting up drill-through reports, see (p. 394). publish a report with multiple queries as HTML (HyperText Markup Language) and view it with a Web browser

For information about publishing reports for use with Web browsers, see "Using HTML to Create Reports on the Web" (p. 405).

What You Cant Do With Sub-Reports


You cannot save a sub-report as a local snapshot insert a sub-report into a list frame sort, group, or filter two different queries simultaneously

Create Reports Containing Sub-Reports


A new report automatically has a main query. When you add a sub-report, you must define its query as well. You can add a sub-report to a report by adding a new frame as a sub-report changing an empty frame into a sub-report A frame can be changed to a sub-report or added to the report as a sub-report as long as it can be associated with a query. This excludes only OLE objects and picture frames.

Steps to Change an Empty Frame into a Sub-Report


1. Select the empty frame that you want to change into a sub-report. 2. From the Report menu, click Change to Sub-Report.

Note
If the Change to Sub-Report command (Report menu) is unavailable, ensure you selected a frame, that the selected frame is not already a sub-report, and that the frame is not an OLE object or a picture frame.

Steps to Insert a New Frame as a Sub-Report


1. Select the frame into which you want to insert a sub-report, such as a form frame. 2. From the Insert menu, click Sub-Report, then click the type of frame you want to insert (Chart, Form, List, Crosstab, or Text Frame). 3. Position the pointer where you want the upper-left corner of the frame. 4. Hold down the mouse button and drag the mouse diagonally until the frame is the size you want and then release the mouse button. The Query dialog box appears. 5. Add the data items you want in this sub-report and click OK. If you add a chart sub-report, the Chart Properties dialog box appears.

Edit Sub-Report Queries


When you add a sub-report, the Query dialog box appears. You can define a query for the sub-report that is completely independent of the main query, with its own sorting, grouping, and filtering. When a report contains more than one query, the Report menu changes to enable you to select a specific query from a flyout menu.

392 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports

Step to Select a Query to Edit


From the Report menu, click Query, and select the query you want to edit. If No frame is selected A frame is selected Then The Main Query appears first on the list, followed by the name of each sub-report. The frames sub-report appears at the top of the list, followed by any parent queries the sub-report may have, then the Main Query.

Tip
To see all the queries in the report in a hierarchical structure, from the Report menu click Query, then All Queries.

Link Sub-Reports
By default, the main query and sub-report queries are independent of each other. However, you can link them by including data items from the main query in the sub-report filter expression.

For Example
You filter a sub-report query so that it shows only order information for the current customer name in the main query.

main report sub-report

The filter expression that links a sub-report to a main report looks like this:
<column name>=Main Query.<column name>

<Column name> is the data item you use to link the queries. The example above uses the Customer Name column to link the queries. When the sub-report query runs, it checks for the first row in the Customer Name column and shows only information for that customer. If you want a sub-report to show information for another row in the column, place the main report in a form frame that shows only one row at a time. When you insert the sub-report into the form frame as well, it changes as you click through the rows in the main report. For example, the main and sub-reports above are both in a form frame that shows only one row of the Customer Name column at a time. Each time you scroll to another customer name, the sub-report shows only information for that customer.

Administration Guide 393

Chapter 46: Complex Reports

Steps to Create the Main Report


1. Create a new report using the Blank template. The Blank template uses a form frame to create a report. 2. In the Data tab (Query dialog box), double-click the data items you want to include in the main query. To recreate the example above, open the Customers folder, double-click Customer Name, and click OK. 3. Click the empty report. 4. From the Format menu, click Properties, and click the Layout tab. 5. In the Scope of Data box, click Single Row of Data, and click OK. 6. From the Report menu, click Query. 7. In the Query Data box, click the Data items, and click Mark for Insertion. Click OK.

Steps to Add a Linked Sub-report


1. From the Insert menu, click Sub-Report, and click List Frame. The cursor shows a List Frame icon. Use to drag and size a list frame anywhere in the report. 2. In the Data tab (Query dialog box), double-click the data items you want to include in the sub-report query. To recreate the example above, open the Orders folder, and double-click Order Date and Closed Date. 3. Click the Filter tab, and use data items from the main query to create a filter expression. To recreate the example above double-click Catalog Columns, open the Customers folder, and double-click Customer Name double-click = double-click Report Columns, Main Query, and Customer Name 4. Click OK. Use the scroll buttons on the top right of the report to scroll through the data items in the main query. Each time you scroll, the report frame is recreated, and the sub-report query runs. The sub-report then shows information for the current row in the main query. For more information about creating filter expressions, see (p. 319).

Use Drill-Through Reports


You can use drill-through reports to create a report that better meets the needs of its primary audience while still providing an easy to access link to related information. A report user who wants to see related or more detailed information selects a value in the report and drills through to an associated report. For example, you have a report that lists customer names, order numbers, and the total sale amount for each order. You want to see the transaction details for order number 160. You select this value and click the Drill-Through button. The associated drill-through report opens and is filtered on order number 160.

394 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports

Parent Report

Child Report

You can set up drill-through associations for the following types of reports: list reports crosstab reports reports containing multiple queries (sub-reports) reports using snapshots or outflows reports including chart frames You can also drill through to IBM Cognos Query. For more information, see the Impromptu online Help. In the index tab, type IBM Cognos Query

Notes
You can only drill through from a value in the parents main query to a main query in the child report. To drill through from a chart, the chart must contain summary values for one data item (for example, a bar chart that shows the total sale amount for each country). Both reports must be from the same catalog. When a parent report drills down to a child report containing a prompt, the prompt value you enter for the child report is used as part of the filter for the child report. In the child report, if you select Prompt from the Report menu and enter a new value, the original prompt value is still used as the filter, and the new prompt value is appended to the filter.

Associate Reports for Drill-Through


To set up a drill-through report association, you select the report from which you want users to start. This is called the parent report select a report that you want users to drill to. This is called the child report specify the parent report column(s) from which a child report can be accessed specify the columns from the parent report that are to be included in the filter expression of the child report When you select a value in one of the specified columns in the parent report and click the Drill-Through button, the following occurs: Filter information for this value is passed to the filter expression of the child report.

Administration Guide 395

Chapter 46: Complex Reports Any other columns that you selected for inclusion in the child filter are passed to the filter expression of the child report. The child reports query runs and the report appears. Both the parent and child reports must be from the same catalog.

Notes
To have a column value included in the filter of the drill-through report, the column must exist in both the parent and the child query, but not necessarily in the child report. You can include more than one column in a drill-through filter. You can verify the drill-through filter using the Drill-Through Filters command (Report menu) when you are viewing the child report.

Steps
Before you begin, ensure that you have a parent report, and at least one report that is going to be the drill-through or child report. 1. Open the parent report (the one from which users will drill), and click any data item. 2. From the Report menu, click Drill Through, and then click Properties. The Drill Through Properties dialog box appears.

Note: If the Drill Through Properties command (Report menu) is unavailable, click Options (Tools menu), select the Drill Through tab, and then select the Enable Drill Through Properties check box. 3. Select a column for which you want to add a drill-through report and click Add. The Add Drill Through Query/Report dialog box appears.

396 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports 4. Select the column(s) to be included in the drill-through filter. Clear the column(s) you do not want included in the drill-through filter. For example, if you select Product for the drill-through column Product Cost, then when the user drills through on a value of Product Cost, the filter information passed to the child report includes the value of Product that is in the same row as the selected value of Product Cost. For example, the filter passed to the child report could be Product Cost = 500 AND Product = Star Lite. Note: The column you add a drill-through report for is included by default in the drill-through filter, along with any grouped columns. You can clear the check box for these columns if you do not want them in the filter of the child report. 5. Type the drill-through report name and path, or click Browse to find it. While browsing, select Enable Filter by Catalog to see only reports that use the same catalog as the parent report. Select Enable Filter by Columns to see only reports that contain columns you are using in the drill-through filter. 6. Click OK. Impromptu validates the child reports path and file name, and verifies whether the selected columns exist in the child report. Note: If one or more selected columns do not exist in the child report, Impromptu grays them and shows you a message. You can then choose whether you want to leave the columns in the drill-through filter or clear the selection from the columns and remove them from the drill-through filter. However, if you do not add the missing columns to the child report, the user will be unable to drill through from the parent to the child report. 7. In the Drill-Through Properties dialog box, click OK to set the drill- through association and close the dialog box.

Notes
If there is a conflict between the parent and the child filters, the drill-through (child) report may contain no data. For example, if the selected value in the parent report results in the filter Country = Canada being passed to the child report, and the child report already has a filter Country = Germany, the filter becomes Country =Canada AND Country = Germany. The result is that no rows meet these filter conditions and no data is shown in the drill-through report. If you remove or rename a column in the parent or child report, or if the data type of a column changes in the database, when you drill through an error message appears and the drill-through operation fails.

Tips
To set a drill-through report as the default report that opens when a user selects a value and clicks the Drill Through button, drag the report name to the top of the list under its associated column in the Drill-Through Properties dialog box. To provide the report users with added flexibility, you can include a prompt in the drill-through report. When the user drills through from the parent report, a prompt appears. The values the user enters or selects are added to the filter expression in the drill-through report. For information about creating prompts, see (p. 325).

Test Drill-Through Reports


Before you deploy drill-through reports, test the associations you created to ensure that the drill-through works and the expected result appears the default drill-through report is the first report under the data item if more than one report is associated with a data item. The default report is the report that appears when the user selects a value and clicks the Drill-Through button without selecting the drill-through report from the Drill-Through button drop-down list.

Steps
1. Open the parent report. 2. Press Esc to clear any selections in the report. Administration Guide 397

Chapter 46: Complex Reports 3. Click and hold down the Drill-Through button on the toolbar to highlight all the report hotspots from which you can drill through. (When you release the Drill-Through button, the highlighting disappears).

4. Select a value in the report that was highlighted in step 3. 5. Click the Drill Through drop-down button on the toolbar. 6. Verify whether the correct report or reports appear in the drop-down list. Select a report or click the Drill-Through button to open the child report. 7. From the Drill-Through button drop-down list, click Filters. 8. Verify that the filter expression shows the filter conditions you want passed from the parent report. Note: The Impromptu Drill-Through Filters dialog box displays only valid drill-through filter expressions. The final filter expression applied to the child report is a combination of valid drill-through filters and both the detail and summary filters (or crosstab filters) in the child report. 9. If you associated more than one report with the parent reports column, verify that the drill-through report that appears is the report you want as the default report. If not, drag the report you want as the default to the top of the list for the column in the Drill-Through Properties dialog box. If you are satisfied with the test results, you are ready to deploy the report and its associated drill-through reports. For information about deploying reports, see "Present Results with Other Applications" (p. 398). Note: The drill-through filter is not saved when you exit the child report.

Present Results with Other Applications


You can present the results of your Impromptu reports outside of Impromptu using OLE (object linking and embedding) HTML (web-based report publishing) You can also use OLE to embed objects from other applications into Impromptu reports.

Using OLE to Present Impromptu Reports


Information created in one application and linked or embedded in another application is called an OLE object. When you link and embed objects from one application to another, you maintain a link to the original application so you can take advantage of its features. The primary difference between linking and embedding is where the OLE object is stored: A linked object is like a pointer from one application to information stored in another application.

398 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports An embedded OLE object is a copy of the information from one application inserted and stored in another application.

Note: If you regularly copy report objects to another application, you can set up a Launch button on the toolbar. When you click the Launch button, Impromptu automatically copies information from the active report to the Clipboard before running the application. For information about Launch buttons, see (p. 449).

Link Information From Another Application to Impromptu Reports


You can create a link to include information from other applications in an Impromptu report. This information can appear in the Impromptu report either as data or as an icon. When the information in the source application changes, the Impromptu report is automatically updated with the changed information. For example, you prepare an Impromptu report that shows target sales quotas. Next, you link the company sales figures that are in an OLE spreadsheet application to the report, and distribute the report to your sales force. This ensures that the sales figures are automatically kept as current as the information in the spreadsheet.

Steps to Link Information From Another Application


1. In the source application, select the information that you want to appear in the Impromptu report. 2. Copy the selected information to the Clipboard. 3. From the Impromptu Edit menu, click Paste Special to show the Paste Special dialog box. 4. Click the Paste Link option button. Note: If the Paste Link option button is unavailable, save the source file. 5. If you want the linked information to appear as an icon rather than as data, select the Display as Icon check box. Note: When you select the Display as Icon check box, Impromptu inserts a shortcut that points to the location of the source file. 6. Click OK. Your pointer changes. 7. Position the pointer where you want the upper-left corner of the linked object.

Steps to Link to Another Application Without Leaving Impromptu


1. From the Insert menu, click OLE Object. Your pointer changes. 2. Position the pointer where you want the upper-left corner of the new OLE object. 3. Click the mouse button. 4. Click the Create from File option button. 5. In the File box, type the name of the file to link to your report. If you are not sure of the name or the location of the file to which you want to link, click Browse to locate and select the file. 6. Select the Link check box to link the selected file to your report. 7. If you want the linked information to appear as an icon rather than as data, select the Display as Icon check box. Note: When you select the Display as Icon check box, Impromptu inserts a shortcut that points to the location of the source file. 8. Click OK. Impromptu creates a link between the file you specified and the current report. Whenever the information in the linked file changes, the Impromptu report is updated with the changed information. Note: Deleting a linked object does not delete the information in the source document. It merely removes the link to that object from the Impromptu report.

Administration Guide 399

Chapter 46: Complex Reports

Edit Linked Report Objects


When an Impromptu report includes a linked object, you can open the objects source application.

Steps
1. 2. 3. 4. Double-click the linked object to open the source application. In the source application, make the required editing changes. In the source application, save the changes. Exit the source application and return to Impromptu.

Update Links
By default, Impromptu sets links to be updated automatically when the information in the source document changes. If you do not want changes in linked objects automatically reflected in your Impromptu reports, you can turn off automatic updating, complete manual updates, and then turn automatic updating back on again. You can also change a link to retrieve information from a different file. For example, you link an Impromptu report to a very large and complex spreadsheet that was created in an OLE compliant application. This spreadsheet frequently performs a forecasting calculation using the last periods sales data. You want to manually update the link monthly so that performance is not affected by frequent link updates.

Steps
1. Select the linked object you want to change. 2. From the Edit menu, click Links. In the Links box, the linked object that you selected in step 1 is highlighted. 3. Do one of the following: Click The Manual option button Update Now The Automatic option button Change Source Open Source Break Link To Turn off automatic updating Update the link now Update the link whenever the source document changes To show the Change Source dialog box. Use to select a new file to base the OLE object on To edit the object using the application in which it was created To change the object into a Windows Metafile that can no longer be edited

You can click Cancel until you change the objects link settings. When you change the link settings, the Cancel button changes to a Close button. 4. Click Close.

Note
When you link objects that frequently change, there may be an impact on performance. For information about performance issues, see "Optimize Performance in Impromptu" (p. 435).

Convert Linked Objects


Windows automatically tracks all the OLE objects that are available for use in your system. You can convert an OLE object to a different format. Impromptu cannot perform conversions on some types of linked objects. 400 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports When you convert OLE objects, you must perform conversions completely within a source application before you create the link in your report. For example, you linked an object created with an OLE compliant drawing application to your report. To speed up the report, you now eliminate the link and store the object in the report as a picture so you can edit it using another software package. You convert the object in the Impromptu report to a new type.

Steps
1. Select the object that you want to convert. 2. From the Edit menu, click Linked Document Object, and then click Convert. 3. From the Object Type box, click the type you want the object converted to and then click OK.

Embed Objects In Impromptu


You can embed all or part of the information from another application in your Impromptu reports so that the information appears as part of the report. You can embed information in a report by copying the information from the source embed an object in a report embed a newly created object in a report

Embed Objects By Copying


When you embed information, you make a copy, so that changes in the source do not appear in the report, and changes you make do not appear in the source file. When you create a new object or edit an object and the application youre embedding supports in-place editing, the application menus and toolbars temporarily replace Impromptus menus and toolbars. When it does not support in-place editing, Impromptu opens the other application.

Steps
1. In the source application, select the information you want to embed and then copy it to the Clipboard. 2. To insert the OLE objects into a frame other than the primary frame, select the appropriate form or list frame in Impromptu. 3. From the Edit menu, click Paste Special. 4. In the As box, select the object type that corresponds to the application in which the object was created. 5. If you want the embedded information to appear as an icon rather than as data, click the Display as Icon check box. Note: When you select the Display as Icon check box, Impromptu inserts a shortcut that points to the location of the source file. 6. Click OK. Impromptu inserts an OLE object containing the data from the other application into the frame you selected in Step 2.

Embed Existing Objects in Reports


You can embed entire files, as either data or as an icon, that you created in an OLE-compliant application into an Impromptu report. For example, you have a spreadsheet that outlines major sales campaign expenditures during the past year. You embed the spreadsheet in a sales report so you can correlate sales costs with revenues.

Steps
1. From the Insert menu, click OLE Object. 2. Position the pointer where you want the upper-left corner of the new OLE object. Your pointer changes.

Administration Guide 401

Chapter 46: Complex Reports Click the mouse button to show the Insert Object dialog box. Click the Create From File option button. In the File box, type the name of the file to embed in your report. If you want the embedded information to appear as an icon rather than as data, click the Display as Icon check box. Note: When you select the Display as Icon check box, Impromptu inserts a shortcut that points to the location of the source file. 7. Click OK. Impromptu embeds the file you specified into the current report. 3. 4. 5. 6.

Create Embedded Objects in Reports


You can create new OLE objects in an Impromptu report. For example, you want to embed a spreadsheet that was created in an OLE compliant application in an Impromptu report. You insert an OLE object, select the type, and then edit the new objectall without leaving Impromptu.

Steps
1. From the Insert menu, click OLE Object. 2. Position the pointer where you want the upper-left corner of the new OLE object. Your pointer changes. 3. Click the mouse button to show the Insert Object dialog box. 4. Click the Create New option button. 5. If you want the embedded information to appear as an icon rather than as data, select the Display as Icon check box. 6. In the Object Type box, double-click the type of object to insert. 7. Work within the application as you would normally to create the new object. 8. Do one of the following: If the embedded object was created in Impromptu, click the mouse button anywhere outside of the embedded object to return control to Impromptu. If the embedded object was created in another application that was launched from Impromptu, click Exit from the File menu. If you are prompted to save the changes you made, click Yes.

Edit Embedded Objects


You can edit an embedded object by editing the object within Impromptu or by launching the source application. Many applications support in-place editing of embedded OLE objects. If an application does not support in-place editing, Impromptu automatically launches the application when you edit the OLE object.

Steps
1. In Impromptu, select the embedded object that you want to edit. 2. From the Edit menu, select the embedded object. 3. Do one of the following: If the source application supports in-place editing, click Edit from the cascading menu. Impromptus menus are replaced by the menus of the application in which the OLE object was created. If the source application does not support in-place editing, click Open from the cascading menu. Impromptu launches the application in which the OLE object was created. 4. Make the changes to the embedded object. 5. Do one of the following: If the source application supports in-place editing, click the mouse button anywhere outside the embedded object to return control to Impromptu. If the source application does not support in-place editing, click Exit from the File menu.

402 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports 6. If you are prompted to save the changes you made, click Yes.

Format Linked or Embedded Objects


Once you have linked or embedded an OLE object in a report, you can change the properties of the object and format it as you would any other report object. A linked or embedded object has many of the same physical properties as frames. For example, you can change the size of an embedded object or add a border to a linked object. For information about changing the format and properties of a report object, see the Impromptu online Help. In the Index tab, type borders patterns styles, applying resizing parts of a report

Embed Impromptu Objects in Other Applications


You can embed Impromptu report data in other applications that support OLE. For example, your department uses a programming application to manage an order tracking system. You embed Impromptu reports in the order forms to create order reports.

Steps
1. From the Impromptu Edit menu, click Select All, and click Copy. Note: You can also click Copy Special from the Edit menu. When the Copy Special dialog box appears, click the Copy Report Image option button and then click Copy. 2. From the Edit menu in the target application, click Paste Special. 3. Click the Paste option button. 4. In the As box, ensure that the Impromptu Report Object type is selected. 5. If you want the Impromptu report to appear as an icon rather than as data, select the Display as Icon check box. Note: When you select the Display as Icon check box, Impromptu inserts a shortcut that points to the location of the source file. 6. Click OK. The Impromptu report is embedded in the current application. You can edit the report by double-clicking the report or the report icon. Note: It is not possible to document all the methods for embedding an Impromptu report in all other applications here. Generally, applications that support OLE do so through commands such as the Paste Special command in the Edit menu (copy either the Impromptu report image or report data using the Copy Special command) the Object command in the Insert menu the Insert Object in the Edit menu

Copy Subsets of Data to Other Applications


You can use the Copy Special command to paste or link information in another application or to copy data to another application.

For Example
You use the Copy Special command to copy the first 40 rows for 5 specific data items in the query to the Clipboard. You can either select the data values that you want to copy, or you can specify which columns and rows to copy as part of the Copy Special command.

Steps
1. Select the data that you want to copy. 2. From the Edit menu, click Copy Special. Administration Guide 403

Chapter 46: Complex Reports Because you selected a range of data values to copy, the Copy Special dialog box is set to Copy Query Data rather than Copy Report Image. 3. Make any changes to the data you have selected for the copy operation as follows: Do this Click to add or remove data items. Select either The Copy All Rows option button to copy all data values the Copy Rows option button to copy a specific number of rows In the Copy Rows boxes, type the numbers for the first and last row that you want to copy. Select or clear the Include Data Labels check Include or exclude the labels for each data box. item in the copy operation 4. Click Copy. Impromptu copies the data values to the Clipboard based on the settings you chose. 5. Launch the application into which you want to copy the data, and position the cursor where you want to insert the copied data. 6. From the Edit menu, click either the Paste or Paste Special option button. Note: If you click Paste, the data values are pasted into the target application as unformatted text. If you click Paste Special, the Paste Special dialog box appears, and you can choose whether to paste or paste and link the data into the target application. If you want to Change the data items copied Change the number of rows used in the copy operation

Link Impromptu Reports in Other Applications


You can link Impromptu reports in other applications so that whenever the report is run in Impromptu, the information in the other application is updated. For example, you include an Impromptu report that shows the most recent sales data in a sales analysis document. You create a link to the Impromptu report, and the linked report appears in the sales document exactly as it appears in Impromptu.

Steps
1. Within Impromptu, select the data items whose values you want to link to another application. 2. From the Edit menu, click Copy Special. 3. Click the Copy the Report Image option button. 4. Click Copy. 5. Within the target application, click Paste Special from the Edit menu. 6. Click the Paste Link option button. 7. In the As box, ensure that Impromptu Report Object type is selected and click OK. The Impromptu report data is linked to the target application, so that the information in the target application changes with the report.

Notes
It is not possible to fully document all of the methods for linking. Generally, applications that support OLE do so through commands such as the Paste Special command in the Edit menu (copy either the Impromptu report image or report data using the Copy Special command) the Object command in the Insert menu the Insert Object command in the Edit menu

404 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports

Tip
To quickly select the Impromptu report data you want to link, use the Select All command (Edit menu) before you copy the report data to the Clipboard.

Using HTML to Create Reports on the Web


A HyperText Markup Language (HTML) report is a read-only report that users can view in a Web browser. You can save and distribute Impromptu reports in HTML format, such as from your intranet or Internet Web site or by email. You can view and run Impromptu HTML report output in Impromptu Web Reports. HTML report output contains a Report Navigator, which means you can jump to a grouped column value or a specific page number in the HTML report. In the following HTML report, values in the Report Navigator appear as pictures. You click a picture to jump to a page in the report.

Designing HTML Report Output


When you create reports in HTML format, there are important design considerations to remember. Well-designed reports consider such elements as report navigation object alignment overlapping objects unnecessary scrollbars performance

Add Report Navigation


You can add a Report Navigator to your report output to set navigation based on one or more grouped columns. The columns serve as bookmarks or table of contents entries in both HTML and PDF report output.

Administration Guide 405

Chapter 46: Complex Reports For items to appear in the Report Navigator, the selected columns must be visible in the report. In addition, only grouped and associated columns are available for selection. If you do not have any grouped columns in your report, you cannot add columns to the Report Navigator. For information about grouping columns, see Impromptu User Reference. A Report Navigator is recommended for multipage reports. However, if your report fits on one page, a Report Navigator is not required.

Steps
1. With a report open, from the Report menu, click Navigation. 2. Select the Include report navigator check box. 3. In the Available columns box, select the check box next to one or more of the grouped or associated columns that you want. 4. Specify the navigation properties that you want. Goal Include a list of page numbers in the report navigator, which link to specific pages in the report body Remove duplicate entries in the report navigator caused by horizontal page breaks Action Select the Include page numbers check box

Select the Suppress duplicate entries check box

5. Click OK. Tip: If you later want to remove all bookmarks in your report output without changing the settings in the Available Columns box, clear the Include report navigator check box. The Bookmark tab remains in the PDF report output when you view a report in Adobe Reader. This is expected Adobe behavior.

Align Report Objects in Impromptu


A report may look fine in Impromptu, but the report objects may not align properly in the HTML output. You cannot specify the absolute position of an object in HTML. To maintain the relative position of objects, all objects are placed in cells of one or more HTML tables, laid out relative to the report image. To design reports that render properly in HTML, align the report objects in Impromptu before rendering. To align objects horizontally, have objects use the same y coordinate.
Horizontal Alignment

(3.25, .25)

(5.5, .25)

To align objects vertically, have objects use the same x coordinate.

406 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports


Vertical Alignment

(0.3, 0)

(0.3, 1.1)

The bolded values indicate values in the report that must be identical to ensure correct alignment. The coordinates are visible in the status bar when an object is selected.

Steps
1. Shift+click the objects you want to align, right-click, click Properties, and click the Align tab. 2. If you want to align objects horizontally, click the arrow next to the box in the horizontal line, and select an alignment option. Depending on the alignment option you choose, you may need to specify a box, such as the Selection box, to which objects are aligned. 3. If you want to align objects vertically, click the arrow next to the box in the vertical line, and select an alignment option. Depending on the alignment option you choose, you may need to specify a box, such as the Selection box, to which objects are aligned. 4. Click OK. Tip: The easiest way to align objects is to align one side to the parent (top, bottom, left, right).

Eliminate Overlapping Objects in a Report


You cannot layer objects in HTML report output. When one object overlaps another, even only partly, the object that appears behind another object does not export to HTML.
Impromptu report An Impromptu report contains objects arranged like this. A C D B B HTML output The resulting HTML output shows only two of the four objects. C

If you create HTML reports and warnings appear or, you discover that some objects are missing, check your Impromptu reports for overlapping objects. Tip: To see the object outline, from the View menu, click Boundary Lines. You can also check the HTML log file to see if anything was discarded. Tip: A log file is generated in the same folder as the HTML output. If the report name MyReport, the log file name is MyReport.txt.

Steps
1. Open a report. 2. Resize or move objects so that none overlap. 3. If the text frame for a label overlaps the related data, do the following:

Administration Guide 407

Chapter 46: Complex Reports Use string conversion functions, such as the Number-to-String () function, to convert numeric, date, or time values to string values. Eliminate the text frame by creating a calculated item that concatenates the label with the data, such as
'Customer Name: ' + customer_name

Avoid Multiple Scrollbars in HTML Report Output


When viewing HTML report output, horizontal and vertical scrollbars may appear in the report and in the browser. Scrollbars may appear in report objects, such as list frames, because the report contains more data than can fit in the frame. You can also add vertical scrollbars to the report. In the browser, scrollbars may appear when the size of the report is greater than the browser window size. To remove duplicate vertical and horizontal scrollbars in the report and browser, do the following: resize the body of the report to fit in the browser window. Tip: Try turning on page breaks after group breaks. To remove unnecessary horizontal scrollbars in list frames, do the following: In the list frame, leave a little space on the right side of the report. This space will accommodate the width of a vertical scrollbar when the number of rows exceeds the height of the list frame, thus eliminating the need for a horizontal scrollbar.

Improving Performance
Performance is affected by the complexity of a report query. Complex queries require more time for data retrieval than do simple queries. However, because all the data is retrieved before report output is generated, performance is not dependent on the format you choose for the report. An important way to improve the performance of HTML reports is to manage file size. The larger the HTML files, the longer it takes to load in the browser. You can align objects The more unaligned objects you have in a report, the more HTML table entries are created to position the objects an the larger the HTML files. minimize the number of objects on the report The more objects in the report, the larger the HTML files. simplify the use of borders, colors, and fonts Formatting is a consideration only when file size is critical. The more complex the formatting, the larger the HTML files.

Save Reports as HTML


Impromptu creates different file types when you save a report as HTML. The quantity and types of files depend on the size of the report, the number of graphics, and the options you include. When you distribute the HTML report, you must provide all the associated files (p. 409). Use the Save As command to save reports in HTML format.

Steps
1. From the File menu, click Save As. 2. In the Save as Type box, click Hypertext Markup Language (*.HTM). 3. In the File Name box, specify the name of the report. Each report you save as HTML requires its own folder. 4. Click Options. 5. Specify the page options for the report and click OK. 6. Click Save. 408 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports You are notified if your HTML report content contains overlapping objects (p. 407).

HTML Files
The Save as HTML command generates a number of related files. Create a separate folder for each report to more easily manage the files that Impromptu generates. This ensures also that the files from one report do not affect the files from another. If you distribute an HTML report by email, ensure that you send all the files for that report. The following files are created when you save a report as HTML. This File Main HTML page Has These Characteristics Is created for each report saved as HTML. Is used to launch the HTML report output. Tip: Each report requires its own folder to ensure that index.htm file is not overwritten. Filename: index.htm Report body pages Is created for each page of the report body. If a report has 50 pages, there will be 50 files of this type. Has the prefix you provide, followed a letter, number or alphanumeric value, and the extension.htm. For example: MyFile1.htm, MyFilea.htm, or Myfile1a.htm. Report StyleSheet Files Specifies the layout attributes of a report. Has the prefix you provide, followed by a letter, number or alphanumeric value, and the extension .css. For example: MyFile1.css, MyFileb.css, or MyFile1b.css Report Navigator Button Files Is created for each report saved as HTML. Links the navigation buttons to the pages. For example: htmlnavbuttons.html. Report Navigation Buttons Frame Is created for each report saved as HTML. Contains the report navigation buttons. Filename: htmlnavbuttons.js Report Content Frame Is created for each report saved as HTML. Displays report content. Filename: htmlcontent.js Report Table of Contents Frame Is created for each report saved as HTML. Contains links for navigation. Filename: htmltoc.js Image Files Is created for each OLE object and graph. Filename: Myfile0.png Navigation Buttons Is created for each navigation option if you include a Report Navigator. There will be a 8.gif files for the top, bottom, up, and down buttons in both the available and unavailable state. For example, CG47DN.gif

Administration Guide 409

Chapter 46: Complex Reports

This File Log Report

Has These Characteristics Is created for each report saved as HTML. Has the prefix you provide, followed by a number and the extension .log. For example: MyFile1.log

Distributing HTML Report Output


After you save a report as HTML, you can make it available to report viewers in a Web browser. Be sure to include all files associated with the HTML report. You can distribute HTML report output on an Internet Web site Follow your organizations procedures for linking reports to your Web page. on the intranet Web site for your organization Follow your organizations procedures for linking reports to your Web page. by sending it to specific users by email Ensure that all of the HTML files are compressed and mailed to recipients according to your organizations email procedures. on a network for your organization Ensure that all the HTML files are in the appropriate folder on the network, and provide access to the folder according to your organizations procedures.

Export a Report in Excel Format


When you export a report to Excel, you can choose the version of Excel to use. Reports can be rendered in Excel 2000, or Excel 2002 and higher. Reports you export to Excel 2000 have limited rendering, whereas reports exported to Excel 2002 and higher provide full report rendering. When you export reports to Excel 2002 and higher (p. 410), Impromptu provides full rendering of report objects including images, static charts, text frames, and summaries. To render these reports successfully, you can employ certain strategies in your Impromptu reports. For example, you can add worksheet names (p. 412) set worksheet order (p. 412) use data scoping to assist with navigation (p. 414) align objects (p. 411) eliminate overlapping objects (p. 412) avoid splitting reports over multiple worksheets (p. 411) group objects to export them to the same worksheet (p. 413) export summaries as live formulas (p. 414)

Steps
1. Open a report. 2. From the Report menu, click Excel, and in the Version box, click Excel 2000 or Excel 2002 and higher. 3. If you are exporting to the Excel 2002 and higher version, and want to include the following objects, click the check box next to the object: images static charts text frames summary expressions 4. Click OK.

410 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports 5. From the File menu, click Save As, and in the Save as type box, click Excel with Format (.XLS), and click Save. The page breaks you add in Impromptu control the page breaks in the Excel report output. For more information about inserting page breaks, see the Impromptu online help. If the size of a column is less than 1, the column is rendered with a width of 1 pixel in Excel. If you export reports as Excel 2002 and higher without images, static charts, text frames and summary expressions, you still retain the following: list frames and crosstabs data formatting header and footer information column titles Note that the Excel column width of 255 may not be large enough to display the data in your report. If so, change the column width manually within Excel. For more information, check the Excel online help for the topic, "Change column width".

Exporting Reports with Multiple List Frames to Excel


When you render a report containing several list frames, each list frame is exported to a separate worksheet. The list frame keeps the position it held in the Impromptu report. This may give unexpected results in Excel. For example, if you export a report containing two list frames, each list frame appears in a separate Excel worksheet in the same location as in the Impromptu report. White space fills the worksheet area where the other list frame existed before export. To render multiple frames and avoid extra white space in a worksheet, try the following in Impromptu: Export the list frames without images, static charts, and text frames. Tip: From the Report menu, click Excel, and in the Include in Excel Worksheet box, clear the check box next to Images, Static charts, and Text frames. When you export the report, the Impromptu locations are ignored. Each list frame is positioned on a separate worksheet in the upper, left corner.

Avoiding Multiple Worksheets on Export to Excel


If a report contains a large amount of data, splitting it over multiple worksheets may be unavoidable. However, in some cases, a report splits over multiple pages because the Excel column limit is exceeded. If so, you may be able to prevent the split by transposing the columns and rows. This is possible because the limit for rows is 65,536, whereas the limit for columns is 256 per worksheet. Another way to reduce the number of columns is to align report objects (p. 411). For information about moving columns, see the Impromptu online help.

Align Report Objects Before Export to Excel


Each object in a report has two horizontal coordinates and two vertical coordinates. The horizontal coordinates are created at the leftmost and rightmost ends of the object, and the vertical coordinates are created at the top and bottom ends. Each unique horizontal coordinate results in an Excel column. Each unique vertical coordinate results in an Excel row. To eliminate unnecessary rows and columns in the report output, align report objects in Impromptu. Aligning objects reduces the number of unique coordinates, and thereby reduces the number of rows and columns generated in Excel. If the objects exist in a group header or footer, align the objects horizontally to a list frame column. Tip: To reduce the number of unique coordinates, match the report objects by size. When objects match in size, you can align each vertical or horizontal coordinate. For information about sizing objects, see the Impromptu online help. For information about how to align objects, see "Align Report Objects in Impromptu" (p. 406).

Administration Guide 411

Chapter 46: Complex Reports

Eliminate Overlapping Objects in Excel Reports


Similar to HTML report output, you cannot layer objects in Excel report output. When one object overlaps another, even only partly, the object that appears behind another object does not export to Excel. For more information about how overlapping objects are exported, see "Eliminate Overlapping Objects in a Report" (p. 407). If you create Excel reports and warnings appear or, you discover that some objects are missing, check your Impromptu reports for overlapping objects. You can also check the log file to see if anything was discarded. Tip: A log file is generated in the same folder as the Excel output. If the report name is MyReport, the log file name is MyReport_Warning.txt.

Steps
1. Open a report. 2. Resize or move objects so that none overlap.

Add Worksheet Names Before Export to Excel


When reports are exported to Excel, the worksheet names are derived from the list frame names specified in Impromptu. A number is appended to the name to ensure uniqueness. For example, Countries changes to Countries_1. The name is also truncated to 27 characters, if required, so that a number from _1 to _999 can be appended without exceeding the 31 character limit for Excel worksheet names. We recommend that you change the default list frame names to something more meaningful to improve usability.

Steps
1. Right-click the list frame, and click Properties. 2. In the Name box, type a meaningful name, and click OK.

Worksheet Names and Scoped Data


If data is scoped (p. 376), the worksheet name is based on how the data is scoped. If the data is scoped by data group, the worksheet name is based on the data groupings. For example, if data is grouped by product, the worksheet names use the product names, and the product name Star Lite can generate the worksheet name Star_Lite_1. If the report contains a form frame with two list frames with scoped data, the worksheet names appear as Star_Lite_1, Star_Lite_2, Star_Dome_3, and Star_Dome_4. If data is scoped by row, the name is based on the row number. The worksheet name is created by appending a number to the row name. For example, the worksheet name for row 1 becomes row1_1. If the report contains a form frame with two list frames, the worksheet names appear as row1_1, row1_2, row2_3, row2_4, and so on.

Change the Worksheet Order Before Export to Excel


When rendering a report in Excel format and the report has more than one worksheet, you may want to control the way the worksheets are ordered. Worksheets are not ordered alphabetically by the list frame name or ordered by the left-to-right and top-to-bottom order of the respective list frame. Rather, the order is set by the creation and z-order of the list frame in Impromptu. The first list frame created in the z-order generates the first worksheet, the second list frame created generates the second worksheet, and so on. To change the worksheet order, you must change the list frame z-order.

Steps
1. Select the list frame.

412 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports 2. From the Format menu, click Stacking, and click a stacking command such as Send Back or Bring Forward.

Group Report Objects to Export Them to the Same Excel Worksheet


When you export a report to Excel, each list frame is created on a separate worksheet. However, by default, all other objects in the report, such as static images and text frames, are added to the first worksheet. To export report objects and a list frame to the same worksheet, add them to the same form frame before export.

Steps
1. Open the report, and from the Insert menu, click Form Frame. 2. Drag the list frame and the report objects into the form frame. The form frame becomes the parent object. 3. Save your changes and export the report to Excel.

Rendering Headers and Footers in Excel Report Output


Some limitations apply when exporting reports with headers and footers to Excel. To export headers and footer successfully, consider the following: List frames and crosstabs added to report headers or footers are not rendered in Excel format. Scoped data is not applied in Excel report output. Only the first data grouping is used in the Excel header or footer. For information about keeping the objects in the data group together on export, see (p. 413). Text length cannot exceed 256 characters. The ability to position text is limited. Text color, background color, borders, and patterns cannot be set. Images cannot be added.

Exporting Row and Column Titles to Excel


When column titles are exported to Excel, they are treated as Excel titles that repeat on the top of each printed page. It is as if the Excel page setup option, Rows to appear at top, was selected. When row titles in crosstab reports are exported, row titles repeat at the left of each printed page. It is as if the Excel page setup option, Columns to repeat at left, was selected. If a report splits across more multiple worksheets, the column and row titles are repeated as well. However, they are added only to the worksheets that contain the list frame or crosstab report that use the column and row titles.

Export a Report to Excel with Images in the Header and Footer


You can insert multiple static images in the report header and footer and have the images rendered in the Excel report output. This can provide a useful way to include the company logo, for example. To render such images successfully, you must specify that the report output format is Excel 2002 or higher and then save the report as Excel with Format. You can save your reports as Excel with Format in Impromptu or you can publish them to Impromptu Web Reports and then save them with this format.

Steps
1. Open a report in Impromptu. 2. From the Report menu, click Excel, and in the Version box ensure that the Excel 2002 and higher option is selected. Click OK. 3. From the Insert menu, click Picture Frame and with the pointer draw a frame in the header, and then, in the Picture Properties dialog box, specify the image to use. Click OK. To add an image to the footer, repeat step 3 but create the frame in the footer instead. For more information about adding static images to a report, see Impromptu User Reference. Administration Guide 413

Chapter 46: Complex Reports 4. From the File menu, click Save As, and save the report as Excel with Format (*XLS). You are warned if there are any problems with the report output if you have warnings messages set to show in the Report Properties dialog box. 5. Open the report in Excel. To view the header and footer, from the File menu, click Page Setup and click the Header/Footer tab. To see how the header and footer appears on the report page, from the File menu, click Print Preview.

Using Summaries in Excel Report Output


Summaries may be exported as static text, or as live Excel formulas. To render summaries as formulas, select the option to include summary expressions on export (p. 410). Otherwise, they are treated as static text. To render summaries as live formulas, include the formula and the data relevant to the summary in the list frame or crosstab report. Only simple, non-nested summaries are exported as summary formulas. Formulas with nested or multiple functions, such as Total (Qty *3), Total (Min(Qty)), and Total (Qty) for Country are exported as static text. The following summary calculations are supported as Excel formulas: total, minimum, maximum, average, standard deviation, variance, and count. Summary formulas are supported in Excel using hidden worksheets that store the contiguous data ranges and arguments used by the formulas. The summary formulas on the visible worksheets are updated from the hidden worksheets. Tip: You unhide hidden worksheets in Excel using the Unhide command. Summary expressions are rendered as static text when the summary is included in the report as follows: in a page header or footer in a stand alone text frame in nested, multi-dimensional crosstabs where data is interleaved in a column that has conditional formatting using the hidden style with an associated column that does not appear as a column in the report in a report that splits across multiple worksheets (p. 411).

Using Data Scoping to Enhance Excel Report Output


In Impromptu reports, you can scope data added to a form frame (p. 376) to specify the data to show by row, by a data grouping, or have all the data appear. When data is scoped by grouping, such as product, you can view data for each product individually. Data that is scoped by row or group is exported to separate worksheets in Excel. This provides useful navigation to Excel users similar to PDF bookmarks in PDF output. For example, if data is scoped by country, a worksheet for each country is generated. Worksheet names are created based on the name of each group, such as AUS_1, CAN_2, GER_3 (p. 412).

Export a Text Field with Leading Zeroes to Excel


When you author an Impromptu report, save it as a comma delimited ASCII file (.csv) and open it in Excel, leading zeroes in text columns are dropped. For example, a zip code such as 01803 is truncated to 1803. When you author reports, you can select an option that retains leading zeroes in text fields on export. By default, leading zeroes are not retained. You can save reports that retain leading zeroes in .csv file format from Impromptu or Impromptu Web Reports. To generate the CSV output in Impromptu Web Reports, you must first author the reports in Impromptu and then publish them to Impromptu Web Reports. Syntax that allows you to retain leading zeroes on export to Excel is now available in automated reports. For information about this syntax, see Impromptu Macro Help.

414 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports

Steps
1. In Impromptu, open a report that uses text values with leading zeroes. 2. From the Report menu, click General, and in the Report Properties dialog box, select the option Mark text fields for import into Microsoft Excel. Click OK. 3. From the File menu, click Save As, and specify a name and location for the report. 4. In the Save as type box, click Delimited ASCII (*.CSV), and click Save. After saving the file, to view the changes to the file format, open the file in a text editor. Note that an equal sign is inserted now before the opening quotation marks of strings. For example, you find ="00010", ="Sales" instead of "00010", "Sales". 5. Browse to the location of the .csv file you created and open it with Excel. Note that in the Excel spreadsheet the leading zeroes appear in the text column.

Export a Numeric Field with Null or Missing Values to Excel


When you author and save an Impromptu report as a comma delimited ASCII file (.csv) and open it in Excel, by default, numeric fields with missing or null values appear as empty cells. When you author reports, you can select an option to have null or missing values appear as zeroes. Reports you author with this option can be saved in CSV file format from Impromptu or published to Impromptu Web Reports and then saved in CSV file format. You can also create automated reports that export numeric fields with missing or null values as zeroes. For information about the new syntax that supports this functionality, see Impromptu Macro Help.

Steps
1. In Impromptu, open a report that has numeric fields with null or missing values. 2. From the Report menu, click General, and in the Report Properties dialog box, select the option Output numeric fields with missing values as 0 (zero). Click OK. 3. From the File menu, click Save As, and specify a name and location for the report. 4. In the Save as type box, click Delimited ASCII (*.CSV), and click Save. 5. Browse to the location of the .csv file you created and open it with Excel. In the Excel spreadsheet the null or missing values appear as zero (0).

Export a Form Frame within a List Frame To Excel


When you export a report to Excel 2002, you can render the text content of a form frame. Note that although text content is rendered, other objects within the form frame, such as formulas, images, charts, OLE objects, and list frames are not rendered. Rendering text content in a form frame can have performance implications, depending on the report. If the report contains many text frames, you may encounter some degradation in performance because more data is being exported. The greater the file size, the more time is required to render and open the file. Only Excel 2002 and higher supports this feature. Note: The Text frames option on the Excel tab of the Report Properties dialog box does not affect the export of text frames within list frames. This option applies only to text frames outside a list frame.

Steps
1. In Impromptu, open a report that contains a form frame in a list frame. 2. From the File menu, click Save As and save the report in Excel with Format (.XLS). If your report contains any unsupported objects in the form frame, a warning message is issued. The warning message appears only if the report is created with the Show the Warning Messages dialog for HTML and Excel report output option selected. This option is located in the Report Properties dialog box, on the General tab. 3. Browse to the location of the report output (.xls) file and open the file using Excel.

Administration Guide 415

Chapter 46: Complex Reports

Report Output in Excel


When exporting list frames, the text within each text frame of a form frame, including spaces and line feeds, is rendered as a combined text string. Each text string is separated by a single space. The combined text string is inserted into a single cell in the Excel worksheet as follows. Impromptu Report form frame within a list frame Text1 Text2 worksheet cell Excel Worksheet Text1 Text2

text frame

Exporting text frames in form frames affects such things as existing data formats and content layout. Also, certain objects are not rendered. Here is a list of objects and a description of how they are rendered. Object Combined text string (format) Report output Formatted the same as the text in the first text frame. For information about controlling the format of the text string on export, see (p. 416). Cannot exceed the maximum number of characters for an Excel cell which is 1,024 characters or the Excel formula bar which is 32,767 characters. Combined text string (sequence) Data formats Sequenced from top-left to bottom right and then z-order. For more information about content sequencing, see (p. 417). Exported to Excel using the General format option in Impromptu. This option is applied because Excel allows only one data format per cell, whereas Impromptu allows a different format for each text frame. For example, the raw number data 102334.23 is rendered as $10,234.23 and the raw date data 2005-08-15 11:27:00:000 is rendered as 8/15/2005 11:27AM. Rendered. Not rendered. Not rendered. Not rendered.

Form frame borders Text frame borders Text frame patterns Images, OLE objects, charts, and list frames

Content Formatting
On export, the text attributes of only the first text frame are used to format the combined text string. To control the font applied to the combined text string, do the following: Insert a text frame in the form frame of the Impromptu report. The text frame can be blank, however, it must be formatted to the desired font. Position the text frame such that the rendered frame is sequenced first in the combined text string. For more information about content sequencing, see (p. 417).

416 IBM(R) Cognos(R) Impromptu(R)

Chapter 46: Complex Reports

Content Sequencing
The position of the text frames in the form frame specifies the sequence of the strings in the combined text string exported to Excel. The content of the text frames is retrieved from the top-left to the bottom right, and then, in z-order. The top-most vertical (y) position of the text frame sets the vertical position. The horizontal center of the text frame sets the horizontal (x) position. When creating the sequence, the text frame with the topmost vertical position takes precedence over text frames with a lower vertical position. If the vertical positions are equal, the text frame with the leftmost horizontal (x) position takes precedence. If the horizontal and vertical positions are equal, the placement of the text is set by the z-order. Here is a graphical representation showing the vertical and horizontal positions of two text frames in a form frame and a flowchart showing how the text strings, Text1 and Text2, are sequenced based on the horizontal and vertical positions of the text frames, TextFrame1 and TextFrame2. Form Frame with Text Frames Y positions (Y2<Y1) X1 X2 X positions

Y2 Text2 Y1 Text1 TextFrame2

TextFrame1

Flowchart
Start

No

Y1=Y2

Yes

No

Y1<Y2

Yes

No

X1=X2

Yes

Order: Text1 Text2 No X1<X2 Yes

No

Z1<Z2

Yes

Order: Text2 Text1

Order: Text2 Text1

Order: Text1 Text2

Administration Guide 417

Chapter 46: Complex Reports The following table shows some typical rendering scenarios: Impromptu Input Text Frames with Different X and Y Axis Positions Form Frame Text2 Text1 Excel Output Text2 Text1

Text Frames with Different X and Y Axis Positions Form Frame Text3 Text1 Text2

Text3 Text2 Text1

Text Frames with Y Axis Positions Equal Text1 Form Frame Text2

Text2 Text1

Text Frames with Y Axis Positions Equal and Text1 created prior to Text2 Text2 Text1

Text1 Text2

Form Frame

Nested Form Frames

Form Frame2 Text2

Text1 Text2

Form Frame1

Text1

Overlapping Text Frames

Text2 Text1

Form Frame

Text1

Text2

Form Frame with Unsupported Objects

Text1

Form Frame1

Text1

Image, chart, OLE object, list frame object

418 IBM(R) Cognos(R) Impromptu(R)

Chapter 47: Data and Databases


This chapter discusses how Impromptu uses data in creating reports. It includes a discussion of how Impromptu retrieves data your options in choosing data sources

Choose Your Data Source


You have several choices in working with the data from which you create reports in Impromptu. To make the best decisions about how to maintain the report data, you must first understand how Impromptu retrieves data a database is attached to your catalogs copies of the data can be used you can format the data

How Impromptu Retrieves Data


Your Impromptu reports show information retrieved from the database. When a report requires information, Impromptu accesses the database via a catalog.

You run a query You open a catalog that points to your view of the data in the database

Impromptu generates SQL Impromptu retrieves data from the database

The resulting report shows your data in a meaningful format

A catalog insulates you from the complexities of the database, letting you focus on analyzing the data that drives your business. As the bridge to the database, a catalog points to the data (name, location, contents) controls what data can be accessed by each class of catalog user presents a business view of the information in the database When you request information from the database, Impromptu generates a Structured Query Language (SQL) query based on your request and passes it to the database. The database then selects the data for your report and sends the result set back to Impromptu. Your Impromptu administrator creates the catalogs you use. An administrator can create a catalog that meets different user requirements.

Administration Guide 419

Chapter 47: Data and Databases

Take Advantage of a Cache Query


A cache query is a temporary cache on your personal computer that Impromptu uses to store report results. When you use the Cache Query checkbox (Access tab, Query box), Impromptu uses the cache query results stored locally and will only query the database when required. This improves Impromptus performance when your reports tend to require the same information from report to report.

Tip
You can usually achieve the same performance results by using the Cache Query check box as you can by using thumbnails. For information about thumbnails, see (p. 421).

Steps
1. From the Report menu, click Query and click the Access tab. 2. Select Database as the data source. Select the Cache Query Results check box and the Limit Data To check box, and specify the number of rows.

How Databases are Attached to Catalogs


By default, when you open a report, Impromptu automatically attaches to the associated database to retrieve the report data, and you can not use the report until data retrieval is complete. To avoid waiting for large amounts of data to be retrieved, you can disable the option that automatically attaches Impromptu to the database. For information about how to open reports, see the Impromptu online Help.

Disable the Auto-Attach to the Database Option


You can turn off the Auto-attach to the Database option (for all databases or for one database) to view a report without any data. This enables you to verify that youve selected the correct report and check the layout and formatting in the report. Once you verify the report, you can connect to the database to retrieve the data using the Connect and Retrieve commands. For information about these commands, see the Impromptu online Help. In the Index tab, type either connecting to the database retrieving data

Step to Turn Off Automatic Retrieval


Clear the Auto-Attach to the Database When the Catalog is Opened check box in the General tab of the Options dialog box (Tools menu).

Step to Turn Off Automatic Retrieval for a Specific Database


Clear the Connect to the Database check box (Catalog Logon dialog box) when you log on to a catalog.

Note: If the auto-attach option is turned off for all databases, you can use the Catalog Logon dialog box to turn the auto-attach option back on for the database.

Your Copy of the Database


When you create reports for distribution, it is important that reports run efficiently. To enhance the performance of your reports, you can distribute the copies of the data in any of the following formats: local snapshots thumbnails

420 IBM(R) Cognos(R) Impromptu(R)

Chapter 47: Data and Databases HotFiles

HotFiles remain linked to the source database and can be updated with changes to the database. Snapshots and thumbnails are independent of the source, and so are not updated.

Local Snapshots
A local snapshot is a permanent copy of the data stored as part of your report. Like a photograph, it captures the data as it existed when you created the snapshot. However, because the data is part of the report, it cannot be used to generate new reports. Use local snapshots when you want to run reports without opening a catalog want a static view of the data at a particular point in time want to be able to view the report without access to the source database do not need to add new tables or data to your report You can use local snapshots when you want to compare the state of the database at different times, but do not need to be able to run new reports against the data. For example, you run a query to generate a report of the current monthly sales. The information in the report changes daily, but you want to preserve the current results for comparison. You save the data in this report as a snapshot so you can compare this data to future monthly sales reports. For information about creating local snapshots, see the Impromptu online Help. In the Index tab, type one of snapshots creating, a local copy of report data

Thumbnails
When you use thumbnails, Impromptu retrieves only the number of rows you specify and then saves them temporarily on your computer. Impromptu attempts to use only the data in the thumbnail when you run a query. If your query requires information that is not in the thumbnail, Impromptu accesses the database and retrieves the information required. When you close the current report, the thumbnail is discarded. For example, if you work with a thumbnail of 30 rows, Impromptu retrieves the first 30 rows from the database and then uses the 30 rows as the data source for your queries. If you add a column to the query, Impromptu must retrieve the new data from the database. A thumbnail is an efficient way to test your report before running the query against a large database. For information about performance and thumbnails, see (p. 444).

Steps to Create Thumbnails


1. From the Report menu, click Query and then click the Access tab. Note: If you do not see the Access tab, select the Show Advanced Tabs in the Query Dialog Box check box (Options tab, Tools menu). 2. In the Data Source box, click Thumbnail Of and enter the number of rows you want in the thumbnail (the default is 30). 3. Click OK.

Tip
To quickly create or remove thumbnails, use the thumbnail toolbar button.

Use HotFiles
A HotFile is a separate locally saved data table that you can use in a report. When you use HotFiles, Impromptu accesses the data contained in the HotFile and does not go to the database to retrieve the required information. You can use a HotFile Administration Guide 421

Chapter 47: Data and Databases as the data source for your report when you want to work without being connected to the database. For example, if you generate daily reports based on the sales made on the previous day, you create a HotFile automatically every day that you use as the data source for the daily reports. in your report so that you can include data items that are only available in a separate database but are not in your catalog. For example, you want to test a theory that expenses are proportional to salary, and the salary data item is in a separate database. You create a HotFile for use in your report that contains the salary data item.

If you have the Administrator version of Impromptu, you can join Hotfiles to database tables. Doing so, however, may have a negative impact on performance. For information about performance issues, see "Optimize Performance in Impromptu" (p. 435). Saving historical data using HotFiles offers a number of advantages over independent copies of the data like thumbnails or snapshots. Use a HotFile when you want to create new reports with the data cut, paste, calculate, and filter the data as required join to database tables in the catalog use it exactly like a database table save the data with your catalog

Steps to Create a Hotfile


1. 2. 3. 4. Create or open the report with the data items you want in your HotFile. In the File menu, click Save As. In the Save As Type box, select HotFile. Type the file name and click OK. Impromptu creates a HotFile with the name you chose, and assigns the extension .ims to the HotFile.

Tip
To update the data or change the data in a HotFile, connect to the database and open the report with the data items you require. Save the report to replace the existing HotFile.

Steps to Use a HotFile in a Report


Open a report, or create a new report with the data items you need. From the Report menu, click Query. In the Data Source box, click HotFile. Click Browse to locate and select the folder that contains the HotFile, and click OK. All HotFiles in the folder appear in the Data tab (Query dialog box). 5. Double-click the HotFile folder to open it, and double-click the HotFile data items you want to add to the Query Data box. 6. Click OK. Impromptu adds the data items you selected from the HotFile to your report. 1. 2. 3. 4.

Share HotFiles on the LAN


You can share a HotFile on the LAN. For example, if you just created a report with data that you think other people can use, you can save the report as a HotFile and copy it to the LAN for others to use. Sharing HotFiles on the LAN means everyone can use the same HotFile. For example, if you have a sales account HotFile created every morning when you open the sales report, and several people in your department ask you for your daily HotFile, you can copy the HotFile to the LAN for everyone to use.

422 IBM(R) Cognos(R) Impromptu(R)

Chapter 47: Data and Databases

Create a HotFile Automatically


You can set up a macro that automatically creates a HotFile each night to save time on lengthy report execution during business hours. For example, you have a report that contains a complicated calculation for profit margin that takes 45 minutes to execute. You have to create this calculation with new data each day. You create a macro in Impromptu that creates a profit margin report with the new data and saves it as a HotFile overnight using the IBM Cognos Scheduler. For information on macros, see the Macro online Help. You can also use Scheduler to automatically run a report and save it as a HotFile. For information about using Scheduler to automatically create a HotFile, see the Scheduler online Help. In the Index tab, type either running, remote tasks running, unattended tasks

Administration Guide 423

Chapter 47: Data and Databases

424 IBM(R) Cognos(R) Impromptu(R)

Chapter 48: About Catalogs


This chapter discusses catalogs. It tells you how catalogs work how to make your own catalogs what you can modify or customize

What Can You Do with Catalogs?


You can use catalogs to view, run, and print reports export reports to other applications disconnect from and connect to the database You may also be able to create reports change the contents of the catalog add user classes lock a catalog If you are the creator of the catalog, you can modify any of the folders and their contents. If you are not the creator and you are working with a personal copy of a distributed catalog, you may be able to add folders to your copy and add data items to your folders. If you are the creator of the catalog, you can lock and unlock the catalog. Locking a catalog prevents a user from opening it using the creator user class, unless the user provides additional credentials for authentication. For more information about catalog locking, see Locked Catalogs.

Use Catalogs
The administrator sets up and manages the master distributed catalog and assigns certain attributes to the catalog. These attributes include catalog access catalog permissions that define the tasks a particular user class can perform You will have permission to perform certain tasks according to your user class. For example, the administrator stores the master distributed catalog on a LAN and gives the Sales user class access to the catalog, but denies the Sales user class permission to modify the catalog. In this case, all individuals who are part of the Sales user class share access to the catalog on the LAN. They can create reports but cannot change the catalog. The catalog you use will be either a shared catalog, a personal distributed catalog, or a locked catalog.

Shared Catalogs
A shared catalog is created and maintained by an administrator. Typically, it is stored on the LAN and is shared by all users with access permission. You cannot edit catalog folders within a shared catalog; however, depending on your user profile, you may be able to create and edit reports, or you may be able to view reports. For more information about shared catalogs and how to create them, see the Impromptu Administration Guide.

Administration Guide 425

Chapter 48: About Catalogs

Personal Distributed Catalogs


A personal distributed catalog is a copy of a master distributed catalog set up and managed by your administrator. All users with access to the master distributed catalog can create a personal distributed catalog. A personal distributed catalog maintains links to the master distributed catalog. When the administrator changes the master distributed catalog, Impromptu uses these links to automatically update your personal distributed catalog the next time it is opened. Any changes you made to your copy are retained when the update occurs. If you have a copy of a catalog on your computer, you can disconnect from the LAN and continue to work with the catalog (for example, on business trips). By default, when you work with a personal distributed catalog, Impromptu automatically updates your copy when you reconnect to the LAN. For information about modifying catalogs, see (p. 428). Note: Your administrator may have given you permission to make changes to a catalog. The scope of the changes that you can make depends on the privileges assigned to your user class.

Locked Catalogs
A locked catalog restricts access to the Creator user class. When a member of the Creator user class catalog attempts to open a locked catalog, they must provide password authentication to unlock the catalog before opening it. A catalog lock is specified by the administrator and exists in addition to the common logon authentication required by IBM Cognos products and the catalog logon authentication. If a user, who is not a member of the Creator user class, attempts to open a locked catalog, they are prompted for the usual catalog logon credentials only. By default, the Creator user class has unrestricted access to a catalog and can restrict access to other user classes. Typically, this is how you want catalog access to be managed. However, there may be certain occasions when you want to restrict access even to members of the Creator user class. For example, you have secured your catalog with a userid and password, but have not secured it using an Access Manager namespace. In this situation, any user can access a catalog, if the Access Manager runtime configuration is set to any namespace that has a Creator user class, and the user attempting to log on is a member of the Creator user class. As an administrator, you can control catalog access to the privileged Creator user class by setting a lock on the catalog.

Lock a Catalog
Locking a catalog prevents a user from opening it using the Creator user class, unless the user provides an additional password for authentication. After you open a locked catalog using the necessary authentication, you can remove the lock on the catalog. For information about opening a locked catalog, see "Open and Unlock a Catalog" (p. 427).

Steps
1. From the Catalog menu, click Lock Catalog. The Lock Catalog command is only enabled when the following holds true: the catalog is opened by someone belonging to the Creator user class the catalog is opened in read and write mode 2. In the Lock Catalog dialog box, in the Password box, enter a password. 3. In the Confirm Password box, enter the password again. 4. Click Lock Catalog. When a catalog is locked and a user belonging to the Creator user class tries to open it, the user is prompted to enter a password before gaining access to the catalog. This password is requested in addition to the IBM Cognos Common Logon and the Catalog Logon passwords. Users that do not belong to the Creator user class are not prompted for the Open Locked Catalog password since they do not require Creator privileges.

426 IBM(R) Cognos(R) Impromptu(R)

Chapter 48: About Catalogs

How Catalogs Open


To create or run Impromptu reports other than snapshot reports, you must first open a catalog. For information about opening catalogs, see the Impromptu online Help. When you routinely use a specific catalog, you can automatically open it using a shortcut on your desktop. Impromptu must not be running when you use this shortcut use a command line start-up switch to start Impromptu and open a catalog define the catalog to be automatically loaded when you start Impromptu (Start-up tab, Options dialog box)

Open and Unlock a Catalog


Before you can unlock a catalog, you must first open it using the credentials the administrator specified when the lock was created. After you open the catalog, you can then change the status from locked to unlocked. For information about locking a catalog, see (p. 426).

Steps
1. From the Catalog menu, click Open. 2. Browse to the catalog and click Open. 3. If the IBM Cognos Common Logon dialog appears, enter a user id and password and click Log On. 4. In the Catalog Logon dialog box, in the User class box, click Creator, and click OK. If you are a member of the Creator user class that belongs to the catalog namespace, your password is supplied. 5. In the Open Locked Catalog dialog box, enter a password and click OK. The catalog opens. You can now permanently unlock the catalog, if you choose. 6. To remove the lock from the catalog, from the Catalog menu, click Unlock Catalog. 7. In the Unlock Catalog dialog box, click Unlock Catalog.

Create a Personal Distributed Catalog


To work with a personal distributed catalog for the first time, you must create it from the master distributed catalog. In subsequent Impromptu sessions, you open the personal distributed catalog directly.

Steps
1. Open a master distributed catalog. 2. In the Catalog Logon dialog box, click OK. The Make a Copy of This Distributed Catalog checkbox (Catalog Logon dialog box) is automatically selected and grayed out if you are not the creator of the catalog. 3. Specify a name and location for your personal distributed catalog in the File Name box (Name Your Copy of the Catalog dialog box) and click OK.

How Catalogs You Create are Updated


By default, Impromptu automatically updates your personal distributed catalog each time it is opened. Tables, joins, user classes, folders, columns, calculations, conditions, and prompts that are updated from the master distributed catalog are overwritten, in the case of tables and joins merged, in the case of folders and user classes added if they don't already exist removed if they were copied from the master distributed catalog in a previous update and no longer exist in the current master distributed catalog.

Administration Guide 427

Chapter 48: About Catalogs

Disable Automatic Catalog Updating


You may want to turn off automatic catalog updating to increase your work efficiency. For example, when you work disconnected from the network, Impromptu displays the message that it cannot locate the master catalog to update your personal distributed catalog. If you disable automatic updating, this message does not appear. You may also want to turn off automatic updating to retain your copy of the master distributed catalog without updating it with the new master distributed catalog. For example, if the administrator is making changes to the master distributed catalog over a period of days, rather than update your copy of the catalog each time you open it, you can turn off automatic updating until the administrator notifies you that the master distributed catalog is ready. Then you can update your copy. If you disabled automatic updating, and you are connected to the LAN, you can manually update the catalog when it is open.

Steps to Change Automatic Catalog Updating


1. 2. 3. 4. Open your personal distributed catalog. From the Catalog menu, click Properties. Select or Clear the Update Automatically check box. Click OK.

Step to Manually Update a Personal Distributed Catalog


From the Catalog menu, click Update Catalog.

What Can You Change?


If your administrator enabled the Folders command and gave you the required permissions, you can change the catalog by renaming folders and data items creating new folders in the catalog moving folders and data items to new locations in the catalog sorting folders and data items storing filters, calculated data items, summaries, and prompts in the catalog adding user subclasses and modifying their profiles You can only change the catalog when all reports are closed. The types of changes you can make depend on whether you use a shared or distributed catalog.

Note
Many of the features in the following sections are available only if you have administrator privileges or if your administrator has enabled them for you.

Changes to Shared Catalogs


For a shared catalog, you may be permitted to change any of the existing content and add content. For example, you may be able to rename a folder, move data items from one folder to another, and add a new folder. Because the administrator and other users may also have permission to make changes to the catalog, be careful not to overwrite other users changes.

Changes to Personal Distributed Catalogs


For a personal distributed catalog, do not worry about affecting other users work. You can only add content and change the content that you added. You cannot change content copied from the master distributed catalog, so you do not make changes that will be overwritten when the catalog is updated.

428 IBM(R) Cognos(R) Impromptu(R)

Chapter 48: About Catalogs

Upgrade and Update Personal Distributed Catalogs


If you upgrade or change the location of a master copy of a distributed catalog, the personal copy won't be able to recognize or find it. When you open the personal copy you will get the Source Catalog Not Found message. If you click Change and select the correct master catalog, Impromptu will both update and upgrade your personal copy, even if the Update Automatically On Open checkbox is cleared. If you do not want to upgrade distributed copies of a catalog, make a backup of your personal copy of the catalog before you upgrade it.

Rename Folders and their Contents


You can rename folders and data items to make their names more intuitive to the catalog users. For example, you rename the "Qty" data item to "Quantity".

Steps
1. Make sure that the catalog is open and all reports are closed. 2. From the Catalog menu, click Folders. Note: If the Folders command is not available, contact your administrator. 3. In the Folders dialog box, select the folder or data item you want to rename. 4. Click Edit. If you selected a calculation or filter condition, the Edit Calculation or Edit Condition dialog box appears in which you can edit the name and expression for the selected item. For information about filters, see (p. 318). For information about editing calculation expressions, see "Create Calculated Fields" (p. 344). 5. Click OK to close the dialog box, and click OK again to close the Folders dialog box.

Note
Any folders and data items that you do not have permission to modify are marked with the Denied icon.

Create Catalog Folders


You can reorganize the contents of your catalog by creating new folders.

Ways to Create Catalog Folders


To add folders to a catalog, you can create either an empty folder from scratch a folder from a report If you have a report that contains complex calculated data items, summaries, and filters, you can save time by generating a folder from the report. Note: You can also copy a folder using the Copy button (Folders dialog box).

Examples
You create a folder called "Favorite Data Items" that contains the 20 data items you use frequently. You can put data items from different folders in your new folder. You have a report that contains some columns, including a summary and a complex calculation. The report is filtered. You create a folder from this report and the folder contains all the data items in the report.

Steps to Create an Empty Folder


1. Make sure that the catalog is open and all reports are closed. 2. From the Catalog menu, click Folders. Note: You can move folders any time. If you want the new folder to appear in a specific location, select a folder, and the new folder appears before the selected one. Otherwise, the new folder appears at the end of the list. 3. In the Folders dialog box, click New Folder. Administration Guide 429

Chapter 48: About Catalogs 4. In the New Folder dialog box, type the name of the new folder in the Name box, and click OK.

Steps to Generate a Folder from a Report


1. Make sure that the catalog is open and all reports are closed. 2. From the Catalog menu, click Folders. Note: The Folders command is available if you are the creator of the catalog or if your administrator gave you the required permission. If the Folders command is unavailable, contact your administrator. 3. If you want to store the new folder in a specific folder, double-click that folder to open it. 4. Click Generate. 5. In the Generate Folder Based On box, click Report and then click OK. 6. In the Select Report dialog box, locate and select the report containing the desired columns and conditions and click Open. 7. Click OK.

Tip
To remove unnecessary folders and items, click Folders from the Catalog menu. Then select the folder or data item you want to remove. Click Cut and click OK.

Move Folders and their Contents


You can move folders and data items to new locations. For example, you move the Sale Amount item from the Order Details folder to the Orders folder.

Steps
1. Make sure that the catalog is open and all reports are closed. 2. From the Catalog menu, click Folders. Note: You can move folders any time. If you want the new folder to appear in a specific location, select a folder, and the new folder appears before the selected one. Otherwise, the new folder appears at the end of the list. 3. In the Folders dialog box, do one of the following: If you are moving a folder, select the folder you want to move. If you are moving a data item in a folder, double-click the folder where the data item is located, and then select the data item you want to move. 4. Click Cut. 5. Do one of the following: If you are moving a folder, select the folder above which you want to paste the cut folder. If you are moving a data item, select the folder into which you want to paste the item. 6. Click Paste and click OK.

Tips
To copy a folder or data item rather than move it, select it and click Copy. Then open the destination folder and click Paste. To better view long lists of folders and data items, resize the Folders dialog box. To sort folders and folder items, click the Sort icon above the Catalog folders box. You can sort in ascending or descending alphabetical order, or restore the default sort order.

Store Filters in Catalogs


You store complex or frequently-used filter conditions in the catalog. When you need to use a filter, you can select it from the catalog rather than recreate it. You also control the definition of the filter, so all users of this catalog have the correct filter definition. For information about creating filters, see (p. 319).

430 IBM(R) Cognos(R) Impromptu(R)

Chapter 48: About Catalogs For example, you create a condition so you see only data for your sales region when you use the condition. If a new area is added to the region, add the new area to the condition once, and all reports change to show the new area in the region.

Steps
1. From the Catalog menu, click Folders. 2. If you want the new filter to appear in a specific location, select a folder, and the new filter is added to it. Otherwise, the new filter appears at the end of the list. Note: You can move filters any time. 3. In the New box (Folders dialog box), click Condition. 4. In the New Condition dialog box, type a name for the condition in the Name box. Note: Use this name to identify the condition when you use it in reports. 5. Build an expression. 6. Click OK to close the New Condition dialog box. 7. The new filter appears in the Catalog folders box. 8. Click OK.

Tip
To remove a catalog condition, select the condition you want to remove in the Folders dialog box, and click Cut. For information about creating conditions, see (p. 354). If you are responsible for deploying catalogs and want more information about including conditions in catalogs, see the administrator.

Change a Predefined Filter Condition


If you have the necessary permissions, you can edit or rename predefined filter conditions.

Steps
Close any open reports. From the Catalog menu, click Folders. Select the condition you want to change, and click Edit. Do one of the following: If you want to change the condition, select the part of the condition you want to change, and click OK. If you want to change the name of the condition, type a new name for the condition in the Name box. 5. Click OK to close the Edit Condition dialog box, and click OK again. All reports that use this condition will automatically change when you change the condition. 1. 2. 3. 4.

Store Calculated Data Items and Summaries in Catalogs


You can save time by storing complex or frequently-used calculations and summaries in the catalog. When you need to use a calculation or summary, you can select it from the catalog rather than recreate it. You also control the definition of the calculation, so that users of this catalog who need this calculation or summary in their query have the correct calculation definition. You can use these predefined calculations or summaries on their own or as part of the definition of another calculated data item you create. You can store calculated data items and summaries in a catalog as follows: If a calculated data item or summary exists in a saved report, save the entire report as a catalog folder, then delete the data items you do not want in the folder. Create a new calculated data item or summary directly in a catalog folder. For information about creating calculated data items, see "Create Calculated Fields" (p. 344). For information about creating summaries, see (p. 336).

Administration Guide 431

Chapter 48: About Catalogs For example, you have a report that contains a calculated data item called Profit. This calculated data item subtracts Prod Cost from Prod Price for each product. You want to store this calculated data item in the catalog for use in other reports you create with the same catalog.

Steps to Store Existing Calculated Data Items and Summaries


1. Make sure that the catalog is open and all reports are closed. 2. From the Catalog menu, click Folders. 3. If you want the item to appear in a specific location, select a folder, and the item is added to it. Otherwise, the item appears at the end of the list. 4. In the Folders dialog box, click Generate. 5. In the Generate Folder dialog box, click Report, and click OK. 6. Select the report that contains the calculated data item or summary you want to add to the catalog, and click Open. Note: A new folder containing the report you selected appears in the Catalog Folders box. The folder name contains the report path and file name. 7. In the Catalog Folders box, double-click the new folder. 8. Select the data items you do not want to add to the catalog. 9. Click Cut to delete the unwanted data items, and click OK.

Tip
To rename the new folder, select it in the Catalog Folders box (Folder dialog box) and click Edit. Type the name in the Name box (Edit Name dialog box) and click OK.

Steps to Create and Store Calculated Data Items and Summaries


1. Make sure that the catalog is open and all reports are closed. 2. From the Catalog menu, click Folders. 3. If you want the item to appear in a specific location, select a folder, and the item is added to it. Otherwise, the item appears at the end of the list. 4. In the New box (Folders dialog box), click Calculation. 5. Type a name for the calculation in the Name box (New Calculation dialog box). 6. Build an expression. For information about creating expressions for calculated data items, see "Create Calculated Fields" (p. 344). 7. Click OK to close the New Calculation dialog box, and click OK again.

Note
If you are responsible for deploying catalogs and want more information on including calculations in catalogs, see your administrator.

Tips
To rename the calculated data item or summary you stored in the catalog, select it in the Catalog Folders box (Folders dialog box) and click Edit. Type the name in the Name box (Edit Calculation dialog box) and click OK. To change a calculation you stored in the catalog, select the calculated data item you want to change, click Edit, change the expression in the Edit Calculation dialog box, and click OK. Click OK again to exit from the Folders dialog box. When you change the calculation, all reports that use this calculation automatically change.

Create and Store Prompts in Catalogs


You can create prompts in a catalog and reuse them in different reports you create with the catalog. Each time you want to include a prompt in a report, select it from the catalog rather than re-create it. You can store prompts in a catalog by creating a prompt directly in a catalog folder. For information on types of prompts, creating and editing prompts, and organizing prompts within a report, see (p. 325). 432 IBM(R) Cognos(R) Impromptu(R)

Chapter 48: About Catalogs For example, you have a report containing a picklist prompt that requires you to select a branch from a list of all branches in the database. You frequently filter reports by branch, so you decide to store this prompt in the catalog. You can later add this prompt to any report so you can quickly filter on a branch.

Steps to Create and Store Prompts


1. Make sure that the catalog is open and all reports are closed. 2. From the Catalog menu, click Folders. 3. If you want the prompt to appear in a specific location, select a folder, and the prompt is added to it. Otherwise, the prompt appears at the end of the list. 4. In the New box (Folders dialog box), click Prompt. 5. Type a name for the prompt in the Name box (Prompt Definition dialog box). Note: You will use this name to identify the prompt when you use the prompt in reports. 6. In the Data Type box, select the type of prompt you want. The lower half of the dialog box changes depending on the type of prompt you select. 7. Type a message in the Message box. This is the message that appears with the prompt. 8. Complete the lower portion of the dialog box, click OK, and click OK again to close the Folders dialog box. The prompt is now in the catalog. You can use it in any report that you create with this catalog. For information about creating different types of prompts, see (p. 325).

Note
If you are responsible for deploying catalogs and want more information on including calculations in catalogs, see your administrator.

Tips
To rename the prompt you stored in the catalog, select it in the Catalog Folders box (Folders dialog box) and click Edit. Type the name you want in the Name box (Prompt Definition dialog box), and click OK. To change a prompt you stored in the catalog, select the prompt you want to change in the Folders dialog box, click Edit, change the prompt and click OK. Click OK again to exit from the Folders dialog box. When you change a prompt, all reports that use this calculation automatically change.

Add User Classes


A user class is a group of users who need access to the same data and have the same access privileges. The administrator creates the catalog and user classes. Other people in an organization may also create and maintain user classes for the employees in their own department or area. You can add user classes to a catalog if you created the catalog or you are working with a personal copy of a distributed catalog and your administrator gave you the privilege to add and modify user classes.

For Example
You create a personal copy of a distributed catalog. You did not create the master distributed catalog, so you can only add users as subclasses of your user class. Subclasses inherit the set of privileges and restrictions from the immediate parent class. This set of privileges is known as the user profile. Suppose you are in the user class called Marketing that enables you to see marketing information for all countries. You decide to add the user classes Europe, North America, and Asia-Pacific. You set up the user classes so users in each class can only see regional information. Each user class is added to the User Class tab as a subclass.

Administration Guide 433

Chapter 48: About Catalogs Europe inherits the privileges and restrictions from Marketing, so if Marketing is denied access to a particular catalog folder, then Europe is also denied access to the folder. You can modify the user profile for any user class you create.

Steps
1. Close all open reports. 2. From the Catalog menu, click User Profiles. 3. In the User Classes tab (User Profiles dialog box), select the user class to which you want to add a subclass, and then click Add. For example, if you want to add a user class under Marketing, select Marketing. 4. In the Class Name box, type a meaningful name for the user class. 5. If you want the users of this user class to enter a password in order to access the catalog, type a password in the User Class Password box. 6. Click OK. For information about editing the user profile for a user class, see the Impromptu Administrator version online Help or contact your administrator.

Notes
You can add user classes with the Impromptu User version or the Impromptu Administrator version. If you did not create the catalog, you can only add subclasses.

Tips
To edit the name or password of a user class, select the user class, and then click Edit. To remove a user class, select it and click Remove. You cannot remove or rename the Creator user class but you can change the password for it. To better view a long list of users, resize the User Profiles dialog box.

Add User Profiles to Distributed Catalogs


User profiles inherited from the master catalog are read-only in the distributed copy. When you update the master catalog, user profiles inherited from the master catalog are destroyed in the copy and replaced by those in the master catalog. User profiles that users add to the distributed catalog are retained provided that the parent user profile inherited from the master catalog still exists. The settings in these local user profiles are retained, provided that they don't conflict with their parent user profile settings. Conflicts arise when the constraints, table/column access, or client-server balancing options applied to the parent profile are more restrictive than the child. In these cases, the child user profile is changed to match the more restrictive configuration of the parent. Conflicts also arise when a user adds a new user profile to the distributed copy that has the same name as a new user profile in the master catalog. When you update the master catalog, the user profile in the users copy is overwritten by the user profile from the master catalog.

434 IBM(R) Cognos(R) Impromptu(R)

Chapter 49: Optimize Performance in Impromptu


This chapter discusses some of the ways you can improve the performance of your Impromptu reports, whether you are updating a report or building a new one.

Create Efficient Reports


To maximize the performance of Impromptu, you try to create the most efficient reports possible by optimizing queries and reports the balance between client and server processing summaries filters sorting If/Then/Else and Lookup statements OLE (Object Linking and Embedding) report formatting commands the use of alternative data sources the use of outer joins data retrieval limits connection time to the data server the use of accessible reports for disabled users the report size When you query the database, Impromptu generates one or more SQL statements and sends them to the database. Where required, Impromptu complements the capabilities of the database with its own local SQL based query engine. To optimize performance, you must run the query as few times as possible make the database do most of the query processing

The Difference Between Queries and Reports


A query is a question you define and send to the data source to retrieve the data. A report is an organized and formatted view of the data the query retrieved. The report does not have to include all of the data items you specify in the query. You indicate which query data items you want to appear in the report by selecting the items and clicking the Mark for Insertion button (Query dialog box, Report menu). For example, you create a query that includes the data items Product, Product Price, Product Margin, and Total Sales Amount. You create a report that only shows Product, Product Price, and Product Margin by hiding the Total Sales Amount column. You then create a report for your manager that shows only Product and Total Sales Amount by hiding the Product Price and Product Margin columns. You saved time because you only had to run the query once to retrieve all the data items. When you first add data items to the query, this icon indicates they will appear in the report. After you run the query, data items in the query have this icon whether or not they are included in the report.

Administration Guide 435

Chapter 49: Optimize Performance in Impromptu

Click to specify whether you want the selected data item to appear in the report.

Select all the data items and group, sort, and filter in the Query dialog box before you run the query. This reduces the amount of data retrieved from the database, the amount of processing that takes place locally, and the number of times Impromptu queries the database.

Notes
If you are using the Blank template, none of the data items in the query appear in the report until you add a frame to the report and mark the data items for insertion into the frame. If you are using any template other than the Blank template, all of the data items in the query appear in the report by default. The data items are added to the primary frame, which by default is a form frame, unless you select a frame.

Client/Server Balancing
The overall goal of performance is to provide the best response time with the least impact on available resources. To achieve this goal, process as much as possible on the database server, and avoid local processing on your computer. Consider all of the performance issues and guidelines described in this chapter when you query the database. Impromptu has three client/serving balancing options: This option Database only Limited Local Processing Flexible Processing Does this Runs queries completely on the database. Runs queries with some processing on your computer. Processes on the database only, or on the database and on your computer depending on how Impromptu decides to optimize the processing.

Note
The Query Processing options (Client/Server tab, Query dialog box) are only available if you are connecting to a database server, such as Oracle or Sybase. If you are not connecting to a database server, the Client/Server tab shows the message "Local database. Flexible Processing assumed."

436 IBM(R) Cognos(R) Impromptu(R)

Chapter 49: Optimize Performance in Impromptu

Which Client/Server Options are Most Efficient?


The Database Only or Limited Local Processing options are the most efficient options because they force processing as much as possible on to the database and prohibit these activities: sorting on your computer using extended summaries For information about extended summaries, see the Administration Guide.

Who Sets the Client/Server Balancing Option?


Your administrator sets the client/server balancing option for your user class. The client/server balancing option can also be defined in templates you use. For the standard templates supplied with Impromptu, the client/server balancing option is set to Limited Local Processing (Client/Server tab, Query dialog box). If you have appropriate access, you can change the client/server balancing option in the Client/Server tab (Query dialog box). If the Client/Server tab (Query dialog box) is unavailable, from the Tools menu, click Options, and select the Show Advanced Tabs in the Query Dialog Box check box (General tab).

Note
If your administrator gave you the privilege to add or modify user classes, you can change the client/server balancing option for subordinate user classes. You can make these changes using the Client/Server tab (User Profiles dialog box). When you use this tab, you can only change the client/server balancing option for your own user class if you created the catalog (user class: Creator). For information about user classes, see (p. 433).

Summaries
Retrieve Summary Data Items
If you create a summary report, retrieve less data by only including summary data items (not details) in the query. For example, you need a report that shows the total sales amount for each country. Rather than retrieving all of the details, then summarizing, you can include only the grouped data item Country and the summary data item Total Sales Amount in the query. Only the summarized values are retrieved from the database.

Put Summaries in Footers


To reduce the amount of processing on your computer, put summaries in footers. Avoid putting summaries in headers. Summaries in headers are called extended summaries and they are processed on your computer.

Notes
Running summaries, such as Running-Total, and moving summaries, such as Moving-Total, are special cases. You can put them in a separate column without affecting performance. Anytime a report has footers that contain summaries, one of the following occurs: processing takes place on your computer Impromptu sends multiple queries to the database, since the database may not be able to handle the query in a single pass. If you set the Flexible processing option, Impromptu makes two passes and combines the results. If you set the Limited Local processing option, Impromptu retrieves the minimum required data from the database and summarizes on your computer.

Administration Guide 437

Chapter 49: Optimize Performance in Impromptu Depending on how the governors are set by your administrator, you may be able to change the processing options.

Sorting on Database Summaries


Sort on summaries that can be processed by the database, such as total, average, count, maximum, and minimum. The following summaries are available in Impromptu only, which means they are processed on your computer: moving-average moving-total percentage of the total percentile quantile rank running-total running-average running-count running-difference running-maximum running-minimum tertile

Associating Summaries with Data Items


Associate a summary with a specific data item rather than using Automatic (location-dependent) association. To do this, edit the summarys definition and add the FOR clause. For information about changing a summarys association, see (p. 341).

Choosing an Optimal Summary Strategy


When you need to add summaries or outer joins to a report, choose a processing strategy that will optimize client-server (query) performance.For example, you could create a report which merged ordered (grouped) details with varying and opposing summary levels. As database SQL does not allow this in a single query, Impromptu provides extended processing in the form of multiple (merged) queries and local processing to derive the required result set.

Option 1 - Running Summaries


One option is to calculate running totals locally as the records are retrieved from the database. For example, as the database records are retrieved to the client, a new column is created where the running total is appended. In the following example, the user created a report showing Product Type, Product Line, Product, and Product Cost. The user then grouped on Product Type and Product Line, added a footer for Product Line, and placed Total (Product Cost) into the footer, setting the association to Product Line. Product Cost 3 4 13

Product Type Environmental Line

Product Line Alert Devices

Product Pocket U.V. Alerter Microwave Detective Pocket Radon Alerter

438 IBM(R) Cognos(R) Impromptu(R)

Chapter 49: Optimize Performance in Impromptu Product Cost 3 4 2 2 4 10 2 3

Product Type

Product Line Bio-Friendly Soaps

Product RiverKind Shampoo RiverKind Soap RiverKind Detergent

Recycled Products

EnviroSak Enviro-Kit Enviro-T

Sunblock

Sun Shelter-8 Sun Shelter-15

The query sent to the database is select Product Type, Product Line, Product, Product Cost from ...where ... order by Product Type, Product Line. The Impromptu report appears as a grouped report. However, the grouping is actually SQL ordering combined with the suppressed display of repeating values. The result set from the database would be: Product Cost 3 4 13 3 4 2

Product Type Environmental Line Environmental Line Environmental Line Environmental Line Environmental Line Environmental Line

Product Line Alert Devices Alert Devices Alert Devices Bio-Friendly Soaps Bio-Friendly Soaps Bio-Friendly Soaps

Product Pocket U.V. Alerter Microwave Detective Pocket Radon Alerter RiverKind Shampoo RiverKind Soap RiverKind Detergent

In addition to the above database result set, Impromptu creates a running total column (see following table) which is appended to the database result set before being passed from the data access engine to the report engine: Total (Product Cost) No. 1 3 7 20 3 7 9

Product Type Environmental Line Environmental Line Environmental Line Environmental Line Environmental Line Environmental Line

Product Line Alert Devices Alert Devices Alert Devices Bio-Friendly Soaps Bio-Friendly Soaps Bio-Friendly Soaps

Product Pocket U.V. Alerter Microwave Detective Pocket Radon Alerter RiverKind Shampoo RiverKind Soap RiverKind Detergent

Product Cost 3 4 13 3 4 2

As you can see, the running total column begins re-totalling for each Product Line. Thus, after reading the last record in a group, the Impromptu report engine displays the total.

Administration Guide 439

Chapter 49: Optimize Performance in Impromptu The generated Cognos SQL creates the database result set using it as a derived table upon which it creates the final result set to pass to the report engine:
selectc10 as c1, c9 as c2, c12 as c3, c11 as c4, RSUM(c11 for c10,c9) as c5 from (selectT1."PROD_LINE" as c9, T1."PROD_TYPE" as c10, T1."PROD_COST" as c11, T1."PRODUCT" as c12 from "PRODUCT" T1 order by c10 asc,c9 asc ) D1

The italicized portion of the query would be passed to the database after conversion to database native SQL (ODBC in this sample):
selectT1.PROD_LINE, T1.PROD_TYPE, T1.PROD_COST, T1.PRODUCT from PRODUCT T1 order by 2 asc, 1 asc

The beginning portion of the Cognos SQL is the local processing required to create the additional total column in the derived table. The RSUM is the syntax used to create the running summary.

Option 2 - Extended Summaries


A second option is to append the overall group total to the result set using extended summaries. In this case, similar to running summaries, additional columns are appended to the result set. However, these values are calculated for the entire group before being appended to the result set and therefore require more local processing. Take the same report we looked at a moment ago, and place the total in the header. The total must appear in the first record of each group to ensure the correct value is displayed. The SQL sent to the database is the same as when using running summaries. However, when the additional column is added, an extended summary is used instead, resulting in: Total (Product Cost) No. 1 20 20 20 9 9 9

Product Type Environmental Line Environmental Line Environmental Line Environmental Line Environmental Line Environmental Line

Product Line Alert Devices Alert Devices Alert Devices Bio-Friendly Soaps Bio-Friendly Soaps Bio-Friendly Soaps

Product Pocket U.V. Alerter Microwave Detective Pocket Radon Alerter RiverKind Shampoo RiverKind Soap RiverKind Detergent

Product Cost 3 4 13 3 4 2

Notice that now the total must be in the first record of each group so it can be displayed before the details for that group. Note that the same total appears for each record in the group. The generated Cognos SQL creates the database result set using it as a derived table upon which it creates the final result set to pass to the report engine:
selectc10 as c1, c9 as c2, c12 ac c3, c11 as c4, XSUM(c11 for c10,c9) as c5

440 IBM(R) Cognos(R) Impromptu(R)

Chapter 49: Optimize Performance in Impromptu


from (selectT1."PROD_LINE" as c9, T1."PROD_TYPE" as c10 T1."PROD_COST" as c11, T1."PRODUCT" as c12 from "PRODUCT" T1 order by C10 asc, C9 asc ) D1

Again, the italicized SQL is sent to the database after translation to native syntax:
selectT1.PROD_LINE, T1.PROD_TYPE, T1.PROD_COST, T1,PRODUCT from PRODUCT T1 order by 2 asc, 1 asc

The beginning portion of the Cognos SQL is the local processing required to create the additional total column in the derived table. The XSUM is the syntax used to create the extended summary.

Option 3 - Multiple Queries


A third option is to execute two queries back to the database; one an ordered detail query in the form select, a, b, c, ... from ... where ... order by a, b; and the second a grouped summary query in the form select a, b, sum (C) from ... where ... group by a, b. As both queries are sorted in the same order, Impromptu merges the results locally without re-sorting the two result sets on the PC. This requires very little local processing. Multiple queries are used only when the report displays the total of a column either before the detail records (i.e., put the total in the group header instead of the group footer), or if the total is displayed in the detail line as a separate column beside the detail column. In other words, this mechanism is not used when the summaries are displayed in a footer after the details. Recall that the data access and manipulation must be completed before the report is displayed. Thus, if the report displays the total with or before the first detail record, the total must be in the first record of the result set.
selectc10 as c1, c9 as c2, c12 as c3, c11 as c4, c8 as c5 from (select T1."PROD-LINE" as c6, T1."PROD_TYPE" as c7, SUM(T1."PROD_COST") as c8 from "PRODUCT" T1 group by T1."PROD)TYPE",T1."PROD_LINE" ) D2, (select T1."PROD_LINE" as c9, T1."PROD_TYPE" as c10, T1."PROD_COST" as c11, T1."PRODUCT" as c12 from "PRODUCT" T1 ) D1 where ((c10 = c7) and (c9 = c6)) order by c1 asc, c2 asc

The italicized portion is the two database queries that will be translated and passed to the database.
select T1.PROD_LINE, T1.PROD_TYPE, T1.PROD_COST, T1.PRODUCT from PRODUCT T1 order by 2 asc, 1 asc select T1.PROD_LINE, T1.PROD_TYPE, sum(T1.PROD_COST) from PRODUCT T1 group by T1.PROD_TYPE, T1.PROD_LINE order by 2 asc, 1 asc

The "where" syntax is used to merge (join without sort) the two database result sets locally.

Administration Guide 441

Chapter 49: Optimize Performance in Impromptu

Query Processing Model: Client/Database-Server Balancing


Impromptu uses the Client/Database-Server Balancing options to tune the interaction between the database and the three summary options.

Extended Summaries vs. Multiple Queries


Both extended summaries and multiple query mechanisms are used when the report requires totals to be displayed before the details (in a header) or beside the details (as a column). Impromptus decision as to which mechanism is used coincides with your choice of client/database-server balancing.

Running Summaries
Running summaries are always used when the summary is displayed after the details. This is how the summary mechanisms interface with the query processing (Client/Database-Server Balancing) options. Database Only. Since the Database Only processing option does not allow mixing details with summaries, this option is not applicable when considering summaries. This option does not allow local processing. Only queries that execute database native SQL are allowed. Limited Local Processing. This limits the amount of local processing by disallowing local sorting, and uses multiple queries instead of extended summaries to calculate summaries. In other words, depend on the database to sort and summarize, and use the PC to merge results into a single result set for less costly running totals. Flexible Processing. This uses extended summaries instead of multiple queries and allows local sorting. This table will help you determine how the summary mechanism corresponds with the Client/Database-Server Balancing options. Limited Local? Running Summaries: RSUM Extended Summaries: XSUM Multiple Database SQL Queries: Sum in second select YES NO YES Flexible Processing? YES YES NO

Filters
Changes to the Filter
To optimize performance, minimize the number of changes you make to the filter. If you use a database as the data source, each time you modify the filter, the query runs against the entire database.

Database Summaries
Filter on summarized data items that are processed in the database, such as total, average, count, maximum, and minimum. When you filter on summaries that are processed on your computer, the summaries are usually processed locally. However, adding a filter may change where the summary is processed. Selecting the client/server option (Client/Server tab, Query dialog box) also impacts the processing location of the summary filter. For example, you define a summary filter that is processed on your computer when the Flexible Processing option (Client/Server tab, Query dialog box) is set. You can split the same summary filter into two queries and the queries process on the database when the Limited Local Processing option (Client/Server tab) is set.

442 IBM(R) Cognos(R) Impromptu(R)

Chapter 49: Optimize Performance in Impromptu

Impromptu Functions
Avoid filtering on calculated data items that use Impromptu functions.

Non-Indexed Columns
Avoid sorting on non-indexed columns because it requires processing on your computer. Your administrator can set an option for your user class in the Governor tab that prohibits sorting on non-indexed columns. Avoid filtering on non-indexed columns as processing is longer than when you filter on indexed columns. To know whether columns are non-indexed, refer to your database schema, or see your administrator.

Impromptu Functions
Avoid sorting on calculated data items that use Impromptu functions because it requires processing on your computer.

If/Then/Else and Lookup Statements


Avoid using If/Then/Else or Lookup statements because processing takes place on your computer.

Notes
If you use a database that supports CASE structure, using If/Then/Else or Lookup statements is not a performance issue because processing takes place on the database. If you use a database that supports CASE structure, but you include Impromptu functions in the filter expression, the filter is processed on your computer.

To find out if your database server supports CASE expressions, see your database documentation.

Functions
A calculated data item is processed on your computer if it uses Impromptu functions. Avoid filtering and sorting on any calculated data item that is processed locally because the sort or filter takes place on your computer along with the processing of the calculated data item. You can see the type of function and where it is processed by looking at its icon in the Available Components box (Calculation dialog box): Impromptu functions are processed locally on your computer. Database-only functions are processed on the database. Combination functions are processed on the database whenever possible.

Notes
If your catalog uses a local database, you only see Impromptu functions in the Available Components box. Only the functions that your database supports appear in the Available Components box.

If Impromptu processes functions locally that are not supported by the database, then the database results and the results processed on your computer must be merged before Impromptu can produce the report. This impacts performance.

Administration Guide 443

Chapter 49: Optimize Performance in Impromptu

Report Formatting Commands


Scan Data for Best Fit
You may notice a performance decrease when you use the Scan Data for Best Fit option (Size command, Format menu). Each time the query runs, Impromptu must scan the number of rows you specify to set the width of the frame to the widest data value within the specified number of rows. Instead, specify a width size.

Fit to Page
If you use this feature and the data changes, the dynamic nature of this option may affect performance. For information on using the Fit to Page feature, see the Impromptu online Help. In the Index tab, type fit to page

Use Alternative Data Sources


Instead of querying the entire database, you can use a thumbnail, snapshot, or HotFile as the data source to test your query. Once you are satisfied with the results, you can return the data source back to the database.

Test Your Queries Using Thumbnails


A thumbnail is the most efficient method for testing your query. A thumbnail is a temporary cache or file of the retrieved data on your computer. You can create a thumbnail when you open or create a report. A thumbnail can include all the report data or you can limit it to a certain number of rows. For example, you specify that the thumbnail should retrieve the first 500 rows from the database. Once the thumbnail contains the set number of rows, it stops querying the database. If you perform local calculations, sort, group, or apply a more restrictive filter, Impromptu performs these actions locally without accessing the database.

Notes
The default number of rows that the thumbnail retrieves is 30. If you add a new database column, add a calculated column that uses database functions, or if you make the filter less restrictive, Impromptu moves the processing back to the database. Impromptu does not retrieve more rows than your administrator has specified in the governor limit for your profile. For example, if you set a thumbnail to retrieve 500 rows, but your administrator has set a governor limit of 30 rows, Impromptu presents a message indicating that you exceeded the governor restrictions for your profile, and only retrieves 30 rows. When you close a report that uses a thumbnail, the data is discarded. For information about creating thumbnails, see (p. 421).

Improve Performance Using Snapshots


You can improve performance by following these guidelines for snapshots: Do not create huge snapshots. While the number of rows varies, depending on the database and the network you use, 5,000 to 8,000 rows is generally the maximum practical limit for a snapshot, especially if you are sorting. Also, if the snapshot contains a lot of data, it will require more local disk space.

444 IBM(R) Cognos(R) Impromptu(R)

Chapter 49: Optimize Performance in Impromptu Check your other data access settings to ensure that they reflect the amount of data that you want, before you create a snapshot. For example, if you select the Limit Data To check box and set a limit of 20 rows in the Access tab (Query dialog box), your snapshot will only access 20 rows. Before you create a snapshot, use the Filter tab (Query dialog box) to filter out any data you do not need. Perform all the sorting and grouping you require for a report before you create a snapshot. Because of the indexing method used in snapshots, operations such as sorting are not as efficient when a snapshot is the data source as they are when the database is the data source. You may want to perform these operations while you are still attached to the database rather than with the snapshot. Ensure you have all the data you need to perform any action you are planning. You will not be able to access any data that is not in the snapshot. A report that uses a snapshot as its data source no longer has access to the database, so your data is not updated until you re-create the snapshot or redirect your query to the database.

Note: In snapshots, the numeric data is encoded, not encrypted, and character data can be read in some text editors. If security is an issue, you should take extra precautions when using snapshots. You may choose to use HotFiles instead, which have an encrypt and decrypt function.

Improve Performance Using HotFiles


A HotFile is a separate local data table you can use in a report. You can use a HotFile as the data source by attaching a HotFile to a report. Since a HotFile resides on your computer, you can reduce network traffic and improve the reports execution time. Use a HotFile only if you do not have direct access to the data; that is, when the data is not in the same database that your catalog accesses. You can improve query performance and report execution using HotFiles. For example, if you use a large static dataset for many of the reports you create, you can create a HotFile with this data, and use the HotFile data rather than querying the data on the database. improve report execution using precalculated HotFile tables. Precalculated HotFile tables contain complex calculations that obtain certain calculated values. For example, if you use complicated calculations for your reports that only change on a monthly basis, you can create precalculated HotFile tables at the beginning of the month, and use the HotFile data during the month rather than recalculating the data over and over again. For information about creating HotFiles, see (p. 421).

How Outer Joins Affect Your Work


Joins link related data contained in separate tables. Your administrator can provide information about the various types of joins. The type of join that is most likely to affect your work is the outer join. You may notice unexpected results. A report that retrieves data from a particular table may, as a result of an outer join, also retrieve data from some other table. This means you could run a report and get more or different data than what you expected. that expressions and filters are affected. An outer join can cause a Null value to be returned when data is not retrieved from a table. Null is not the same as zero. For example Null + 10 = Null zero + 10 = 10. changes in performance. More SQL statements may be generated. An outer join could cause more local processing at the client. that you must carefully select the columns for the desired result if your catalog includes outer joins between tables because the order in which you select columns for your query affects the SQL that Impromptu generates. Administration Guide 445

Chapter 49: Optimize Performance in Impromptu Joins are defined by your administrator. For more information about joins, see your administrator.

What is an Outer Join?


An outer join causes data to be retrieved from one table even if there are no matching rows in its related table. The results of a query will differ depending on whether or not there is an outer join relationship between two tables. For example, you have two tables called "Employees" and "Expenses". You run a query to get a list of employee expenses for the past month. Outer Join exists? No Yes Results of the above query A list of employees who had expenses this past month. A list of all employees, regardless of whether they had expenses this past month. The expenses for any employees who did not actually have expenses will appear as Null.

When Not to Use Outer Joins


Your administrator may choose not to use outer joins if the data model never has optional relationships between tables it doesnt matter if rows are discarded when no matches are found in another table

Override Outer Joins


If your administrator has made the option available, you can override all outer joins in a report.

Step
Select the Include the Missing Table Join Values (Outer Join) check box (Access tab, Query dialog box). All rows will be displayed even when there is no corresponding data in each table.

You may be able to accomplish the work of an outer join by using sub-reports, to link data between a parent query and a child query. drill-throughs, to link two reports together and make it easy to move back and forth. alias tables, to create an alias table (instead of setting up an outer join to the original table) and link to it when the request for that data is an exception.

Outer Joins Examples


Suppose your database contains two tables. Table 1 Sales Rep. Bjorn Flertjan Gus Grovlin Sales Rep. No. 1 2 Table 2 Sales Rep. Name Bjorn Flertjan Bill Smertal Total Sales $115,138.83 $28,707.31

446 IBM(R) Cognos(R) Impromptu(R)

Chapter 49: Optimize Performance in Impromptu

Left Outer Join


To get a report that shows all the sales representatives who have a Sales Rep. No., including those who didnt make any sales, your administrator could set up a left outer join and define Table 1 as the left outer table. The report shows all the sales representatives from Table 1. Sales Rep. Bjorn Flertjan Gus Grovlin Sales Rep. No. 1 2 Total Sales $115, 138.83 NULL

Right Outer Join


To get a report that shows the sales representatives who actually made sales, your administrator could set up a right outer join and define Table 2 as the right outer table. The report shows all the sales representatives from Table 2. Sales Rep. Bjorn Flertjan Bill Smertal Sales Rep. No. 1 NULL Total Sales $115,138.83 $28,707.31

Full Outer Join


To get a report that shows all sales representatives, your administrator could set up a full outer join between the Table 1 and Table 2. The report shows all sales representatives from both tables. Sales Rep. Bjorn Flertjan Gus Grovlin Bill Smertal Sales Rep. No. 1 2 NULL Total Sales $115,138.83 NULL $28,707.31

Limit the Data


When you use the Limit Data To check box (Access tab, Query dialog box), Impromptu retrieves only the specified number of rows.

Minimize Connection Time


Another option available to the administrator is the "Minimize Connection Time to the Database" check box (Client/Server tab, User Profiles dialog box). When this check box is selected, Impromptu creates a temporary cache for query results and disconnects from the database as soon as the report is run.

Create Separate Accessible Reports


Impromptu can generate reports that contain accessible information for disabled users. However, this can degrade performance. To reduce performance issues, create two instances of the report, one with and one without accessible information. Provide accessible reports only to those users who require them.

Administration Guide 447

Chapter 49: Optimize Performance in Impromptu

Manage the Size of Impromptu Reports


Impromptu reports can become large in size over time. An Impromptu.ini file setting lets you control the size of the report files by occasionally defragmenting or removing unused information when the files are closed.

Steps
1. Ensure that Impromptu Administrator is closed. 2. Using a text editor, browse to the Impromptu.ini file. The file is located in the installation_location/bin directory. 3. Open the file and in the [Startup Options] section, find the following setting:
Report Defrag Threshold=<n>

4.

5. 6. 7. 8. 9.

If this setting does not exist, add it. To achieve full compression, set the Report Defrag Threshold value to 100. Setting the Report Defrag Threshold value to 0 (zero), turns off defragmentation. If you set Report Defrag Threshold to a value other than 0 (zero), the value is read as a percentage of the amount of accessible data in the report before the report is defragmented. If the percentage of accessible data falls below the threshold value you set, the report will be defragmented and the unused data in the report will be removed. For a complete description of the Report Defrag Threshold setting, see the Impromptu User Help. Save and close the Impromptu.ini file. Start Impromptu Administrator and open the report. If prompted to upgrade the report, select Yes. From the File menu, click Save. From the File menu, click Close.

Important: If you do not close the report, it does not get compressed.

448 IBM(R) Cognos(R) Impromptu(R)

Chapter 50: Customize Impromptu


Customize Impromptu to suit your everyday reporting needs, and save valuable time for yourself and other users in your organization. You can customize menus, toolbars, and toolbar buttons. You can also set up launch buttons and launch menu commands. You can distribute your customized menus and toolbars to other users in your organization.

Customize Menus
You can create your own menus and add the commands you need. When you change default menus or create new ones, the changes are stored in an .mnu file, which is updated each time you make a change. Note: Customized menus appear only when a report is open.

Steps
1. From the Tools menu, click Customize. 2. Click the Menus tab. A list of menu commands appears in the Available Commands box. The Menu Layout box shows the current menu structure. 3. You can do any of the following. Goal Add menus, submenus, menu separators, or menu commands Show only those menu commands found on a specific menu Rearrange menu commands Delete a menu or menu command Change the name of a menu command Action Drag what you want to add from the Available Commands box to the Menu Layout box. In the Category box, click the name of the menu. For example, click File to show only those commands found on the File menu. In the Menu Layout box, drag menu commands from one menu to another. In the Menu Layout box, click the menu or command and then click Remove. In the Menu Layout box, click the menu command. Under Item Properties, in the Name box, type a new name.

Change the shortcut key combination of a In the Menu Layout box, click the menu menu command command. Under Item Properties, in the Shortcut box, enter a new combination of keys. If a combination of keys is currently assigned to another menu command, a message will appear in the message pane that the shortcut is in use. Create a menu accelerator key In the Menu Layout box, click the menu command. Under Item Properties, in the Name box, type an ampersand (&) and the name of the menu command. For example, &New makes N the accelerator key.

Administration Guide 449

Chapter 50: Customize Impromptu 4. Click OK.

Tips
You can add a separator line between groups of related commands to organize a menu. To restore the default menus, click the Reset button.

Set Up a Launch Menu Command


You can add a launch command to any menu. You can configure each launch menu command to run a different program or macro.

Steps
1. From the Tools menu, click Customize. 2. Click the Menus tab. 3. Click New. The New Launch Item dialog box appears. 4. In the Name box, type a name for the launch menu command. 5. In the Description box, type a tooltip for the menu command. 6. In the Type box, click Macro or Application. 7. In the Command box, browse to the location of the macro or application. 8. In the Parameters box, enter any parameters you want to add to the macro or program. 9. If you want to minimize the current window when you run the program or macro, select the Minimize Application Before Launching check box. 10. Click OK. Tip: To edit a launch menu command, click it in the Menu Layout box, then click Modify.

Customize Toolbars and Buttons


You can show, hide, create, delete, and modify toolbars. Any changes you make are stored in an initialization file on your computer, for the current user.

Show or Hide Toolbars


You can show or hide toolbars so that you see only what you need.

Steps
1. From the Tools menu, click Customize. 2. Click the Toolbars tab. A list of toolbars appears in the Available Toolbars box. 3. Select the check box beside each toolbar that you want to appear. Tip: You can remove a toolbar from the Available Toolbars box by clicking the toolbar name, and then clicking Remove. 4. Click OK. The settings are saved for your computer.

Tips
To show tooltips for each toolbar, select Show Tooltips.

Create a Custom Toolbar


You can create a custom toolbar that contains only the tools you need.

450 IBM(R) Cognos(R) Impromptu(R)

Chapter 50: Customize Impromptu

Steps
1. 2. 3. 4. 5. 6. From the Tools menu, click Customize. Click the Toolbars tab. Click New. In the Toolbar Name box, type a name for the toolbar. In the Initial Location box, click a default location for the toolbar. Click OK. The name of the new toolbar appears in the Available Toolbars box. You can now add buttons to the new toolbar.

Tip: To reset the toolbars to the default settings and delete any custom toolbars, on the Menus tab, click Reset. You can also reset the toolbars by deleting the tbinfo.ini file or moving it to another folder.

Customize Toolbar Buttons


You can change the buttons on a default toolbar or add buttons to a custom toolbar. You can also remove buttons from any toolbar. Tip: To learn what a button does, select its name in the Available Buttons box, then look under Button Description. For example, you are in charge of imports for a governmental department. You regularly distribute reports to offices in Great Britain, which requires that you convert your reports so that they use British pounds. You want to customize your toolbar by creating and adding a Currency button.

Steps
1. From the Tools menu, click Customize. 2. Click the Toolbar Buttons tab. 3. Drag the buttons you want to add from the Available Buttons box to a toolbar. Tips To change the selection of buttons use the Category box. For example, click File to show only those buttons found on the File toolbar. To add a space between buttons, add a separator button (found under the Miscellaneous category). 4. Drag the buttons you want to remove off an existing toolbar. 5. Click OK. Tip: To return to the original settings, click Reset on the Toolbars tab.

Set Up a Launch Button


You can add up to 64 launch buttons to a custom toolbar. You can configure each button to run a different program or macro. For example, you are the manager of a government department. You keep the data source files for your reports in Microsoft Excel spreadsheets. While reviewing your reports, you want to look at your data source files. You customize your toolbar to run Excel directly from PowerPlay, Impromptu, or Transformer.

Steps
1. From the Tools menu, click Customize. 2. Click the Toolbar Buttons tab. 3. In the Category box, click Miscellaneous. The buttons in the Miscellaneous category appear in the Available Buttons box. 4. Click Toolbar Launch Button, and drag it to a toolbar. 5. Double-click the new launch button.

Administration Guide 451

Chapter 50: Customize Impromptu The New Launch Item dialog box appears. 6. In the Name box, type a name for the launch button. 7. In the Description box, type a brief description of what the button does. The tooltip appears when you pause the pointer over the button. 8. In the Type box, click Macro or Application. 9. In the Command box, browse to the location of the macro or program. 10. In the Parameters box, enter any parameters you want to add to the macro or program. 11. If you want to minimize the current window when you run the program or macro, select the Minimize Application Before Launching check box. 12. In the Image box, click the image you want to appear on the new launch button. 13. In the Path box, browse to the location of the button image. 14. Click OK. Tip: To change the settings of a launch button, ensure the Customize dialog box is closed, and Ctrl+click the launch button and then make changes in the Modify Launch Item dialog box.

Distribute Custom Menus and Toolbars


You can distribute custom menus and toolbars to other users. Toolbars are stored in the tbinfo.ini file, and menus are stored in the menuinfo.mnu file in the following location:
<installation_dir>\Documents and Settings\<user_id>\Application Data\Cognos\cern\<filename.exe>.

For example, if you are running Impromptu you would find tbinfo.ini and menuinfo.mnu in the following location:
<installation_dir>\Document Settings\<user_id>\Application Data\Cognos\cern\impadmin

Example
You are the director of a government department that oversees transportation policy. You worked closely with your systems analyst to build customized menus and toolbars that suit your departmental needs. You want to distribute these menus and toolbars to others in your department.

Steps
1. Place a copy of the files that contain the settings for the custom toolbars and menus in a location that users can access. 2. From the Tools menu, click Customize. 3. Click Load. 4. Browse to the location of the tbinfo.ini file or the menuinfo.mnu file to be imported. 5. Click OK. The custom menus or toolbars appear.

452 IBM(R) Cognos(R) Impromptu(R)

PART 4: Using Macros with Impromptu

Administration Guide 453

454 IBM(R) Cognos(R) Impromptu(R)

Chapter 51: Introduction to Impromptu OLE Automation


You can use Impromptu as a database reporting and query tool, and you can access data from any supported data source and control report distribution. OLE automation exposes the methods and properties of objects and collections that let you analyze data that drives your business. You can use OLE automation to create and distribute standard reports that identify and highlight exceptional data control access to database information and administer user group privileges and restrictions optimize the performance of the Impromptu application customize the user environment so that users can be efficient and conform to company standards verify and update an Impromptu catalog after a change to the connected database. You can automate repetitive tasks when the Impromptu application, catalog object or report document opens or closes by writing OLE automation macros. Then you can use Scheduler to run the macro. The Impromptu Application object is organized into a logical tree of objects which reflects how these contained objects depend on each other to operate. The application hierarchy indicates which objects you need to have in existence before you can create the object you want. The following diagram identifies the hierarchy for Impromptu OLE automation:

Administration Guide 455

Chapter 51: Introduction to Impromptu OLE Automation

Related Topics
"Collections" (p. 487) "Methods" (p. 507) "OLE Automation and Impromptu Registry Keys" (p. 457) "Objects" (p. 461) "Properties" (p. 607)

Rendition ID
Typically, automation scripts contain the path locations of objects, such as IBM Cognos products or sample data, reports, and cubes. Because these locations can change with each new major version of IBM Cognos Series 7 software, we recommend that you define a global variable for the IBM Cognos rendition ID. Throughout the IBM Cognos macro examples, <rendition_id> is used in place of the IBM Cognos product rendition, cern, where n represents the product rendition number in the installation path. Here are some examples taken from the documentation. "C:\Program Files\Cognos\<rendition_id>\Samples\" and varApp = objVizSrvAdmApp.SetRendition ("Cognos", "<rendition_id>") 456 IBM(R) Cognos(R) Impromptu(R)

Chapter 51: Introduction to Impromptu OLE Automation For information about using global variables, see "IBM CognosScript Statements and Functions" in Macros and the IBM CognosScript Language.

OLE Automation and Impromptu Registry Keys


Registry keys control the version of Impromptu that is activated by automation scripts. The following keys point to the registry entry that identifies the version of Impromptu to be used by the automation engine, if the version of Impromptu is not specified in a script:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CognosImpromptu.Application HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CognosImpromptu.Catalog HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CognosImpromptu.Report HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CognosImpromptu.Server HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CognosImpromptu.Template

Each of these general keys contains a property called CurVer. This property acts as a pointer to the registry key for the desired version of Impromptu. For example, CognosImpromptu.Application\CurVer is set to CognosImpromptu.Application.cern, where n is the rendition number. When the automation starts, it uses this value to look up the properties of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ CognosImpromptu.Application.cern to obtain the location of the Impromptu executables.

Note
If you uninstall a previous version of Impromptu after installing a newer version, the Impromptu OLE keys are removed from the registry and OLE calls can fail. To reinstate the Impromptu registry keys: reapply the configuration settings in Configuration Manager to re-establish the Impromptu registry keys. This recreates the general keys and sets them to use the version of Impromptu installed to the same rendition as the Configuration Manager you are using. modify the OLE code to reference the version-specific Impromptu key. For example,
Set impapp = CreateObject("CognosImpromptu.Application.cern")

Related Topics
"Introduction to Impromptu OLE Automation" (p. 455) "Name Property" (p. 675).

Administration Guide 457

Chapter 51: Introduction to Impromptu OLE Automation

458 IBM(R) Cognos(R) Impromptu(R)

Chapter 52: Run a Macro


There are several different ways to run a macro: Run a Macro in Impromptu Using a Command, Menu Command, or Toolbar Button Run a Macro in Impromptu at Startup Run a Macro in Impromptu Using a Command Line Option Run a Macro in Impromptu Before Opening a Report

Run a Macro in Impromptu Using a Command, Menu Command, or Toolbar Button


Description
In Impromptu, you can run your macro directly from the Macro command (Tools menu), or you can program a launch button or launch menu command for easy access to a macro. To distinguish between multiple launch buttons, use different icons.

Steps to Run a Macro Using a Command


1. From the Tools menu, click Macro. 2. Select the macro file to run. 3. Click Run.

Step To Run a Macro Using a Menu Command


Set up a launch menu command to run a macro using the Customize selection of the Tools menu. (For more information, see Set Up a Launch Menu Command in the Mastering Impromptu Reports PDF book.)

Step To Run a Macro Using a Toolbar Button


Set up a launch button to run a macro using the Customize selection of the Tools menu. (For more information, see Set Up a Launch Button in the Mastering Impromptu Reports PDF book.)

Related Topics
"Run a Macro in Impromptu at Startup" (p. 459) "Run a Macro in Impromptu Before Opening a Report" (p. 460) "Run a Macro in Impromptu Using a Command Line Option" (p. 460)

Run a Macro in Impromptu at Startup


Description
You can set Impromptu to run a macro every time it starts to customize the application. To skip the macro that normally executes as Impromptu starts, hold down the Ctrl key when Impromptu is starting.

Example
You can create a macro that shows a list of the five most frequently used reports every time you start Impromptu.

Administration Guide 459

Chapter 52: Run a Macro

Steps
1. 2. 3. 4. From the Tools menu, click Options. Click the Start-up tab. Select the Run option button. Browse for the file and click OK to return to the Options dialog box or type the file name in the Run box, and click OK.

Related Topics
"Run a Macro in Impromptu Before Opening a Report" (p. 460) "Run a Macro in Impromptu Using a Command Line Option" (p. 460) "Run a Macro in Impromptu Using a Command, Menu Command, or Toolbar Button" (p. 459)

Run a Macro in Impromptu Using a Command Line Option


Description
You can run a macro in Impromptu from the command line using the -m option.

Steps
1. In the task bar, click Start, and click Run. 2. Browse for the file and click OK to return to the Run dialog box or type the fully qualified file name in the Open or Run box. 3. Type - m with the fully qualified file name of the macro, and click OK.

Related Topics
"Run a Macro in Impromptu at Startup" (p. 459) "Run a Macro in Impromptu Before Opening a Report" (p. 460) "Run a Macro in Impromptu Using a Command, Menu Command, or Toolbar Button" (p. 459)

Run a Macro in Impromptu Before Opening a Report


Description
You can set Impromptu to run a macro before you open a report. Impromptu runs the macro after the data is retrieved. To run the macro before data is retrieved, disable auto-retrieve using the Retrieve command (Report menu).

Steps
1. From the Report menu, click General. 2. Click the Macro tab. 3. Browse for the file and click OK to return to the Properties dialog box, or type the file name in the Perform When Opening the Report box, and click OK.

Related Topics
"Run a Macro in Impromptu at Startup" (p. 459) "Run a Macro in Impromptu Using a Command Line Option" (p. 460) "Run a Macro in Impromptu Using a Command, Menu Command, or Toolbar Button" (p. 459)

460 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Name Application Object Catalog Object CatalogLevel Object Column Object Database Object DatabaseConnection Object DatabaseDefinition Object Expression Object FolderItem Object PublishExcel Object PublishHTML Object

Description An Impromptu application creates, opens and operates on catalogs and reports. An object representing the Impromptu catalog. An object that represents the catalog qualification level of a Database object. An object that represents a column in a Table object. An object that represents the Impromptu view of the database. An object that describes the user classs connection information for a database. An object representing the defined databases for Impromptu. An object that represents an expression either in a catalog or a report. An Impromptu folder item. An object that controls the creation of Microsoft Excel files from Impromptu reports. An object that controls the creation of HyperText Markup Language (HTML) files from Impromptu reports. Controls the creation of PDF files from Impromptu reports. Represents a report query item, for example, a report column or expression. Represents an Impromptu report within an OLE automation script. An object that represents the schema qualification level of a Database object. An object that represents a selected frame on a ReportDocument. A Database stored procedure. An object that represents the Impromptu view of a database table.

PublishPDF Object QueryItem Object ReportDocument Object SchemaLevel Object SelectedFrame Object StoredProcedure Object Table Object

Administration Guide 461

Chapter 53: Objects

Name TableLink Object UserClass Object

Description A single-step link between two Table objects. An object that represents a user profile.

Related Topics
"Collections" (p. 487) "Methods" (p. 507) "Properties" (p. 607)

Application Object
Description
An Impromptu application creates, opens and operates on catalogs and reports.

Discussion
Use an Application object to start Impromptu from within an OLE automation script. You can declare an object variable and then use the CreateObject method to create an Impromptu application object. Method Name Activate Method AddTable Method ChangeUserClass Method CloseCatalog Method ConnectDatabase Method CreateCatalog Method CreateEmptyCatalog Method CreateStoredProcedure Method DisconnectDatabase Method FileSetPrinter Method GenerateReport Method GetAppVersionInfo Method GetErrorNumber Method GetNextQueryError Method Interactive Method OpenCatalog Method Description Activates the window associated with the specified report. Adds a table from the database to the catalog for the current application. Changes the current user class. Closes the currently open catalog. Attaches to the database for the specified catalog. Creates a catalog with the default included tables and the default user profile. Creates a new, empty catalog. Creates a StoredProcedure object. Disconnects the catalog from the database. Sets the default printer. Generates a report for a specified table. Returns version information for Impromptu applications. Returns an Impromptu error number. Returns a string containing a query error number and the associated query error description. Sets or returns whether the application accepts interactive commands from a user. Selects and loads the specified catalog.

462 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects Method Name OpenDrillDownReport Method OpenReport Method OpenReportNoExecute Method Quit Method UpdateCatalog Method Visible Method Description Opens an existing Impromptu report for access by another application or report. Opens the specified report. Opens an Impromptu report without executing the query. Exits Impromptu. Updates the active catalog with information from another catalog. Sets or returns whether the application window is visible.

Property Name ActiveCatalog Property ActiveDocument Property Application Property CatalogName Property CatalogOpened Property ConnectionString Property DatabaseConnected Property DatabaseDefinitions Property ErrorDocument Property FullName Property Name Property UseQueryWarnings Property WindowState Property

Description Returns the active catalog object. Returns the active document. Returns the application object. Returns the name of the catalog for the specified application. Returns a Boolean value based on whether the application has a catalog open. Returns the fully-qualified location of the database. Returns whether the database is connected to the catalog. An ownership collection of defined databases. Returns which document has returned errors when running multiple documents. Returns the full name of the application, including the path. Returns the name of the application. Sets or returns whether Impromptu ignores governor restriction warnings when executing a query. Sets or returns the window size of the application: minimized, maximized, or last setting.

Example
This example starts an instance of the Impromptu application, opens a report and prints four pages of the report.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.OpenReport("c:\sales\fy93tot.imr") objImpRep.RetrieveAll

Administration Guide 463

Chapter 53: Objects


objImpRep.Print 1,4,1 objImpRep.CloseReport objImpApp.Quit Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Catalog Object" (p. 464) "ReportDocument Object" (p. 476)

Catalog Object
Description
An object representing the Impromptu catalog.

Discussion
The Catalog object is also known as the active catalog. Only one catalog can be open at a time. If you attempt to open more than one catalog, the operation will fail. Method Name Close Method DistributedUpdate Method Save Method (Catalogs) Description Closes the active catalog and saves any changes. Performs Catalog update against the master Catalog. Saves the current Catalog to disk under the filename found in its Filename property.

Property Name ActiveUserClass Property Application Property CreatorUserClass Property Databases Property Description Property Filename Property Folders Property IsDistributed Property IsLocked Property MasterCatalogFilename Property NameSpace Property TableLinks Property UniqueID Property

Description Returns the active user class. Returns the Application object. Returns the active user class object if you are the creator of the catalog. Returns a collection of Database objects. Sets or returns a text description of the catalog. Returns the name of the file for the catalog. Returns the top-level Items collection in a catalog. Sets or returns whether the object is distributed. Sets or returns whether a catalog is locked. Returns the filename for the master catalog. Sets or returns a namespace for the catalog. Returns a collection of TableLink objects. Sets or returns the unique metadata identification for the Catalog object.

464 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Example
This example changes the active catalog to non-distributed and shows its file name and description. Before you change a distributed catalog to non-distributed, you must remove all user classes except the Creator user class.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim strFname As String Dim strDesc As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog objImpCat.IsDistributed = False strFname = objImpCat.Filename MsgBox "The filename of the Catalog is " & strFname strDesc = objImpCat.Description MsgBox "The Catalog Description is " & strDesc Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"ActiveCatalog Property" (p. 611) "Add Method (Databases)" (p. 515) "Application Object" (p. 462) "CatalogLevel Object" (p. 465) "CatalogName Property" (p. 620) "CatalogOpened Property" (p. 620) "ReportDocument Object" (p. 476)

CatalogLevel Object
Description
An object that represents the catalog qualification level of a Database object.

Discussion
Depending on the qualification levels of the Database object containing the CatalogLevel object, the CatalogLevel object can contain a collection of Table objects or a collection of SchemaLevel objects that contain collections of Table objects. A CatalogLevel represents one level of qualification in the parent Database object. For a CatalogLevel object that contains SchemaLevel objects, there are two levels of qualification in the parent Database object. To access a Table object, its location must be correctly qualified. To see if the catalog representation of the database uses the database catalog and/or database schema qualification levels to qualify tables, use the following conditional statement:
Check for the database catalog qualification first: IF Not (database.CatalogLevels Is Nothing) THEN The database uses the database catalogs to qualify other database objects (schemata or tables). [ more of your code ] Remember: for each CatalogLevel object you will need to check for the database schema qualification it may be using. ELSE The database does not use the database catalogs, check for the database schema qualification: IF Not (database.SchemaLevels Is Nothing) THEN The database uses the database schemata to qualify tables. [ more of your code ] ELSE The database does not use any qualification levels

Administration Guide 465

Chapter 53: Objects


for tables. [ more of your code ] END IF END IF

Method Name Delete Method

Description Deletes the CatalogLevel object from the CatalogLevels collection.

Property Name Application Property Name Property Parent Property SchemaLevels Property Tables Property

Description Returns the Application object. Sets or returns the name of the CatalogLevel object. Returns the parent object. Returns a collection of SchemaLevel objects. Returns a collection of Table objects.

Example
This example shows the name the first CatalogLevel object. This macro will fail if the active catalog does not contain qualification levels. The Outdoors catalog does not contain qualification levels.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Dim objCatLevel As Object Dim strCatLevelName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", "creator" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objCatLevel = objDB.CatalogLevels(1) strCatLevelName = objCatLevel.Name MsgBox strCatLevelName Set objCatLevel = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"CatalogLevels Collection" (p. 488) "CatalogLevels Property" (p. 619)

Column Object
Description
An object that represents a column in a Table object.

466 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Discussion
Each Column object corresponds to a column in a table. Column objects are grouped in the Columns collection which is owned by Table objects. Method Name Delete Method Description Deletes the Column object from the Columns collection.

Property Name Application Property IsKey Property Name Property Parent Property Type Property UniqueID Property

Description Returns the Application object. Sets or returns whether the Column object is a key. Sets or returns the name of the Column object. Returns the parent object. Sets or returns the data type of the Column object. Sets or returns the unique metadata identification for the Column object.

Example
This example shows the name of the COUNTRY_CD Column object.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objColObj As Object Dim strColName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) Set objColObj = objDB.Tables("COUNTRY").Columns("COUNTRY_CD") strColName = objColObj.Name MsgBox strColName Set objColObj = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Database Object
Description
An object that represents the Impromptu view of the database. A Database object ultimately contains Table objects. Some Database objects are organized with one level or two levels of qualification for Tables. These levels of qualification are CatalogLevel and SchemaLevel. SchemaLevel objects contain Table objects and CatalogLevel objects contain SchemaLevel objects.

Discussion
A Database object can be structured in four ways: Database object containing Table objects (no qualification) Database object containing SchemaLevel objects that contain Table objects (one level of qualification) Administration Guide 467

Chapter 53: Objects Database object containing CatalogLevel objects that contain Table objects (one level of qualification) Database object containing CatalogLevel objects that contain SchemaLevel objects that contain Table object (two levels of qualification)

For a Database object with no qualification levels, the Tables in the collection can be accessed by name because all Table object names are unique. For Database objects with qualification levels, the Table object names are not necessarily unique and therefore an error can occur if you attempt to access a Table object by name from the Database object. This is also true for aliases created for the Table object and SchemaLevel objects where the Database object contains two levels of qualification. Method Name Delete Method InsertQualificationLevel Method RemoveQualificationLevel Method Description Deletes the Database object from the Databases collection. Inserts a database qualification level into a Database object. Removes the qualification level immediately below the Database object.

Property Name Application Property CatalogLevels Property Definition Property Name Property Parent Property SchemaLevels Property Tables Property

Description Returns the Application object. Returns a collection of CatalogLevel objects. Returns the database connection string from the Cognos.ini file or the DatabaseDefinition object. Sets or returns the name of the Database object. Returns the parent object. Returns a collection of SchemaLevel objects. Returns a collection of Table objects.

Example
This example adds catalog and schema qualification levels to the Database object.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateCatalog "C:\Catalogs\Sample.cat", "OUTDOORS", 0 Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") objDB.InsertQualificationLevel "Schema 1a", 1 objDB.InsertQualificationLevel "Catalog 1", 0 objDB.CatalogLevels.Add "Catalog 2" objDB.CatalogLevels(2).SchemaLevels.Add "Schema 2a" objDB.CatalogLevels(2).SchemaLevels.Add "Schema 2b" objDB.CatalogLevels(1).SchemaLevels.Add "Schema 1b" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

468 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Related Topics
"Databases Collection" (p. 490) "Databases Property" (p. 630)

DatabaseConnection Object
Description
An object that describes the user classs connection information for a database.

Discussion
The collection of DatabaseConnections is a property of the UserClass object. Property Name Application Property DBObject Property EncryptedPassword Property PlainTextPassword Property ReadIsolationLevel Property UserName Property Description Returns the Application object. Returns the Database object associated with the connection. Sets or returns the encrypted password for logging onto the database. Sets the unencrypted password for logging onto the database. Sets or returns the read-transaction isolation level to request when connecting to the Database object. Sets or returns the name used to log onto the Database object.

Example
This example shows the user name required to log on to the database object.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDBConnection As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Imp_cat\ " & _ "biadmin.cat","Creator",,"biadmin","biadmin" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass Set objDBConnection = objUser.DatabaseConnections(1) MsgBox objDBConnection.UserName Set objDBConnection = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DatabaseConnections Collection" (p. 490) "DatabaseConnections Property" (p. 628)

DatabaseDefinition Object
Description
An object representing the defined databases for Impromptu.

Administration Guide 469

Chapter 53: Objects

Discussion
This object corresponds to the .ini file entries and values from the Database Definition dialog boxes. Property Name Application Property Definition Property IsExternal Property Name Property Parent Property Type Property Description Returns the Application object. Returns the location of the database from the connection string in the Cognos.ini file. Returns whether the database is an external HotFile. Returns the logical database name or the name and location of the HotFile. Returns the parent object. Returns the Impromptu data type for the type of database.

Example
This example shows the name of the first DatabaseDefinition object that is in the DatabaseDefinition collection.
Sub Main() Dim objImpApp As Object Dim objDBDefinition As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objDBDefinition = objImpApp.DatabaseDefinitions(1) MsgBox objDBDefinition.Name Set objDBDefinition = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DatabaseDefinitions Collection" (p. 491) "DatabaseDefinitions Property" (p. 629)

Expression Object
Description
An object that represents an expression either in a catalog or a report.

Discussion
This object enables the user to change the expression (either as a single operation or by adding elements to an expression one at a time) and query its string representation. Method Name AppendEx Method (No Prompt) Clear Method Commit Method Description Appends a single token or an entire expression. Empties the expression. Signals that the user has completed all changes using the AppendEx and Clear methods.

470 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Property Name FormulaEx Property ResultType Property

Description Returns the string representation of an expression. Returns an integer value for the type of data resulting from the expression.

Example
This example shows the formula of the Expression object that is in the folder item Closed Sale.
Sub main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Dim objExpression As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "E:\Catalogs\Great Outdoors " & _ "Sales Data.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders Set objExpression = objCatFolders("Orders").Items _ ("Conditions").Items("Closed Sale") MsgBox objExpression.Value.FormulaEx Set objExpression = Nothing Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

FolderItem Object
Description
An Impromptu folder item.

Discussion
Use the FolderItem object and its properties and methods to define the business view of your organization for your users. Folder items can be one of two things: a folder (in which case it may have child items) an expression Method Name CopyTo Method Delete Method MoveTo Method Description Copies the folder to the destination folder. Deletes the item from the ownership collection. Moves the folder to a new folder location.

Property Name Application Property IsDistributed Property Items Property Name Property

Description Returns the Application object. Sets or returns whether the object is distributed. Returns a collection of children FolderItem objects. Sets or returns the name of the FolderItem object. Administration Guide 471

Chapter 53: Objects

Property Name Parent Property UniqueID Property Value Property

Description Returns the parent object. Sets or returns the unique metadata identification for the FolderItem object. Returns the expression in the FolderItem object.

Example
This example shows the name of the first folder in the catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objFoldItem As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\test.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objFoldItem = objImpCat.Folders(1) MsgBox "The first folder is " & objFoldItem.Name Set objFoldItem = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedFolderItems Collection" (p. 494) "DeniedFolderItems Property" (p. 634)

PublishExcel Object
Description
An object that controls the creation of Microsoft Excel files from Impromptu reports.

Discussion
Use this object to publish an Impromptu report as an Microsoft Excel file. Method Name Publish Method Description Saves the referenced report as an Microsoft Excel file. For more information, see the Mastering Impromptu Reports book.

Property Name ExportOptions Property Version Property

Description Manages the report objects to export. Defines the Microsoft Excel version in which to export reports.

Example
This example creates a report in Microsoft Excel format.
Sub Main() Dim ImpApp as Object Dim ImpRep as Object Dim ImpExcelRep as Object Dim ImpPath as String

472 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects


MsgBox "Publish as Excel" Set ImpApp = CreateObject("CognosImpromptu.Application") ImpApp.Visible 1 'make Impromptu visible ImpPath = "C:\Program Files\Cognos\<rendition_id>\Samples\Impromptu\" Set ImpRep = ImpApp.OpenReport (ImpPath & "Reports\currency.imr") ImpRep.Visible 1 Set ImpExcelRep = ImpRep.PublishExcel ImpExcelRep.Version 1 ImpExcelRep.ExportOptions 15 ImpExcelRep.Publish ImpPath & "Reports\currency.xls" ImpApp.Quit Set ImpExcelRep = Nothing Set ImpRep = Nothing Set ImpApp = Nothing End Sub

Related Topics
"Publish Method" (p. 588) "ExportOptions Property" (p. 640) "Version Property" (p. 704)

PublishHTML Object
Description
An object that controls the creation of HyperText Markup Language (HTML) files from Impromptu reports.

Discussion
Use the PublishHTML object to save an Impromptu report as HTML. Method Name ClearTOCColumns Method Publish Method Description Removes all columns from the HTML Report Navigator. Saves the referenced report as HTML files. For more information, see the Mastering Impromptu Reports book. Resets the PublishHTML object to the settings as they were last saved in the Save as HTML options box and the HTML tab of the Report Properties dialog box. Adds the specified grouped column to the Report Navigator when a report is saved as HTML.

Reset Method

TOCAddColumn Method

Property Name ExportMetaTags Property FromPage Property SuppressTOCDuplicates Property

Description Determines whether HTML meta tags will be added to the HTML report output. Sets or returns which page of the Impromptu report will be the first page of the HTML report output. Sets or returns whether report footer information is added to the Report Navigator when a report is saved as HTML.

Administration Guide 473

Chapter 53: Objects

Property Name TOC Property TOCByPageNumber Property ToPage Property

Description Sets or returns whether the HTML report output includes the Report Navigator. Sets or returns whether the Report Navigator contains page numbers and activates the Report Navigator. Sets or returns which page of the Impromptu report will be the last page of the HTML report output.

Example
This example creates a report in HTML format and then saves the report to one or more files. The HTML and related files are placed into a folder called tmp with the prefix myfiles. Users who do not have access to Impromptu can now use a Web browser to view the report.
Sub Main() Dim objImpApp as Object Dim objHTML as Object Dim objImpRep as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Program Files\cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\Great Outdoors Sales " & _ "Data.cat","Creator" Set objImpRep = objImpApp.OpenReport _ ("c:\Program Files\cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\annual product sales.imr") Set objHTML = objImpRep.PublishHTML objHTML.Publish "c:\tmp","myfiles" Set objImpRep = Nothing Set objHTML = Nothing Set objImpApp = Nothing End Sub

Related Topics
"ReportDocument Object" (p. 476) "Products (Publish as HTML) Sample" (p. 721) "Publish Method" (p. 588) "PublishHTML Property" (p. 681) "PublishPDF Object" (p. 474) "Sales By Country (Publish as HTML) Sample" (p. 722)

PublishPDF Object
Description
Controls the creation of PDF files from Impromptu reports.

Discussion
Use this object to publish an Impromptu report as a PDF (portable document file). Method Name Publish Method Description Publishes the referenced report as a PDF.

Property Name Application Property

Description Returns the Application object.

474 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Example
This example opens an existing report in Impromptu (called Annual_Sales.imr) and then publishes it as a PDF called Annual_Sales.pdf in the C:\Temp folder. Users who do not have Impromptu can now use Adobe Acrobat Reader to view the report.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object Dim objPDFPub as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True Set objImpRep = objImpApp.OpenReportNoExecute("C:\My Documents\Annual_Sales.imr") objImpRep.Reexecute Set objPDFPub = objImpRep.PublishPDF objPDFPub.Publish "C:\Temp\Annual_Sales.pdf" Set objImpApp = Nothing Set objImpRep = Nothing Set objPDFPub = Nothing End Sub

Related Topics
"ReportDocument Object" (p. 476) "Publish Method" (p. 588) "PublishHTML Object" (p. 473) "PublishPDF Property" (p. 682)

QueryItem Object
Description
Represents a report query item, for example, a report column or expression.

Discussion
Use this object and the QueryItems method to gather information about the queries in a report. Property Name FolderItem Property FolderPath Property MetaDataItem Property MetaDataPath Property Name Property Type Property Description Returns a reference to the catalog folder item for the query item in the report. Returns the folder path for the catalog folder item for the query item in the report. Returns a reference to the metadata item for the query item in the report. Returns the metadata path for the query item in the report. Returns the name of the object. Returns the type of query item.

Example
This example shows the name of the first folder and the number of query items from the current report. To run this example, you must set Impromptu to single instance and open the report.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objImpRep As Object

Administration Guide 475

Chapter 53: Objects


Dim objQueryItemsCol As Object ' collection Dim objFolderItemCol As Object ' collection Dim count As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True Set objImpCat = objImpApp.ActiveCatalog Set objFolderItemCol = objImpCat.Folders(1).Items ' get children of 1st folder MsgBox "The first folder is " & objFolderItemCol(1).Name Set objImpRep = objImpApp.ActiveDocument Set objQueryItemsCol = objImpRep.QueryItems count = objQueryItemsCol.count MsgBox "QueryItems.Count = " & count End Sub

Related Topics
"ReportDocument Object" (p. 476) "QueryItem Property" (p. 685) "QueryItems Collection" (p. 501) "QueryItems Method" (p. 591)

ReportDocument Object
Description
Represents an Impromptu report within an OLE automation script.

Discussion
With Impromptu set to multiple instance, you can create a ReportDocument object by using the following functions: use the GetObject function to retrieve an existing Impromptu report.
Set objImpApp = GetObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument

use the CreateObject function to start a new, empty instance of the Impromptu Application object and then use the OpenReport method to refer to an existing report. For example,
Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.OpenReport("c:\imp\samples\sales.imr")

With Impromptu set to single instance, you must replace the GetObject function with a CreateObject function. GetObject is not supported under single instance. The CreateObject function either retrieves the existing instance or starts a new one if no instance exists. Method Name Activate Method ApplyTemplate Method CloseReport Method CopySpecialToClipboard Method CopyToClipboard Method CreateSnapshot Method Export Method Description Activates the window associated with the specified report. Uses the specified template to format the active report. Closes the active report without saving it. Copies report objects to the Clipboard for linking within another application. Copies selected report objects to the Clipboard. Creates a snapshot for the active report. Exports the active report in one of a variety of formats.

476 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects Method Name ExportASCII Method ExportData Method ExportdBASE Method ExportExcelWithFormat Method ExportHotFile Method ExportSQL Method ExportText Method ExportTransformer Method GetDataValue Method GetSelectedText Method Print Method, PrintOut Method Publish Method PublishXML Method QueryDialog Method QueryItems Method ReExecute Method RetrieveAll Method RetrieveRows Method Save Method (Reports) SaveAs Method Title Method UseDatabase Method Visible Method Description Exports the active report as a delimited ASCII file (.csv). Exports the active report as a PowerPlay file (.dat). Exports the active report as a dBASE file (.dbf). Exports the active report, with format characteristics, as a Microsoft Excel file (.xls). Exports the active report as an Impromptu HotFile. Exports the active report as a Structured Query Language (SQL) file. Exports the active report as a Text (.txt) file. Exports the active report as a PowerPlay Transformer (IQD) file. Returns the data value from a specific occurrence for a specific data item in the active query. Returns selected text. Prints the active report. Saves the referenced report as HTML or PDF, as appropriate. Saves the referenced report as an XML file. Shows the Data tab of the Query dialog box and suspends your macro while you enter information. Returns a collection of all the query items in the current report. Executes the query for the active report. Retrieves all data from the database for the active report. Retrieves a specific number of rows from the database for the active report. Saves the active report in either report or snapshot format. Saves the active report with a different name in either report or snapshot format. Sets or returns the document description. Changes the active report from using snapshot data to using data from the database. Sets or returns whether the application window is visible.

Administration Guide 477

Chapter 53: Objects

Property Name AllSelectedFrames Property Application Property CSVExportOptions Property

Description Returns a list of the selected frame objects and their child objects on the active ReportDocument. Returns the Application object that is used to access the report document. Determines how leading zeroes in text and numeric values with null or missing values are handled in a ReportDocument when CSV output is generated and viewed in Microsoft Excel. Returns which document has returned errors when running multiple documents. Returns the full name of the document, including the path. Returns whether the active report has been changed since the last time it was saved. Returns the file name for the active document. Returns the parent object for the specified object, for example, the application for the report document. Returns the path in which the document is stored. Returns an object that is a PDF representation of a Report Document object. Returns a list of the selected frame objects on the active report. Returns the SQL string from the Profile tab of the Query dialog box. Sets or returns the window size of the report document: minimized, maximized, or last setting.

ErrorDocument Property FullName Property Modified Property Name Property Parent Property Path Property PublishPDF Property SelectedFrames Property SQL Property WindowState Property

Example
This example opens a report and then saves it as a snapshot.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object Dim strReportName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\imp\samples\outdoors.cat", "Creator" strReportName = InputBox("Report to Mail?","Mail Impromptu Report") Set objImpRep = objImpApp.OpenReport(strReportName) strReportName = objImpRep.FullName objImpRep.RetrieveAll objImpRep.Save 1 objImpRep.CloseReport objImpApp.Quit Set objImpRep = Nothing Set objImpApp = Nothing MailReport strReportName End Sub

478 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Related Topics
"CreateStoredProcedure Method" (p. 547)

SchemaLevel Object
Description
An object that represents the schema qualification level of a Database object. A SchemaLevel object contains Table objects.

Discussion
A SchemaLevel object can have as the parent object, a Database object, or a CatalogLevel object. To see if the catalog representation of the database uses the database catalog and/or database schema qualification levels to qualify tables, use the following conditional statement:
Check for the database catalog qualification first: IF Not (database.CatalogLevels Is Nothing) THEN The database uses the database catalogs to qualify other database objects (schemata or tables). [ more of your code ] Remember: for each CatalogLevel object you will need to check for the database schema qualification it may be using. ELSE The database does not use the database catalogs, check for the database schema qualification: IF Not (database.SchemaLevels Is Nothing) THEN The database uses the database schemata to qualify tables. [ more of your code ] ELSE The database does not use any qualification levels for tables. [ more of your code ] END IF END IF

Method Name Delete Method

Description Deletes the SchemaLevel object from the SchemaLevels collection.

Property Name Application Property Name Property Parent Property Tables Property

Description Returns the Application object. Sets or returns the name of the SchemaLevel object. Returns the parent object. Returns a collection of Table objects.

Example
This example shows the name of the first SchemaLevel object in the database.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Dim objSchLevel As Object Dim strSchName As String Set objImpApp = CreateObject("CognosImpromptu.Application")

Administration Guide 479

Chapter 53: Objects


objImpApp.CreateCatalog "C:\Catalogs\Sample.cat", "OUTDOORS", 0 Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objSchLevel = objDB.SchemaLevels(1) strSchName = objSchLevel.Name MsgBox strSchName Set objSchLevel = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"SchemaLevels Collection" (p. 501) "SchemaLevels Property" (p. 690)

SelectedFrame Object
Description
An object that represents a selected frame on a ReportDocument.

Discussion
Each SelectedFrame object represents an individual frame on a ReportDocument that has been selected by a user. All such objects are contained in a SelectedFrames collection. The collection of selected frames is returned when either the SelectedFrames or AllSelectedFrames properties are applied to a ReportDocument object. Individual SelectedFrame objects within the collection can be referenced by adding an index value to the property or by using the Item property with an index value. Property Name Application Property DatabaseItem Property QueryItem Property Description Returns the Application object. Returns the fully-qualified database column name. Returns a string that contains the query column item for a selected text frame. Returns an empty string for non-text frames. Returns a string that contains the fully-qualified formula for a selected text frame. Returns the name of a SelectedFrame object as a string.

Formula Property Name Property

Example
This example shows the name of the selected frame, the underlying formula, the name of the associated database column, and the query column item.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim objSelectedFrame As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument Set objSelectedFrame = objImpRep.SelectedFrames(1) With objSelectedFrame MsgBox .Name MsgBox .Formula MsgBox .DatabaseItem MsgBox .QueryItem End With

480 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects


Set objSelectedFrame = Nothing Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Related Topics
"AllSelectedFrames Property" (p. 613)

StoredProcedure Object
Description
A Database stored procedure.

Discussion
Use StoredProcedure objects to access and execute database stored procedure. If you use automation to run stored procedures, then you can see only the parameters and the values returned by the procedure. You cannot see the rows of data that the stored procedure returns when you run it. To access the result set, you must create a report that uses the Type-in SQL interface when you run the stored procedure. Method Name Execute Method GetParameter Method SetProcedure Method Description Executes the Stored procedure. Returns the value of an output parameter from the Stored procedure. Sets the name of the Stored procedure.

Example
This example runs a stored procedure on an SQL Server database. The procedure determines the total number of Impromptu users that are currently attached to the database and then shows this number in Impromptu. The stored procedure that is run looks like the following example:
create procedure sp_impusers @appname varchar(30), @server varchar(30) out @cnt int out as select @cnt=count(program_name) from master.dbo.sysprocesses where program_name = @appname select @server = @@SERVERNAME select @cnt, @server

The IBM CognosScript macro looks like the following example:


Sub Main() Dim objImpApp As Object Dim objImpSP As Object Dim strAppName As String Dim strServerName As String Dim intCnt As Integer Dim strMsg As String strAppName = "Impromptu" Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\imp\workspce\sqlsrvr.cat" Set objImpSP = objImpApp.CreateStoredProcedure objImpSP.SetProcedure "sp_impusers(Char[255] IN," & _ "Char[255] OUT, OUT)" objImpSP.Execute strAppName, strServerName, intCnt strMsg = strAppName + " processes running..." strMsg = strMsg + cStr(objImpSP.GetParameter(3))

Administration Guide 481

Chapter 53: Objects


MsgBox strMsg, 64,"Server: ,RTrim$(objImpSP.GetParameter(2))" Set objImpSP = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Application Object" (p. 462) "ReportDocument Object" (p. 476)

Table Object
Description
An object that represents the Impromptu view of a database table. A Table object contains Column objects.

Discussion
For a Table object, its parent object can be a Database object, a CatalogLevel object, or a SchemaLevel object, depending on the qualification levels of the Database object. When the parent of a Table object is a CatalogLevel object, the Database object associated cannot access the Table object directly through its Tables collection, as it is not directly linked to the Table object. The same situation occurs when the parent of the Table object is a SchemaLevel object. Method Name CreateAlias Method Delete Method Description Creates a copy of a Table object with an alternative name. Deletes the Table object from the Tables collection.

Property Name Application Property Columns Property IsSynonym Property MasterName Property

Description Returns the Application object. Returns a collection of Column objects. Sets or returns whether the table is a synonym. Returns the name of the master table if the Table object is an alias; otherwise, returns the name of the table. Returns the MasterTable object if the Table object is an alias. Sets or returns the name of the Table object. Returns the parent object. Sets or returns the number of parent names preceding the table name in the SQL statement. Sets or returns a unique metadata identification for the Table object. Sets or returns the weight of the table.

MasterTable Property Name Property Parent Property QualificationLevel Property UniqueID Property Weight Property

482 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Example
This example shows the name of the first Table object in the database.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Dim objTable As Object Dim strTableName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objTable = objDB.Tables(1) strTableName = objTable.Name MsgBox strTableName Set objTable = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Tables Collection" (p. 503) "Tables Property" (p. 695)

TableLink Object
Description
A single-step link between two Table objects.

Discussion
Joins (table links) are composed of a left and right table, and a condition. The condition is an Expression object. Method Name Delete Method Description Deletes the TableLink object from the TableLinks collection.

Property Name Application Property Condition Property LeftTable Property Parent Property RightTable Property Type Property

Description Returns the Application object. Returns the join expression. Returns the "left" table in the join. Returns the parent object. Returns the "right" table in the join. Sets or returns the type of join.

Example
This example shows the type of join used to link the two tables referenced in the first TableLink object and the name of the tables in the join. The Type property returns an integer that corresponds to the join type. Administration Guide 483

Chapter 53: Objects


Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objTabLink As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objTabLink = objImpCat.TableLinks(1) MsgBox "The left table of the first link is " _ & objTabLink.LeftTable.Name MsgBox "The right table of the first link is " _ & objTabLink.RightTable.Name Set objTabLink = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"TableLinks Collection" (p. 504) "TableLinks Property" (p. 694)

UserClass Object
Description
An object that represents a user profile.

Discussion
Use this object to define query restrictions, security levels, filters , and other permissions for Impromptu user classes. Method Name CreateFilterFor Method Delete Method GetFilterFor Method RemoveFilterFor Method Description Creates a new filter for the specified object and returns the filter for further modification. Deletes the UserClass object from the UserClasses collection. Returns the filter expression, if one exists, for the specified object. Removes a filter for the specified object.

Property Name Application Property CanAddOrModifyFolders Property

Description Returns the Application object. Sets or returns whether the UserClass object can add or modify folders.

CanAddOrModifyUserClasses Property Sets or returns whether the UserClass object can add or modify user classes. CanCreateNewReports Property CanDirectEnterSQL Property Sets or returns whether the UserClass object can create new reports. Sets or returns whether the UserClass object can enter SQL statements directly into report queries.

484 IBM(R) Cognos(R) Impromptu(R)

Chapter 53: Objects

Property Name CrossProductPermission Property DatabaseConnections Property DeniedCatalogs Property DeniedColumns Property DeniedFolderItems Property DeniedSchemas Property DeniedSelectValues Property

Description Sets or returns whether the UserClass object has cross-product permission. Returns a collection of DatabaseConnection objects for the UserClass object. Returns a collection of CatalogLevel objects to which the UserClass object is denied access. Returns a collection of Column objects to which the UserClass object is denied access. Returns a collection of FolderItem objects to which the UserClass object is denied access. Returns a collection of SchemaLevel objects to which the UserClass object is denied access. Returns a collection of FolderItem objects for which this UserClass object is denied permission to perform a select values operation. Returns a collection of Table objects to which the UserClass object denied access. Sets or returns the encrypted password for logging onto the catalog as this user class. Returns a collection of Column objects for which the UserClass object has filters. Returns a collection of Table objects for which the UserClass object has filters. Sets or returns whether the UserClass object has a text-blob limit. Sets or returns the time limit to run a query for the UserClass object. Sets or returns the maximum number of rows the UserClass object can retrieve. Sets or returns the maximum number of tables the UserClass object can retrieve. Sets or returns the maximum number of text-blob characters for the UserClass object. Sets or returns whether the connect time is minimized. Sets or returns the name of the UserClass object Sets or returns whether the UserClass object can sort non-indexed columns. Sets or returns the outer join permission for the UserClass object. Returns the parent object. Sets the plain-text password for logging onto the catalog as this user class. Sets or returns the time for the query execution at which the UserClass object is warned. Sets or returns the state of query processing for the UserClass object.

DeniedTables Property EncryptedPassword Property FilteredColumns Property FilteredTables Property HasTextBlobLimit Property MaxQueryExecutionTime Property MaxRowsRetrieved Property MaxTablesPerReport Property MaxTextBlobCharacters Property MinimizeConnectTime Property Name Property NonIndexSortingPermission Property OuterJoinPermission Property Parent Property PlainTextPassword Property QueryExecutionTimeWarnAfter Property QueryProcessing Property

Administration Guide 485

Chapter 53: Objects

Property Name RowsRetrievedWarnAfter Property SelectDistinctPermission Property TablesPerReportWarnAfter Property UserClasses Property

Description Sets or returns the number of rows retrieved at which the UserClass object is warned. Sets or returns whether the user can set the query to select distinct values in a database. Sets or returns the number of tables used per report at which the UserClass object is warned. Returns a collection of UserClass objects based on this UserClass object.

Example
This example shows the name of the first user class under the Creator user class.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) MsgBox objUser.Name Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"UserClasses Collection" (p. 505)

486 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections

Name CatalogLevels Collection Columns Collection Databases Collection DatabaseConnections Collection DatabaseDefinitions Collection DeniedCatalogs Collection DeniedColumns Collection DeniedFolderItems Collection DeniedSchemas Collection DeniedSelectValues Collection

Description An ownership collection of CatalogLevel objects. An ownership collection of Column objects owned by a Table object. An ownership collection of Database objects. An ownership collection of DatabaseConnection objects for the UserClass object. An ownership collection of defined DatabaseDefinition objects. A reference collection of CatalogLevel objects to which the UserClass object is denied access. A reference collection of Column objects to which the UserClass object is denied access. A reference collection of FolderItem objects to which the UserClass object is denied access. A reference collection of SchemaLevel objects to which the UserClass object is denied access. A reference collection of FolderItem objects to which the UserClass object is denied permission to perform a select values operation. A reference collection of Table objects to which the UserClass object is denied access. A reference collection of Column objects for which the UserClass object has filters. A reference collection of Table objects for which the UserClass object has filters. The top-level ownership collection of FolderItem objects in a Catalog object. An ownership collection of child FolderItem objects. An ownership collection of QueryItem objects. An ownership collection of SchemaLevel objects. A collection of frame objects on a report, selected by a user. An ownership collection of Table objects.

DeniedTables Collection FilteredColumns Collection FilteredTables Collection Folders Collection Items Collection QueryItems Collection SchemaLevels Collection SelectedFrames Collection Tables Collection

Administration Guide 487

Chapter 54: Collections

Name TableLinks Collection UserClasses Collection

Description An ownership collection of TableLink objects. An ownership collection of UserClass objects.

Related Topics
"Methods" (p. 507) "Properties" (p. 607) "Objects" (p. 461)

CatalogLevels Collection
Description
An ownership collection of CatalogLevel objects.

Discussion
Only Database objects can contain a CatalogLevels collection. A Database object only contains a CatalogLevels collection if the Database object supports a catalog qualification level. If a Database object does not support catalog qualification, attempts to access a specific CatalogLevel object from the CatalogLevels collection will fail. Method Name Add Method (CatalogLevels, SchemaLevels, UserClasses) Description Adds a new CatalogLevel object to the CatalogLevels collection.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a CatalogLevel object to the CatalogLevels collection.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateCatalog "C:\Catalogs\" & _ "Sample.cat", "OUTDOORS", 0 Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") objDB.InsertQualificationLevel "Catalog 1", 0 objDB.CatalogLevels.Add "Catalog 2" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

488 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections

Related Topics
"CatalogLevel Object" (p. 465) "Database Object" (p. 467)

Columns Collection
Description
An ownership collection of Column objects owned by a Table object.

Discussion
To use this collection, first add a Database object to the Catalog object, and then add the necessary qualification levels using the CatalogLevel object, or the SchemaLevel object. Finally add Column objects to the Columns collection. Use the Item property to select a specific column object in the collection. Method Name Add Method (Columns) Description Adds a new Column object to the Columns collection.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a new REGION column to the Columns collection in the COUNTRY table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("COUNTRY").Columns.Add "REGION",1 objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"CatalogLevel Object" (p. 465) "Column Object" (p. 466) "SchemaLevel Object" (p. 479) "Table Object" (p. 482)

Administration Guide 489

Chapter 54: Collections

Databases Collection
Description
An ownership collection of Database objects.

Discussion
The Database objects in the Databases collection are indexed by name. They may be referenced by name or by index. The Databases collection is also a property of the Catalog object. A HotFile is a non-index sequential file that you can view as a single table in the Databases collection. Note: Although you can add many HotFile objects to the Databases collection, in this release of Impromptu OLE Automation, there can only be one Database object in the Databases collection. Method Name Add Method (Databases) AddExternalHotfile Method Description Adds a new Databases object to the Databases collection. Adds an external HotFile to the Databases collection.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example uses the Count property to show the number of Database objects in the Databases collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim intDatabases As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog intDatabases = objImpCat.Databases.count MsgBox "There are " & intDatabases & " databases." Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Catalog Object" (p. 464) "Database Object" (p. 467)

DatabaseConnections Collection
Description
An ownership collection of DatabaseConnection objects for the UserClass object.

490 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections

Discussion
DatabaseConnections are objects that contain information about a userclass's connection for a database. The items in the collection are indexed by name. They may be referenced by name or by index. The DatabaseConnections collection is also a property of the UserClass object. Note: In this release of Impromptu OLE Automation, there can only be one DatabaseConnection object in the DatabaseConnections collection. Property Name Application Property Count Property Item Property Parent Property Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example uses the Count property to show the number of database connections in the DatabaseConnection collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Dim intConnections As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Imp_cat\" & _ "bi admin.cat","Creator",,"biadmin","biadmin" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass intConnections = objUser.DatabaseConnections.Count MsgBox "There are " & intConnections & " DatabaseConnection " & _"Objects." Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Database Object" (p. 467) "UserClass Object" (p. 484)

DatabaseDefinitions Collection
Description
An ownership collection of defined DatabaseDefinition objects.

Discussion
A DatabaseDefinition in this collection can be referenced by index number or by Name. The DatabaseDefinitions collection is also a property of the Impromptu application object. This collection is read-only and cannot be updated by automation. The collection is created based on entries from the Cognos.ini file. Property Name Application Property Description Returns the Application object.

Administration Guide 491

Chapter 54: Collections

Property Name Count Property Item Property Parent Property

Description Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example uses the Count property to show the number of database definitions in the DatabseDefinitions collection.
Sub Main() Dim objImpApp As Object Dim intNumDefns As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") intNumDefns = objImpApp.DatabaseDefinitions.Count MsgBox "The number of database definition objects " & _ "is " & intNumDefns Set objImpApp = Nothing End Sub

Related Topics
"Application Object" (p. 462) "Database Object" (p. 467)

DeniedCatalogs Collection
Description
A reference collection of CatalogLevel objects to which the UserClass object is denied access.

Discussion
Any CatalogLevel objects that are in the DeniedCatalogs collection for the parent UserClass object are not inherited by the DeniedCatalogs collection of the child UserClass object. Method Name Add Method Remove Method Description Adds an existing Catalog object to the DeniedCatalogs collection. Removes the specified Catalog object from the DeniedCatalogs collection.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a new CatalogLevel object to the DeniedCatalogs collection.
Sub Main() Dim objImpApp As Object

492 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections


Dim objImpCat As Object Dim objDB as object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.DeniedCatalogs.Add objDB.CatalogLevels(2) objImpCat.Save Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedCatalogs Property" (p. 632) "CatalogLevel Object" (p. 465) "UserClass Object" (p. 484)

DeniedColumns Collection
Description
A reference collection of Column objects to which the UserClass object is denied access.

Discussion
Any Column objects that are in the DeniedColumns collection for the parent UserClass object are not inherited by the DeniedColumns collection of the child UserClass object. Method Name Add Method Remove Method Description Adds an existing Column object to the DeniedColumns collection. Removes the specified Columns object from the DeniedColumns collection.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a column to the DeniedColumns collection. In this case, the userclass can run existing reports but cannot create new reports that use the BRANCH column of the BRANCH table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\tester.cat"

Administration Guide 493

Chapter 54: Collections


Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.DeniedColumns.Add objDB.Tables _ ("BRANCH").Columns("BRANCH") objImpCat.Save Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedColumns Property" (p. 633) "Column Object" (p. 466) "UserClass Object" (p. 484)

DeniedFolderItems Collection
Description
A reference collection of FolderItem objects to which the UserClass object is denied access.

Discussion
Any FolderItem objects that are in the DeniedFolderItems collection for the parent UserClass object are not inherited by the DeniedFolderItems collection of the child UserClass object. Method Name Add Method Remove Method Description Adds an existing FolderItem object to the DeniedFolderItems collection. Removes the specified FolderItem object from the DeniedFolderItems collection.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a FolderItem object to the DeniedFolderItems collection. In this case, the new folder is not visible, and therefore, the userclass cannot create reports that use the folder. However, the userclass can run existing reports that use the folder.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\tester.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) Set objUser = objImpCat.ActiveUserClass.UserClasses(1)

494 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections


objUser.DeniedFolderItems.Add objImpCat.Folders("Admin.") objImpCat.Save Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedFolderItems Property" (p. 634) "FolderItem Object" (p. 471) "UserClass Object" (p. 484)

DeniedSchemas Collection
Description
A reference collection of SchemaLevel objects to which the UserClass object is denied access.

Discussion
Any SchemaLevel objects that are in the DeniedSchemas collection for the parent UserClass object are not inherited by the DeniedSchemas collection of the child UserClass object. Method Name Add Method Remove Method Description Adds an existing Schema object to the DeniedSchemas collection. Removes the specified Schema object from the DeniedSchemas collection

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a SchemaLevel object to the DeniedSchemas collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.DeniedSchemas.Add objDB.SchemaLevels("Schema 2") objImpCat.Save Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Administration Guide 495

Chapter 54: Collections

Related Topics
"DeniedSchemas Property" (p. 635) "SchemaLevel Object" (p. 479) "UserClass Object" (p. 484)

DeniedSelectValues Collection
Description
A reference collection of FolderItem objects to which the UserClass object is denied permission to perform a select values operation.

Discussion
Any FolderItem objects that are in the DeniedSelectValues collection for the parent UserClass object are not inherited by the DeniedSelectValues collection of the child UserClass object. By denying the UserClass object the ability to perform a select value operation, the UserClass object can no longer provide a Select Distinct operation against a column. In situations where the column has numerous unique values, this collection prevents the creation of a very long list of values that can cause great delays. Note: If the SelectDistinctPermission property is set to 2 (Prevent), all columns are denied the permission to perform a Select Distinct operation regardless of whether they are FolderItem objects in this collection. Method Name Add Method Remove Method Description Adds an existing FolderItem object to the DeniedSelectValues collection. Removes the specified FolderItem object from the DeniedSelectValues collection.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a Column object to the DeniedSelectValues collection. In this case, the userclass cannot view a list of unique values in the Cust No column when using that column to create a filter or a calculation.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\great sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.DeniedSelectValues.Add objImpCat.Folders _ ("Customers").Items("Cust No") MsgBox objUser.DeniedSelectValues(1).Name objImpCat.Save

496 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections


Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedSelectValues Property" (p. 635) "FolderItem Object" (p. 471) "UserClass Object" (p. 484)

DeniedTables Collection
Description
A reference collection of Table objects to which the UserClass object is denied access.

Discussion
Any Table objects that are in the DeniedTables collection for the parent UserClass object are not inherited by the DeniedTables collection of the child UserClass object. Method Name Add Method Remove Method Description Adds an existing Table object to the DeniedTables collection. Removes the specified Table object from the DeniedTables collection

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a Table object to the DeniedTables collection. In this case, the userclass cannot create or run existing reports that use the ORDER table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\tester.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.DeniedTables.Add objDB.Tables("ORDER") objImpCat.Save Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Administration Guide 497

Chapter 54: Collections

Related Topics
"DeniedTables Property" (p. 636) "Table Object" (p. 482) "UserClass Object" (p. 484)

FilteredColumns Collection
Description
A reference collection of Column objects for which the UserClass object has filters.

Discussion
Any Column objects that are in the FilteredColumns collection for the parent UserClass object are not inherited by the FilteredColumns collection of the child UserClass object. To add objects to this collection, use the CreateFilterFor method of the UserClass object. To remove objects from this collection, use the RemoveFilterFor method of the UserClass object. Property Name Application Property Count Property Item Property Parent Property Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example uses the Count property to show the number of filtered Column objects in the FilteredColumns collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) MsgBox objUser.FilteredColumns.Count Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Column Object" (p. 466) "UserClass Object" (p. 484)

FilteredTables Collection
Description
A reference collection of Table objects for which the UserClass object has filters.

Discussion
Any Table objects that are in the FilteredTables collection for the parent UserClass object are not inherited by the FilteredTables collection of the child UserClass object. 498 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections To add objects to this collection, use the CreateFilterFor method of the UserClass object. To remove objects from this collection, use the RemoveFilterFor method of the UserClass object. Property Name Application Property Count Property Item Property Parent Property Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example uses the Count property to show the number of filtered Table objects in the FilteredTables collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) MsgBox objUser.FilteredTables.Count Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Table Object" (p. 482) "UserClass Object" (p. 484)

Folders Collection
Description
The top-level ownership collection of FolderItem objects in a Catalog object.

Discussion
The Catalog object is the parent for items in this collection. Method Name AddFolder Method AddItem Method (Column parameter) Description Adds a folder (sub-folder) to another folder. Adds a folder item with an associated Expression object to a folder or sub-folder.

Property Name Application Property Count Property

Description Returns the Application object. Returns the number of items in the collection.

Administration Guide 499

Chapter 54: Collections

Property Name Item Property

Description Returns the specified item in the collection.

Example
This example adds a new folder to the active catalog. All other folders in the open catalog are copied to this new folder.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders objCatFolders.AddFolder "Admin." objImpCat.Close Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Catalog Object" (p. 464) "FolderItem Object" (p. 471) "Folders Property" (p. 646)

Items Collection
Description
An ownership collection of child FolderItem objects.

Discussion
This object is empty for value items, because only folders can have children. Method Name AddFolder Method AddItem Method (Column parameter) Description Adds a folder (sub-folder) to another folder. Adds a folder item with an associated Expression object to a folder or sub-folder.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a subfolder called New Item to the Orders folder.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object

500 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections


Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\GO Sample.cat", "Creator" Set objCatFolders = objImpCat.Folders _ ("Orders").Items.AddFolder("New Item") objImpApp.CloseCatalog Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"FolderItem Object" (p. 471)

QueryItems Collection
Description
An ownership collection of QueryItem objects.

Discussion
Use this collection with the QueryItems method to gather information about the queries in a report. Property Name Application Property Count Property Item Property Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection.

Example
This example shows the name of each query folder from the current report. To run this example, you must set Impromptu to single instance and open the report.
Sub Main() Dim ImpApp as Object Dim ItemCount as Integer Set ImpApp = CreateObject("CognosImpromptu.Application") For ItemCount = 1 to ImpApp.ActiveDocument.QueryItems.Count MsgBox ImpApp.ActiveDocument.QueryItems(ItemCount).Name Next ItemCount End Sub

Related Topics
"FolderItem Property" (p. 644) "MetaDataItem Property" (p. 670) "QueryItem Object" (p. 475) "QueryItem Property" (p. 685) "QueryItems Method" (p. 591) "ReportDocument Object" (p. 476)

SchemaLevels Collection
Description
An ownership collection of SchemaLevel objects.

Administration Guide 501

Chapter 54: Collections

Discussion
The objects that can contain SchemaLevels collections are Database objects and CatalogLevel objects. A Database object only contains a SchemaLevels collection if the Database object supports a schema qualification level. Attempts to access SchemaLevel objects will fail if the Database object contains a CatalogLevel collection because the SchemaLevel objects are ambiguous, or if the Database object does not support a schema qualification level. Method Name Add Method (CatalogLevels, SchemaLevels, UserClasses) Description Adds a new SchemaLevel object to the SchemaLevels collection.

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds three schema levels to a database.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateCatalog "C:\Catalogs\Sample.cat", "OUTDOORS", 0 Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") objDB.InsertQualificationLevel "Schema 1a", 1 objDB.InsertQualificationLevel "Catalog 1", 0 objDB.CatalogLevels.Add "Catalog 2" objDB.CatalogLevels(2).SchemaLevels.Add "Schema 2a" objDB.CatalogLevels(2).SchemaLevels.Add "Schema 2b" objDB.CatalogLevels(1).SchemaLevels.Add "Schema 1b" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Database Object" (p. 467) "SchemaLevel Object" (p. 479) "SchemaLevels Property" (p. 690)

SelectedFrames Collection
Description
A collection of frame objects on a report, selected by a user.

502 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections

Discussion
You can use either the SelectedFrames or AllSelectedFrames properties to return a collection of selected frame objects. The objects are arranged in the collection in the order in which they were selected. You can use the index value to reference individual SelectedFrame objects within the collection. Use the Count property to determine the number of objects in the collection. Property Name Application Property Count Property Item Property Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection.

Example
This example shows the number of SelectedFrame objects in each of two SelectedFrames collections created, objList and objFullList.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim objList As Object Dim objFullList As Object Dim intParentFrames As Integer Dim intChildFrames As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument Set objList = objImpRep.SelectedFrames Set objFullList = objImpRep.AllSelectedFrames intParentFrames = objList.Count intChildFrames = objFullList.Count - objList.Count MsgBox "Parent Frames: " & intParentFrames MsgBox "Child Frames: " & intChildFrames Set objFullList = Nothing Set objList = Nothing Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Related Topics
"AllSelectedFrames Property" (p. 613) "SelectedFrame Object" (p. 480) "SelectedFrames Property" (p. 692)

Tables Collection
Description
An ownership collection of Table objects.

Discussion
The objects that can contain Tables collections are Database objects, CatalogLevel objects, and SchemaLevel objects. A Database object only contains a Tables collection if the Database object does not support any qualification levels. If the Database object contains a CatalogLevel or SchemaLevel collection, attempts to directly access Table objects will fail because without qualification levels the Table objects are ambiguous. Method Name Add Method (Tables) Description Adds a new Table object to the Tables collection.

Administration Guide 503

Chapter 54: Collections

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example opens an existing catalog and adds a new table to the Database object.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Dim strTableName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") objDB.Tables.Add "New Table" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"CatalogLevel Object" (p. 465) "Database Object" (p. 467) "SchemaLevel Object" (p. 479) "Table Object" (p. 482)

TableLinks Collection
Description
An ownership collection of TableLink objects.

Discussion
TableLink objects are the joins you create for tables. The TableLinks collection is also a property of the Catalog object. Method Name Add Method (TableLinks) Description Adds a new TableLink object to the TableLinks collection.

Property Name Application Property Count Property Item Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection.

504 IBM(R) Cognos(R) Impromptu(R)

Chapter 54: Collections Property Name Parent Property Description Returns the parent object.

Example
This example uses an expression to create an link between two tables in the active catalog. In this case, it creates an inner join between the BRANCH_CD column in the BRANCH table and the BRANCH_CD column in the CUSTSITE table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objNewLink As Object Dim objNewLinkExpression As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) Set objNewLink = objImpCat.TableLinks.Add (objDB.Tables _ ("BRANCH"),objDB.Tables("CUSTSITE")) Set objNewLinkExpression = objNewLink.Condition With objNewLinkExpression .Append objDB.Tables("BRANCH").Columns("BRANCH_CD") .Append 24 'in Expression Automation, this statment ' means the equals sign, = .Append objDB.Tables("CUSTSITE").Columns("BRANCH_CD") .Commit End With objImpCat.Save Set objNewLinkExpression = Nothing Set objNewLink = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Catalog Object" (p. 464) "TableLink Object" (p. 483) "TableLinks Property" (p. 694)

UserClasses Collection
Description
An ownership collection of UserClass objects.

Discussion
All UserClass objects can contain a UserClasses collection of UserClass objects. These child UserClass objects inherit the properties of the parent UserClass object and can be further restricted from information in the Catalog object. Method Name Add Method (CatalogLevels, SchemaLevels, UserClasses) Description Adds a new UserClass object to the UserClasses collection.

Administration Guide 505

Chapter 54: Collections

Property Name Application Property Count Property Item Property Parent Property

Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection. Returns the parent object.

Example
This example adds a new UserClass object to the UserClasses collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog objImpCat.ActiveUserClass.UserClasses.Add "NewUser" objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Catalog Object" (p. 464) "UserClass Object" (p. 484) "UserClasses Property" (p. 702)

506 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Name Activate Method Add Method (Columns) AddExternalHotfile Method AddFolder Method AddItem Method (Column parameter) AddTable Method AppendEx Method (No Prompt) ApplyTemplate Method ChangeUserClass Method Clear Method ClearTOCColumns Method Close Method CloseCatalog Method CloseReport Method Commit Method ConnectDatabase Method CopySpecialToClipboard Method CopyTo Method CopyToClipboard Method CreateAlias Method CreateCatalog Method CreateEmptyCatalog Method

Description Activates the application window or the window associated with the specified report. Adds a new object into the specified collection. Adds an external HotFile to the Databases collection. Adds a folder (sub-folder) to another folder. Adds a folder item with an associated Expression object to a folder or sub-folder. Adds a table from the database to the catalog for the current application. Appends a single token or an entire expression. Uses the specified template to format the active report. Changes the current user class. Clears the expression. Removes all columns from the HTML Report Navigator. Closes the active catalog and saves any changes. Closes the active catalog and saves any changes. Closes the active report without saving it. Signals the user has completed all changes using the AppendEx and Clear Methods. Attaches to the database for the specified catalog. Copies report objects to the Clipboard for linking within another application. Copies the folder to the destination folder. Copies selected report objects to the Clipboard. Creates an alternate name of the Table object. Creates a catalog with the default included tables and the default user profile. Creates a new, empty catalog.

Administration Guide 507

Chapter 55: Methods Name CreateFilterFor Method CreateSnapshot Method CreateStoredProcedure Method DatabaseConnected Method Delete Method DisconnectDatabase Method DistributedUpdate Method Execute Method Export Method ExportASCII Method ExportData Method ExportdBASE Method ExportExcelWithFormat Method ExportHotFile Method ExportSQL Method ExportText Method ExportTransformer Method FileSetPrinter Method GenerateReport Method GetAppVersionInfo Method GetDataValue Method GetErrorNumber Method GetFilterFor Method GetNextQueryError Method GetParameter Method GetSelectedText Method Description Creates a new filter for the specified object and returns the filter for further modification. Creates a snapshot for the active report. Creates a Stored Procedure object. Returns a Boolean value based on whether the catalog is connected to its database. Deletes an object from the collection. Disconnects from the database for the catalog. Performs Catalog update against the master Catalog. Executes the stored procedure. Exports the active report. Exports the active report as an ASCII (.csv) file. Exports the active report as a PowerPlay (.dat) file. Exports the active report as a dBASE (.dbf) file. Exports the active report, with format characteristics, as a Microsoft Excel (.xls) file. Exports the active report as an Impromptu HotFile. Exports the active report as a Structured Query Language (SQL) file. Exports the active report as a Text (.txt) file. Exports the active report as a PowerPlay Transformer (.iqd) file. Sets the default printer for Impromptu reports. Generates a report for a specified table. Returns version information for Impromptu applications. Returns the data value from a specific occurrence for a specific data item in the active query. Returns an Impromptu error number. Returns the filter expression, if one exists, for the specified object. Returns a string containing a query error number and the associated query error description. Returns the value of an output parameter from the stored procedure. Returns selected text.

508 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods Name InsertQualificationLevel Method Interactive Method MoveTo Method OpenCatalog Method OpenCatalogEx Method OpenDrillDownReport Method OpenReport Method OpenReportExA Method OpenReportNoExecute Method Print Method, PrintOut Method Publish Method PublishXML Method QueryDialog Method Description Inserts a database qualification level into a Database object. Sets or returns whether the application is interactive. Moves this folder to the destination folder. Selects and loads the specified catalog. Selects and loads the specified catalog with the option to include security authentication. Opens an existing report for access by another application or report. Opens the specified report. Opens the specified report. Opens the specified report without executing the query. Prints the active report. Saves the referenced report to HTML or as a PDF or Microsoft Excel file. Saves the referenced report as an XML file. Shows the Data tabQuery dialog box and suspends your macro to await your input to any tab in the Query dialog box. Returns a collection of all the query items in the current report. Exits Impromptu. Executes the query for the active report. Removes the item from the collection. Removes a filter for the specified object. Removes the qualification level immediately below the database. Resets the PublishHTML object to the settings as they were last saved in the Save as HTML options dialog box and in the HTML tab of the Report Properties dialog box. Retrieves all data from the active report' database. Retrieves a specific number of rows from the active report database. Saves the active report in either report or snapshot format or the current catalog to disk under the filename found in its Filename property.

QueryItems Method Quit Method ReExecute Method Remove Method RemoveFilterFor Method RemoveQualificationLevel Method Reset Method

RetrieveAll Method RetrieveRows Method Save Method (Catalogs)

Administration Guide 509

Chapter 55: Methods Name SaveAs Method SetProcedure Method Title Method TOCAddColumn Method UpdateCatalog Method UseDatabase Method Visible Method Description Saves the active report with a different name in either report or snapshot format. Sets the name of the stored procedure. Returns or sets the document description. Adds the specified grouped column to the Report Navigator when a report is published as HTML and PDF. Updates the active catalog with information from another catalog. Removes internal snapshots and retrieves data from the active report's database. Sets or returns whether the application or report document window is visible.

Related Topics
"Collections" (p. 487) "Objects" (p. 461) "Properties" (p. 607)

Activate Method
Syntax
object.Activate

Applies To
Application Object ReportDocument Object

Description
This method Brings the visible Impromptu application to the front of the desktop as the active application. Activates the window associated with the specified ReportDocument.

Discussion
Use this method to bring the visible Impromptu application or report document to the forefront. When you create an automation procedure that involves several different reports, you need some way to set the focus on the different reports involved.

Return Type
Nothing

Example
This example runs the Impromptu application in the foreground. In this case, the user can verify catalog properties.
Sub Main() Dim objImpApp as Object Dim objImpCat as Object Dim strFileName as String Dim strDesc as String Set objImpApp = CreateObject("CognosImpromptu.Application")

510 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


objImpApp.Visible True objImpApp.Activate objImpApp.OpenCatalog "c:\Catalogs\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog objImpCat.IsDistributed = False strFileName = objImpCat.Filename MsgBox "The filename of the Catalog is " & strFileName strDesc = objImpCat.Description MsgBox "The Catalog description is " & strDesc Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Add Method (CatalogLevels, SchemaLevels, UserClasses)


Syntax
collection.Add Name

Applies To
CatalogLevels Collection SchemaLevels Collection UserClasses Collection

Description
Adds a new object into the collection.

Discussion
For CatalogLevels, SchemaLevels, and UserClasses collection, the Add method will fail if the name is illegal (invalid or duplicate), or if an argument value of the wrong type is supplied. Parameters Name Description Required. Specifies the name for the new object. Type: String

Return Type
Object

Example
This example adds a second CatalogLevel object to the database, adds two SchemaLevel objects to the second CatalogLevel object, and adds a second SchemaLevel object to the first CatalogLevel object.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateCatalog "C:\Catalogs\Sample.cat", "OUTDOORS", 0 Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") objDB.InsertQualificationLevel "Schema 1a", 1 objDB.InsertQualificationLevel "Catalog 1", 0 objDB.CatalogLevels.Add "Catalog 2" objDB.CatalogLevels(2).SchemaLevels.Add "Schema 2a" objDB.CatalogLevels(2).SchemaLevels.Add "Schema 2b" objDB.CatalogLevels(1).SchemaLevels.Add "Schema 1b" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing

Administration Guide 511

Chapter 55: Methods


Set objImpApp = Nothing End Sub

Related Topics
"CatalogLevels Property" (p. 619) "DeniedTables Property" (p. 636) "SchemaLevels Property" (p. 690) "UserClasses Property" (p. 702)

Other Add Methods


"Add Method (Columns)" (p. 513) "Add Method (Databases)" (p. 515) Add Method "Add Method (TableLinks)" (p. 516) "Add Method (Tables)" (p. 512)

Add Method (Tables)


Syntax
Tables.Add Name [, Id]

Applies To
Tables Collection

Description
Adds a new Table object to the Tables collection.

Discussion
This method will fail if the name of the new table is illegal (invalid or duplicate). If a Unique ID is not specified for the second parameter, the method will generate a Unique ID for the new table. If the Unique ID is specified, the Id should be unique among all objects. Note: The string representing the Unique ID is case sensitive. Parameters Name Description Required. Specifies the name of the new Table. Type: String Id Optional. Specifies the Unique ID of the Table object. The ID has the following format: a 17 character string consisting of two 8 hex-digit (0,1,2,3,4,5,6,7,8,9,a,A,b,B,c,C,d,D,e,E,f,F) numbers (32 bit integers) separated by comma. For example: 000012AB,0000f1f2 If the Unique ID is not specified, the method will generate an id for the new Table object. Type: String

Return Type
Object

512 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Example
This example adds the table called COUNTRY to the tables collection. In this case, the unique table Id is set.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables.Add "COUNTRY","00123ABC,0f0d0e0b" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Table Object" (p. 482) "Tables Property" (p. 695)

Other Add Methods


"Add Method (Columns)" (p. 513) "Add Method (Databases)" (p. 515) Add Method "Add Method (TableLinks)" (p. 516)

Add Method (Columns)


Syntax
Columns.Add ColumnName, ColumnType [, Id]

Applies To
Columns

Description
Adds a new object into the collection.

Discussion
For Columns collections, the add method will fail if You do not provide a string value type for the column name. Use double quotation marks to pass the name of the table column as the first parameter of the method You use an invalid second argument value type. You must assign an integer value for the column type that is in the range 1 to19. You use an invalid or duplicate Unique ID for the third argument value. If you set the Unique ID, ensure that you follow the exact format. Parameters ColumnName Description Required. Specifies the name of the new Column object. Type: String

Administration Guide 513

Chapter 55: Methods Parameters ColumnType Description Required. Specifies the data type of the new Column object. Type: Integer Use the following values to specify the data type: 1 = Character 2 = Variant Character 3 = Long Variant Character 4 = Small Int 5 = Integer 6 = Decimal 7 = Float 8 = Double 9 = Binary 10 = Var Binary 11 = Quad 12 = Date 13 = Time 14 = DateTime 15 = Interval 16 = Database Key 17 = Blob 18 = Text 19 = Blob Array Id Optional. Specifies the Unique ID of the Column object. The ID has the following format: a 17 character string consisting of two 8 hex-digit (0,1,2,3,4,5,6,7,8,9,a,A,b,B,c,C,d,D,e,E,f,F) numbers (32 bit integers) separated by comma. For example: 000012AB,0000f1f2 If the Unique ID is not specified, the method will generate an Id for the new Column object. Type: String

Return Type
Object

Example
This example adds two new columns to a table. The method sets the Unique ID for the first column. The Unique ID for the second column is passed as a third parameter.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("COUNTRY").Columns.Add "REGION",1 objDB.Tables("COUNTRY").Columns.Add "ZIP CODE",1, "00123ABC,0f0d0e0b" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Columns Collection" (p. 489) "Columns Property" (p. 621)

514 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Other Add Methods


"Add Method (Databases)" (p. 515) "Add Method (CatalogLevels, SchemaLevels, UserClasses)" (p. 511) Add Method "Add Method (TableLinks)" (p. 516) "Add Method (Tables)" (p. 512)

Add Method (Databases)


Syntax
Databases.Add LogicalDatabaseName

Applies To
Databases Collection

Description
Adds a new object into the collection.

Discussion
The add method will fail for the Databases collection if you pass a string representing a logical database name that is either invalid or doesnt correspond to the Name property value of any of the DatabaseDefinition objects. The method also fails if the userclass doesnt have permission to modify metadata for the open catalog. Parameters LogicalDatabaseName Description Required. Specifies the logical database name. Type: String

Return Type
Object

Example
This example creates an empty catalog and a connection to the underlying database.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateEmptyCatalog "c:\temp\sample.cat" Set objImpCat = objImpApp.ActiveCatalog objImpCat.Description = "Great Outdoors Sales Data" objImpCat.Databases.Add("OUTDOORS") objImpCat.Databases(1).Tables.Add("BRANCH") objImpCat.Save Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DatabaseDefinitions Collection" (p. 491) "DatabaseDefinitions Property" (p. 629) "Databases Property" (p. 630)

Other Add Methods


"Add Method (CatalogLevels, SchemaLevels, UserClasses)" (p. 511)

Administration Guide 515

Chapter 55: Methods Add Method "Add Method (TableLinks)" (p. 516) "Add Method (Tables)" (p. 512)

Add Method (TableLinks)


Syntax
TableLinks.Add LeftTable, RightTable

Applies To
TableLinks Collection

Description
Adds a new object into the collection.

Discussion
For TableLinks collection, the add method will fail if at least one of the parameter values is missing or the Unique ID for either parameter is invalid. Parameters LeftTable Description Required. Specifies the Left Table object or the Unique ID of that object. Type: Object or String RightTable Required. Specifies the Right Table object or the Unique ID of that object. Type: Object or String

Return Type
Object

Example
This example adds a link between two tables in the active catalog. In this case, an inner join is created between the BRANCH_CD column in the BRANCH table and the BRANCH_CD column in the CUSTSITE table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objNewLink As Object Dim objNewLinkExpression As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) Set objNewLink = objImpCat.TableLinks.Add (objDB.Tables _ ("BRANCH"),objDB.Tables("CUSTSITE")) Set objNewLinkExpression = objNewLink.Condition With objNewLinkExpression .AppendEx objDB.Tables("BRANCH").Columns("BRANCH_CD") .AppendEx 24 'in Expression Automation, this statment ' means the equals sign, = .AppendEx objDB.Tables("CUSTSITE").Columns("BRANCH_CD") .Commit End With Set objNewLinkExpression = Nothing Set objNewLink = Nothing Set objDB = Nothing Set objImpCat = Nothing

516 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


Set objImpApp = Nothing End Sub

Related Topics
"TableLinks Property" (p. 694)

Other Add Methods


"Add Method (CatalogLevels, SchemaLevels, UserClasses)" (p. 511) "Add Method (Columns)" (p. 513) "Add Method (Databases)" (p. 515) Add Method "Add Method (Tables)" (p. 512)

Add Method (DeniedCatalogs, DeniedColumns, DeniedFolderItems, DeniedSchemas, DeniedSelectedValues, DeniedTables)


Syntax
Object.Add(Item)

Applies To
DeniedCatalogs Collection DeniedColumns Collection DeniedFolderItems Collection DeniedSchemas Collection DeniedSelectValues Collection DeniedTables Collection

Description
Adds an existing item to the collection.

Description
For DeniedCatalogs, this parameter is a CatalogLevel object. For DeniedSchemas, this parameter is a SchemaLevel object. For DeniedSelectValues, this parameter is a FolderItem object. Parameters Item Description Required. Specifies the object. Type: Object For DeniedCatalogs, this parameter is a CatalogLevel object. For DeniedSchemas, this parameter is a SchemaLevel object. For DeniedSelectValues, this parameter is a FolderItem object.

Return Type
Object

Example
This example adds a new CatalogLevel object to the DeniedCatalogs collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as object

Administration Guide 517

Chapter 55: Methods


Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.DeniedCatalogs.Add objDB.CatalogLevels(2) Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedCatalogs Property" (p. 632) "DeniedColumns Property" (p. 633) "DeniedFolderItems Property" (p. 634) "DeniedSchemas Property" (p. 635) "DeniedSelectValues Property" (p. 635) "DeniedTables Property" (p. 636)

Other Add Methods


"Add Method (Columns)" (p. 513) "Add Method (Databases)" (p. 515) "Add Method (CatalogLevels, SchemaLevels, UserClasses)" (p. 511) "Add Method (TableLinks)" (p. 516) "Add Method (Tables)" (p. 512)

AddExternalHotfile Method
Syntax
Databases.AddExternalHotfile PathName

Applies To
Databases Collection

Description
Adds an external HotFile to the Databases collection.

Discussion
Use this method to create joins between HotFiles and database tables defined so that the Catalog can report from both simultaneously. This method fails if you do not specify a valid location or if you do not have authority to change the metadata for the catalog. Parameters PathName Description Required. Specifies the location of the HotFile. Type: String

Return Type
Object

Example
This example adds the location of a HotFile to the Catalog.
Sub Main() Dim ImpApp As Object

518 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


Dim ImpCat As Object dim databases as integer Dim DBS As Object On error goto ErrorRoutine Set ImpApp = CreateObject("CognosImpromptu.Application") ImpApp.CreateCatalog "C:\Catalogs\Sample.cat", "OUTDOORS", 0 Set ImpCat = ImpApp.ActiveCatalog Set DBS = ImpCat.Databases databases = ImpCat.Databases.count msgbox "There are " & databases & " databases." DBS.AddExternalHotfile "c:\hotfile" Set DBS = Nothing Set ImpCat = Nothing Set ImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number: " & Err & " occurred at line " & Erl Resume Done End Sub

Related Topics
"Databases Property" (p. 630)

AddFolder Method
Syntax
collection.AddFolder(Name, [Table])

Applies To
Folders Collection Items Collection

Description
Adds a folder (sub-folder) to another folder.

Discussion
The name of the folder added must be valid. Its name must be unique within the parent folder. Parameters Name Description Required. Specifies the name of the sub-folder. Type: String Table Optional. Specifies the Table object or the Unique ID of the Table object that contains the source columns for the subfolders. If specified, one folder for each column is added to the parent folder. Type: Object or String

Return Type
Object

Example
This example adds a new folder to the open catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object

Administration Guide 519

Chapter 55: Methods


Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders objCatFolders.AddFolder "Admin." objImpCat.Close Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Items Collection" (p. 500) "Items Property" (p. 663)

AddItem Method (Use parameter)


Syntax
collection.AddItem(Name, [Use], [Id])

Applies To
Folders Collection Items Collection

Description
Adds a folder item with an associated Expression object to a folder or sub-folder.

Discussion
AddItem requires that the destination folder be valid and that the item name in the destination folder be unique. If the Use parameter is included, the expression type for the value must match the intended use or an error is returned. If the Use parameter is not included, AddItem proceeds as if the Use parameter had a value of 0 (automatic). When the Use parameter has a value of 0, a Boolean expression is interpreted as a condition (2), all other expressions are interpreted as a calculation (1). When the Use parameter has a value of 1, the expression is evaluated as a calculation. When the Use parameter has a value of 2, the expression is evaluated as a Boolean expression. When the Use parameter has a value of 3, the expression is evaluated as a catalog folder prompt. The actual prompt expression is defined using the Append method. When run, the created expression is validated to ensure it contains a single prompt token. Together, AddItem and Append allow simple prompts to be created without the need to code a dialog box. Parameters Name Description Required. Specifies the name of the expression object. Type: String Use Optional. Specifies the type of expression. Type: Integer Use these values: 0 = automatic (default) 1 = calculation 2 = condition 3 = prompt

520 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods Parameters Id Description Optional. Specifies the Unique ID of the FolderItem. The ID has the following format: a 17 character string consisting of two 8 hex-digit (0,1,2,3,4,5,6,7,8,9,a,A,b,B,c,C,d,D,e,E,f,F) numbers (32 bit integers) separated by comma. For example:

Unique ID
AddItem 000012AB,0000f1f2 If the Unique ID is not specified, the method will generate an Id for the new FolderItem. Type: String

Return Type
Object

Example
This example adds a prompt expression to filter data based on a maximum price entered by the user.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Dim objPrompt As Object Dim objPromptFolder As Object Const strCatalogPath = "C:\Cognos\Catalogs\" Const use_prompt = 3 Const token_prompt = 110 Const token_typein = 1 Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog strCatalogPath & "great outdoors" & _ "with prompts.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders 'add prompt folder Set objPromptFolder = objCatFolders.AddFolder _ ("Catalog Prompts") Set objPrompt = objPromptFolder.Items.AddItem _ ("Prompt for the price limit", use_prompt) objPrompt.Value.AppendEx token_prompt, token_typein, _ "What is the maximum price?", 2, 1999.99 objPrompt.Value.Commit objImpCat.Save objImpCat.Close Set objPrompt = Nothing Set objPromptFolder = Nothing Set objPrompt = Nothing Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"AddItem Method (Column parameter)" (p. 522) "Add Catalog Prompts Sample" (p. 711)

Administration Guide 521

Chapter 55: Methods

AddItem Method (Column parameter)


Syntax
collection.Additem([Name], Column [, Id])

Applies To
Folders Collection Items Collection

Description
Adds a folder item with an associated Expression object to a folder or sub-folder.

Discussion
For this operation to succeed, the destination folder must be valid, and the item name must be unique in the destination folder. Parameters Name Description Optional. Specifies the name of the item. If omitted, the name of the column passed as the second parameter is used. Type: String Column Required. Specifies the Column object or the UniqueID Property of that object on which the new folder item is based. Type: Object or String Id Optional. Specifies the UniqueID Property of the FolderItem. The ID has the following format: a 17 character string consisting of two 8 hex-digit (0,1,2,3,4,5,6,7,8,9,a,A,b,B,c,C,d,D,e,E,f,F) numbers (32 bit integers) separated by comma. For example: 000012AB,0000f1f2 If the Unique ID is not specified, the method will generate an Id for the new FolderItem. Type: String

Return Type
Object

Example
This example adds a new Customers folder to the active catalog and then adds a new Order No. column to this folder. The values from an existing ORDER_NO column in the ORDER folder are appended to the new column.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Dim objNewFolder As Object Dim objDB As Object Dim objNewColumnExpression As Object Dim objNewColumn As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\sample.cat", _ "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) Set objCatFolders = objImpCat.Folders Set objNewFolder = objCatFolders("Customers")

522 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


objNewFolder.Items.AddItem("Order No.") Set objNewColumnExpression = objNewColumn.Value objDB.Tables("ORDER").Columns("ORDER_NO") objImpCat.Save Set objNewFolder = Nothing Set objCatFolders = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Items Property" (p. 663) "AddItem Method (Use parameter)" (p. 520)

AddTable Method
Syntax
Application.AddTable [Database] ,[HostCatalog] ,[Schema] ,Table

Applies To
Application Object

Description
Adds a table to the catalog.

Discussion
Use the AddTable method to add new tables to an open catalog. When a database is restructured or updated, or when the name of an existing table is changed, use the AddTable method to keep the catalogs up-to-date. The AddTable method returns a Boolean value (-1=TRUE, 0=FALSE) based on whether the table was added successfully. Do not specify a HostCatalog and a Schema unless the database tables you're accessing can be qualified. See Impromptu Help for more information about qualifying tables. Parameters Database Description Optional. Specifies the logical database name or name of the Hotfile. Type: String HostCatalog Optional. Specifies the name of the Host Catalog. Type: String Schema Optional. Specifies the name of the Schema. Type: String Table Required. Specifies the name of the database table. Type: String

Return Type
Object

Example
This example adds the table Product to the open catalog. This macro will not run if the table name already exists.
Sub Main() Dim objImpApp As Object

Administration Guide 523

Chapter 55: Methods


Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible 1 objImpApp.OpenCatalog "c:\Program Files\cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\Great Outdoors Sales Data.CAT", _ "Creator" objImpApp.AddTable "Outdoors",,,"product" Set objImpApp = Nothing End Sub

AppendEx Method (No Prompt)


Syntax
expression.AppendEx Token [,Info1] [,InfoN]

Applies To
Expression Object

Description
Appends a single token or an entire expression to an existing expression.

Discussion
Use this method to build expressions that are used as calculations, filters, or to define new prompts (prompt folder items). To build expressions, append tokens to the Expression object using the AppendEx method consecutively in a series. The first parameter defines the added token. Some tokens require more than just the first parameter. Refer to the list of parameters in the Token Table for more details. After you append all the necessary tokens, use the Commit method to verify and save your expression. To create a new prompt (except dataset prompts), you must append the prompt token to an empty Expression object. If you append a prompt token to a non-empty expression, an error will occur. (A dataset prompt must be added to a non-empty Expression object.) To use an existing prompt in an expression, append a prompt reference to the expression by using the prompt as the first parameter in the AppendEx method. Use the FormulaEx property to view your current expression.

524 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Notes
Although the Append method is not included in the Impromptu methods list, Impromptu continues to provide backwards compatibility for existing Impromptu 4.0x and 5.0x macros. We recommend that you use the AppendEx method for your new macros. Parameters Token Description Required. Specifies the object, the number value, or unique identification of a Column or a FolderItem object to append. Type: integer, object, or string If the value is an integer, the token is the number that represents the token to add (see the Token Table). If the value is an object, the token must be either a catalog Column object a catalog FolderItem object that is a catalog prompt the tokens from an Expression object that you are appending to the existing expression If the value is a string, the token is the unique identification of a Column or FolderItem object (catalog prompt). If you use Visual Basic, you can define constants and use these constants to replace explicit numerical token Ids to improve code readability. Info1 Optional. Specifies the value you must supply for some tokens (see the Token Table). Type: string, integer, date/time constant If the value is a string, this value represents an alternate name for the Catalog data object (if the first token is a Catalog column object). If the first argument is a token (an integer), this value represents the first piece of additional information required by the tokens (see the Token Table). InfoN Optional. Specifies the nth value you must supply for some tokens. The number of values depends on the token you use. (See the Token Table.)

Return Type
Nothing

Example
This example adds calculation and condition columns to a catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders as Object Dim objNewColumnExpression As Object Dim objNewColumn As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog set objCatFolders = objImpCat.Folders 'Add the calculation column to the Order folder. Set objNewColumn = objCatFolders("Orders").Items _ ("Order Details").Items.AddItem ("Sale Amount", 1) Set objNewColumnExpression = objNewColumn.Value With objNewColumnExpression .AppendEx 100 '( .AppendEx 2, 1 'numeric constant 1 .AppendEx 23 '.AppendEx objCatFolders("Orders").Items _ ("Order Details").Items("Discount %").Value

Administration Guide 525

Chapter 55: Methods


.AppendEx 21 '/ .AppendEx 2, 100 'numeric constant 100 .AppendEx 101 ') .AppendEx 20 '* .AppendEx 100 '( .AppendEx objCatFolders("Orders").Items _ ("Order Details").Items("Order Price").Value .AppendEx 20 '* .AppendEx objCatFolders("Orders").Items _ ("Order Details").Items("Qty").Value .AppendEx 101 ') .Commit End With Set objNewColumnExpression = Nothing Set objNewColumn = Nothing 'Add the closed sale filter to the Conditions subfolder. Set objNewColumn = objCatFolders("Orders").Items _ ("Conditions").Items.AddItem ("Closed Sale", 2) Set objNewColumnExpression = objNewColumn.Value objNewColumnExpression.AppendEx objCatFolders _ ("Orders").Items("Closed Date").Value objNewColumnExpression.AppendEx 36 'is not missing objNewColumnExpression.Commit objImpCat.Save Set objNewColumnExpression = Nothing Set objNewColumn = Nothing Set objCatFolder = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Expression Object" (p. 470)

Token Table
Syntax
expression.AppendEx Token, [Info1] , . . . , [InfoN] Name and average between comma count contains date constant Token ID 32 63 40 102 64 35 3 Info1 none none none none none none A date-time value where the time portion is set to the Visual Basic standard for time (midnight). Type: variant datetime constant default 5 A date-time value. Type: variant 104 none

526 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Name descending distinct divide else equal for function

Token ID 83 82 21 46 24 80 90

Info1 none none none none none none The name of the function to add (case-sensitive). The function name must exist in either the Impromptu function table or the function table of the catalog where the expression resides. Type: string

greater equal greater than if in interval constant

26 25 44 48 6

none none none none Any numeric value or a string formatted as


DD HH:MM:SS.mmm

Since dates are stored as 8-byte floats and subtracting two dates will result in a number, the interval constant can be represented as a number. Type: variant is missing is not missing 33 36 none none none none none none none Returns a moving average by row for a specified set of values of over a specified number of rows. Returns a moving total by row for a specified set of values over a specified number of rows. none none none none

left parenthesis 100 less equal less than like lookup 28 27 37 47

moving-averag 74 e moving-total maximum map minimum minus 75 62 103 61 23

Administration Guide 527

Chapter 55: Methods

Name multiply not not equal null numeric constant or percentile percentage plus prefilter prompt

Token ID 20 30 29 106 2 31 66 67 22 105 110

Info1 none none none none any numeric Type: variant none none none none none A numerical value that represents the type of prompt to be appended to expression. Type: Integer Valid values are 1: Type-in 2: File Picklist 3: Report Picklist 4: Catalog Picklist 5: Dataset The parameters that follow each prompt type is different. For more information on the syntax, see the Prompt Syntax.

rank report right parenthesis rows

65 84 101 85

none none none none Returns a running difference by row, calculated as the difference between the value for the current row and the preceding row, (including the current row) for a set of values. none none none none none none

running-differe 77 nce running total running minimum running maximum running average running count sort by 68 69 70 71 72 81

528 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Name starts with stddev

Token ID 34 73

Info1 none none Anything that can be evaluated as a string. Type: variant Returns the rank of a value as High, Middle, or Low relative to a group of values. none A date-time value where the date portion is set to the Visual Basic standard (1997/12/30). Type: variant none none Returns the variance of selected data items.

string constant 1 tertile then time constant 78 45 4

total userID variance

60 107 79

The token table function Quartile is not available for Impromptu 6.0.

Related Topics
"Add Catalog Prompts Sample" (p. 711) "Expression Object" (p. 470) "Prompt Syntax" (p. 529)

Prompt Syntax
Syntax
expression.AppendEx . . .

Type-in
. . . 110, 1, Message [,DataType] [,DefaultValue] [,DatabaseDataType] [,DatabaseDataSize] [,UseDefaultValue] [ ,Precision] [Scale] [,IsNullAllowed]

File Picklist
. . . 110, 2, Message, File [,DataType] [,SortValues] [,DatabaseDataType] [,DatabaseDataSize] [,UseDefaultValue] [ ,Precision] [,Scale] [,IsNullAllowed][,IsSelectAllAllowed]

Report Picklist
. . . 110, 3, Message, Report[,DataType], Use, UsePosition [,Display] [,DisplayPosition] [,SortValues] [,DatabaseDataType] [,DatabaseDataSize] [,UseDefaultValue] [,Precision] [,Scale], [,IsNullAllowed][,IsSelectAllAllowed]

Administration Guide 529

Chapter 55: Methods

Catalog Picklist
. . . 110 , 4, Message, Use [,Display] [,SortValues] [,DatabaseDataType] [,DatabaseDataSize] [,UseDefaultValue] [,Precision] [,Scale] [,IsNullAllowed][,IsSelectAllAllowed]

Dataset
. . . 110 , 5, Message, Report [,DataType], ColumnName, ColumnPosition [,DatabaseDataType] [,DatabaseDataSize] [,UseDefaultValue] [,Precision] [,Scale], [,IsNullAllowed]

Message Parameter
Required. Specifies the message that you use to prompt the user to enter or select a value. If you leave the message parameter as an empty string, it will have the prompt name string from the catalog location. Type: String

File Parameter
Required. Specifies the fully-qualified file location to an existing text file providing data for the picklist. Type: String

Report Parameter
Required. Specifies the fully-qualified location to the existing, non-active report document file. Type: String

DataType Parameter
Optional. Specifies the data type for the prompt expression. Type: Integer Valid values are 1: String (default) 2: Number 3: Date 4: Time 5: DateTime 6: Interval

DefaultValue Parameter
Optional. Specifies the default value to be used when prompting. The last value that the user typed in remains as the next default value. Type: String, Float or Date (dependent on value for DataType)

Use Parameter (Report Picklist) Parameter


Required. Specifies the existing report query column name for the prompt expression. For example, "[Customer Name]". Type: String

530 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Use Parameter (Catalog Picklist)


Required. Specifies the existing column or folder item in the currently active catalog that you use in the prompt expression for filtering. You can represent the existing folder item as a string, for example, "\Products\Price and Cost\Product Margin", or you can use the unique identification. Type: String or Object

UsePosition Parameter
Required. Specifies the position of the name of the report query column in the selected report. Type: Integer

DisplayParameter (Report Picklist)


Optional. Specifies the name of the existing report query column for display in the prompt picklist. For example, "[Customer Name]". Type: String The default value is dependent on the value of the Use parameter.

DisplayParameter (Catalog Picklist)


Optional. Specifies the existing folder item in the currently active catalog that you use when you display the prompt picklist. You can represent the folder item as a string, for example, "\Products\Price and Cost\Product Margin", or the unique identification of the column or folder item. Type: String or object The default value is dependent on the value of the Use parameter.

DisplayPosition Parameter
Required with Display parameter. Specifies the position of the name of the display query column in the selected report. Type: Integer If the Display parameter is empty, the default value depends on the value of the UsePosition parameter.

ColumnName Parameter
Required. Specifies the existing report column, for example "Customer Name", for the dataset that holds the expression. Type: String

ColumnPosition Parameter
Required. Specifies the position of the dataset column in the report that you selected. Type: Integer

SortValues Parameter
Optional. Specifies whether the list of values to pick are sorted. Type: Boolean Default: True

DatabaseDataType Parameter
(Optional) Specifies the Database data type. Type: Integer Valid values are

Administration Guide 531

Chapter 55: Methods 0: sqlUnknownType (the value is set based on the default values below) 1: sqlChar 2: sqlVarChar 3: sqlLongVarChar 4: sqlSmallInteger 5: sqlInteger 6: sqlDecimal 7: sqlFloat 8: sqlDouble 11: sqlQuad 12: sqlDate 13: sqlTime 14: sqlDateTime 15: sqlInterval The default value is dependent on the value of the DataType parameter.

DatabaseDataSize Parameter
(Optional) Specifies the Database data size, which is dependent on the value of the DatabaseDataType parameter. Type: Integer Valid values are sqlChar: 1 to 65535 (default: 256) sqlVarChar: 2 to 4096 (default: 4096) sqlLongVarChar: 4 to 65535 (default: 65535) sqlDecimal: 1 to 20 (default:6) sqlSmallInteger: 2 sqlInteger, sqlFloat, sqlDate, sqlTime, sqlInterval: 4 sqlDouble, sqlQuad, sqlDateTime: 8

UseDefaultValue Parameter
(Optional) Specifies a boolean value (True or False) depending on whether you want to use the default value. The default is False. Type: Boolean

Precision Parameter
(Optional) Specifies the number of digits for numeric DatabaseDataType, which are dependent on the value of the DatabaseDataType parameter. Type: Integer Valid values are sqlChar, sqlVarChar, sqlLongVarChar: 1 to 32767 (Default: 0) sqlSmallInteger: 1 to 4 (Default: 4) sqlInteger: 1 to 9 (Default: 9) sqlDecimal: 1 to 38 (Default: 12) sqlFloat: 1 to 6 (Default: 6) sqlDouble: 1 to 15 (Default: 15) sqlQuad: 1 to 19 (Default: 15) |sqlDate: 1 to 8 (Default: 0) sqlTime: 1 to 9 (Default: 0) sqlDateTime, sqlInterval: 1 to 17 (Default: 0) Scale Parameter (Optional) Specifies the number of digits after the decimal place from -32768 to 32767. The default value is 0. Type: Integer

532 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

IsNullAllowed Parameter
(Optional) Specifies whether a null value is permitted. Type: Integer Valid values are 0 = False (default) Any Integer (Positive or Negative) = True

IsSelectAllAllowed Parameter
(Optional) Specifies whether select all is enabled for a prompt. Type: Integer Valid values are 0 = False (default) Any Integer (Positive or Negative) = True

Related Topics
"Add Catalog Prompts Sample" (p. 711) "Expression Object" (p. 470)

ApplyTemplate Method
Syntax
ReportDocument.ApplyTemplate Template

Applies To
ReportDocument Object

Description
Applies a template to the specified report document for report formatting.

Discussion
Templates can control the look and content of a report by applying calculations and conditionals to the data items in the report. Use ApplyTemplate to apply standard filters to a report or to provide a standard look to sets of reports. Parameters Template Description Required. Specifies the name of the template. Type: String

Return Type
Nothing

Example
This example applies either an invoice template or a check template, based on the values returned in the report. The report returns a single value, the current balance owed to or owed by the customer. Depending on whether the balance is negative or positive, either a check or an invoice is printed.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim intTotalSales As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.OpenReport _

Administration Guide 533

Chapter 55: Methods


("c:\imp\workspce\custbal.imr") objImpRep.RetrieveAll intTotalSales = objImpRep.GetDataValue(1,1) If intTotalSales < 0 Then 'negative value=credit objImpRep.ApplyTemplate "c:\imp\workspce\check.imt" ElseIf intTotalSales > 0 Then 'positive value=balance owing objImpRep.ApplyTemplate "c:\imp\workspce\invoice.imt" End If objImpRep.Print Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ChangeUserClass Method
Syntax
Application.ChangeUserClass ClassName [,ClassPassword] [,DataBaseUserID] [,DataBasePassword] [,ConnectToDatabase]

Applies To
Application Object

Description
Changes the current user class.

Discussion
Use the ChangeUserClass method to change the current user class for the catalog. Changing the user class changes the catalog settings for things such as the accessible tables and folders, and the report governor settings. The ChangeUserClass method returns a Boolean value based on whether the user class was successfully changed. A value of 0 (FALSE) indicates that the change did not occur successfully. A value of -1 (TRUE) indicates that the change did occur successfully. When the IBM Cognos Scheduler executes a macro that runs an Impromptu report, the Scheduler passes Impromptu all security information required by both Impromptu and the database. Parameters ClassName Description Required. Specifies the name of the user class. Type: String ClassPassword Optional. Specifies a password for the user class. Type: String DataBaseUserID Optional. Specifies the database user ID for the user class connection. Type: String DataBasePassword Optional. Specifies the database password for the user class connection. Type: String ConnectToDatabase Optional. Specifies whether to automatically connect the catalog to the database. Use TRUE (-1) to auatomatically attach the catalog to to the database. Type: Boolean

Return Type
Boolean 534 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Example
This example changes the active user class of the open catalog. In this case, the name of the userclass is ManagementUser. To run this macro, first open a catalog.
Sub Main() Dim objImpApp As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.ChangeUserClass "ManagementUser" Set objImpApp = Nothing End Sub

Clear Method
Syntax
Expression.Clear

Applies To
Expression Object

Description
Empties the expression.

Discussion
This method clears the current expression so a new one can be built.

Return Type
Nothing

Example
This example empties the Product Margin calculation expression and then replaces this expression with a different calculation.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Dim objCatColumn As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders Set objCatColumn = objCatFolders("Products").Items _ ("Product Margin") objCatColumn.Clear objCatColumn.AppendEx objCatFolders("Products").Items _ ("Product Price").Value objCatColumn.AppendEx 23 'objCatColumn.AppendEx objCatFolders("Products").Items _ ("Product Cost").Value objCatColumn.Commit Set objCatColumn = Nothing Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Administration Guide 535

Chapter 55: Methods

ClearTOCColumns Method
Syntax
PublishHTML.ClearTOCColumns

Applies To
PublishHTML Object

Description
Removes all columns from the HTML Report Navigator.

Return Type
Nothing

Close Method
Syntax
Catalog.Close

Applies To
Catalog Object

Description
Closes the active catalog and saves any changes.

Discussion
Use this method to close the active catalog. This method automatically saves all changes to the catalog and closes any open reports belonging to the catalog.

Return Type
Nothing

Example
This example opens a catalog, makes it active, and then closes it.
Sub Main() Dim objImpApp As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", "OUTDOORS" objImpApp.ActiveCatalog.Close objImpApp.Quit Set objImpApp=Nothing End Sub

CloseCatalog Method
Syntax
Application.CloseCatalog

Applies To
Application Object

Description
Closes the active catalog and the associated reports.

536 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Discussion
Use the CloseCatalog method to close the current catalog and associated reports before opening either a new catalog or a report that's based on another catalog. When this method is executed, all changes to the catalog are saved. The return value is True if the catalog is closed successfully.

Return Type
Boolean

Example
This example adds a new folder to the open catalog and then closes the catalog. In this case, the example saves the changes made to the catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders objCatFolders.AddFolder "Admin." objImpCat.Save objImpApp.CloseCatalog Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CloseReport Method
Syntax
ReportDocument.CloseReport

Applies To
ReportDocument Object

Description
Closes the specified ReportDocument object.

Discussion
Use the CloseReport method to close the active report. Unlike its interactive equivalent (choosing Close from the File menu), the CloseReport method does not prompt for a save if there are outstanding changes. Use the Modified Property to determine whether the report should be saved before closing it. If the report has outstanding changes, use the Save Method (Reports) to save it.

Return Type
Nothing

Example
This example checks to see if the current report was modified. If the report was modified, the macro saves it before closing it. If the report was not modified, the macro closes it.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument If objImpRep.Modified = 0 then objImpRep.CloseReport Else objImpRep.Save

Administration Guide 537

Chapter 55: Methods


objImpRep.CloseReport End If Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Commit Method
Syntax
Expression.Commit

Applies To
Expression Object

Description
Signals the user has completed all changes using the AppendEx and Clear Methods.

Discussion
If the syntax is invalid, an error is caused and changes made after the last Commit are discarded. The maximum size of the expression is 32K.

Return Type
Nothing

Example
This example uses the AppendEx method statements to add calculation and condition expressions to a catalog and then saves the changes.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Dim objNewColumnExpression As Object Dim objNewColumn As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\" & _ "Great Outdoors Sales Data.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders Set objNewColumn = objCatFolders("Orders").Items _ ("Order Details").Items.AddItem("Sale Amount New", 1) Set objNewColumnExpression = objNewColumn.Value With objNewColumnExpression .AppendEx 100 '( .AppendEx 2, 1 'numeric constant 1 .AppendEx 23 '.AppendEx objCatFolders("Orders").Items("Order Details").Items _ ("Discount %").Value .AppendEx 21 '/ .AppendEx 2, 100 'numeric constant 100 .AppendEx 101 ') .AppendEx 20 '* .AppendEx 100 '( .AppendEx objCatFolders("Orders").Items _ ("Order Details").Items("Order Price").Value .AppendEx 20 '* .AppendEx objCatFolders("Orders").Items _ ("Order Details").Items("Qty").Value .AppendEx 101 ') .Commit End With Set objNewColumn = Nothing

538 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


Set objNewColumnExpression = Nothing Set objNewColumn = objCatFolders("Orders").Items _ ("Conditions").Items.AddItem("Closed Sale New", 2) Set objNewColumnExpression = objNewColumn.Value objNewColumnExpression.AppendEx objCatFolders("Orders").Items _ ("Closed Date").Value objNewColumnExpression.AppendEx 36 'is not missing objNewColumnExpression.Commit objImpCat.Save Set objNewColumnExpression = Nothing Set objNewColumn = Nothing Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

ConnectDatabase Method
Syntax
Application.ConnectDatabase [DatabaseUserID ,DatabasePassword]

Applies To
Application Object

Description
Attaches to the database for the specified catalog.

Discussion
Use the ConnectDatabase method to connect to the database for a catalog. Returns a Boolean value based on whether the database was connected successfully. A return value of 0 (FALSE) indicates that the database did not connect successfully. A value of -1 (TRUE) indicates that the connection was successful. Not all of the databases that Impromptu supports require passwords. You can specify database user IDs and passwords for the following: Informix InterBase MDI Database Gateway NET-Gateway ODBC (some odbc drivers) OmniSQL Server Oracle SQLBase Sybase SQL Server Sybase Sybase System 10 When the IBM Cognos Scheduler executes a macro that runs an Impromptu report, Scheduler passes Impromptu all security information required by both Impromptu and the database. Parameters DataBaseUserID Description Optional. Specifies the database user ID for the user class connection. Type: String DataBasePassword Optional. Specifies the database password for the user class connection. Type: String

Administration Guide 539

Chapter 55: Methods

Return Type
Nothing

CopySpecialToClipboard Method
Syntax
ReportDocument.CopySpecialToClipboard [CopyImage] [,StartRow] [,EndRow]

Applies To
ReportDocument Object

Description
Copies selected report objects from the specified ReportDocument object to the Clipboard for use in object linking.

Discussion
Use the CopySpecialToClipboard method to copy either a report image or the current query data to the Clipboard when you want to link the copied object into another application. With no parameters specified, the CopySpecialToClipboard method copies the current report image to the Clipboard. Use the OLE automation methods of target application to paste the report image into the target application. The CopySpecialToClipboard method always returns a Boolean value of 0 (FALSE) regardless of whether the selected objects were successfully copied to the Clipboard. The standard method of copying the report image is like this:
objImpRep.CopySpecialToClipboard

To copy the first three row of report data, it would look like this:
objImpRep.CopySpecialToClipboard 0,1,3

If you want to capture the retorn value, use something like this:
Ret# = objImpRep.CopySpecialToClipboard(0)

Once the image is successfully copied to the Clipboard, use automation methods for other active objects in other applications to paste link the report image. For example, to paste the report into a Microsoft Word document, create a Visual Basic OLE object and then use Word's EditPasteSpecial statement to paste link the report image into a document or a line of code like this: SendKeys "^V" '<CTRL> + V Note: Before using the CopySpecialToClipboard method, save the current report to disk. If you attempt to perform a paste special in another application before the report is saved, OLE will fail to resolve the link because no physical file exists. Parameters CopyImage Description Optional. Specifies whether to copy the report image or the report data. Use: TRUE (-1) to copy the report image. FALSE (0) to copy the report data. The default value is (-1). Type: Boolean StartRow Optional. Specifies the first row number of the copy range in the report query, if CopyImage is set to 0. The default value is 1 (the first row number in the query). Type: Integer

540 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Parameters EndRow

Description Optional. Specifies the last row number of the copy range in the report query, if CopyImage is set to 0. The default value is the last row number in the report query.

Return Type
Nothing

Example
This example copies three rows of data from the active report to the clipboard.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.CopySpecialToClipboard 0, 2, 4 Set objImpRep = Nothing Set objImpApp = Nothing End Sub

CopyTo Method
Syntax
FolderItem.CopyTo(DestinationFolder)

Applies To
FolderItem Object

Description
Copies the folder to the destination folder.

Discussion
The destination folder must exist for the command to succeed. Parameters DestinationFolder Description Required. Specifies the new location of the FolderItem Type: Object

Return Type
Object

Example
This example adds a new Admin folder to the catalog and copies all the existing catalog folders to it.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders as Object Dim intx As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateCatalog "C:\Catalogs\Sample.cat", "OUTDOORS" Set objImpCat = objImpApp.ActiveCatalog set objCatFolders = objImpCat.Folders objImpCat.Description = "Great Outdoors Sales Data" & _ "Sample"

Administration Guide 541

Chapter 55: Methods


objCatFolders.AddFolder "Admin." For intx = 1 To 8 objCatFolders(intx).CopyTo objCatFolders("Admin.") Next intx objImpCat.Close Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CopyToClipboard Method
Syntax
ReportDocument.CopyToClipboard

Applies To
ReportDocument Object

Description
Copies selected text or pictures from the specified report to the Clipboard.

Discussion
Use the CopyToClipboard method to copy information from a text frame or a picture frame in a report to the Clipboard. Only selected text values and bitmaps in picture frames can be copied to the Clipboard using the CopyToClipboard method. If you attempt to copy any other type of report object (an entire list frame, for example), no copy is performed. The CopyToClipboard method always returns a Boolean value of 0 (FALSE) regardless of whether the selected objects were successfully copied to the Clipboard.

Return Type
Nothing

Example
This example copies the selected text of the active report to the Clipboard.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strSelectedText As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strSelectedText = objImpRep.GetSelectedText objImpRep.CopyToClipboard Set objImpRep = Nothing Set objImpApp = Nothing End Sub

CreateAlias Method
Syntax
Table.CreateAlias(AliasName)

Applies To
Table Object

Description
Creates a copy of a Table object with an alternative name.

542 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Discussion
The CreateAlias method will fail if a Table object is already using the name you supplied in the AliasName parameter. It will also fail if the Table object used is already an alias. Parameters AliasName Description Required. Specifies the name of the alias. Type: String

Return Type
Object

Example
The following example creates an alias table for the BRANCH table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("BRANCH").CreateAlias "BRANCH ALIAS" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CreateCatalog Method
Syntax
Application.CreateCatalog(Name,Database,[CatalogType], [DatabaseUserID], [DatabasePassword])

Applies To
Application Object

Description
Creates a new catalog with default included tables and a default user profile.

Discussion
If successful, the new catalog becomes the active one and the method returns True. The operation will fail if another catalog is open, because only one catalog can be open at a time. By default, CreateCatalog does not create table joins. CreateCatalog duplicates the functionality of the New Catalog dialog when the "add all tables" option is used by including all the tables and columns for those tables as described in the database. In addition, it creates at least one default user profile of "creator" with all access and read/write to the catalog allowed initially. The number of profiles created is dependent on the Catalog Type created. See the Impromptu Help entry "Create a New Catalog" for other user profile implications. Parameters Name Description Required. Specifies the name of the new catalog. Type: String Administration Guide 543

Chapter 55: Methods Parameters Database Description Required. Specifies the name of the database that the catalog uses. Type: String CatalogType Optional. Specifies an integer representing the type of catalog. Type: Integer Valid values are 0 - Personal (default) 1 - Shared 2 - Distributed 3 - Secure DatabaseUserID Optional. Specifies the database user ID for the user class connection. Type: String DatabasePassword Optional. Specifies the database password for the user class connection. Type: String

Return Type
Boolean

Example
This example creates a catalog GO Sample based on data in the OUTDOORS database.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders as Object Dim intx As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateCatalog "GO Sample.cat", "OUTDOORS" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders objImpCat.Description = "Great Outdoors Sales Data" & _ "Sample" objCatFolders.AddFolder "Admin." For intx = 1 To 8 objCatFolders(intx).CopyTo objCatFolders("Admin.") Next intx objCatFolders("Customer").Items("Customer").CopyTo _ objCatFolders("Order") objImpCat.Close Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CreateEmptyCatalog Method
Syntax
Application.CreateEmptyCatalog(Name, [CatalogType])

Applies To
Application Object

544 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Description
Creates a new empty catalog.

Discussion
If successful the new catalog becomes the active one and the method returns True. CreateEmptyCatalog creates a catalog with no folders, tables, user classes, or other objects. You need to use other methods to add contents to the catalog. Parameters Name Description Required. Specifies the name of the new catalog. Type: String Catalog Type Optional. Specifies the type of catalog. Type: Integer Valid values are 0 =Personal (default) 1 =Shared 2 =Distributed 3 =Secure

Return Type
Boolean

Example
This example creates an empty catalog, gives it a description, attaches it to a database, and adds one table to it.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateEmptyCatalog "c:\temp\samp.cat" Set objImpCat = objImpApp.ActiveCatalog objImpCat.Description = "Great Outdoors Sales Data" objImpCat.Databases.Add("OUTDOORS") objImpCat.Databases(1).Tables.Add("BRANCH") objImpCat.Save Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CreateFilterFor Method
Syntax
UserClass.CreateFilterFor(ObjectToBeFiltered)

Applies To
UserClass Object

Description
Creates a new filter for the specified object and returns the filter for further modification.

Administration Guide 545

Chapter 55: Methods

Discussion
All objects passed as arguments to this method are added to the FilteredColumns or FilteredTables collections. This method must be used before the filter expression can be set. Use the GetFilterFor method to determine the filter created by this method. An error occurs when the parameter is not a Column or Table object. Parameters ObjectToBeFiltered Description Required. Specifies the filter object, either a Column or Table for the user class. Type: Object

Return Type
Object

Example
This example creates a filter for a user class that retrieves all entries but CAN in the COUNTRY column of the COUNTRY table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as object Dim objUser As Object Dim objFilter As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) Set objFilter = objUser.CreateFilterFor _ (objDB.Tables("COUNTRY").Columns("COUNTRY")) With objFilter .AppendEx objDB.Tables("COUNTRY").Columns("COUNTRY") .AppendEx 29 '<> .AppendEx 1, "CAN" 'string constant .Commit End With ObjImpCat.Save Set objDB = Nothing Set objUser = Nothing Set objFilter = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CreateSnapshot Method
Syntax
ReportDocument.CreateSnapshot

Applies To
ReportDocument Object

Description
Creates a snapshot for the specified report.

546 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Discussion
Use the CreateSnapshot method to create a local copy of the data from the database on a PC. This is useful when direct database access is inconvenient or impossible, such as when you're going to be away from the office or when network traffic is heavy. By creating a snapshot, you create a local version of the data in the database on your PC.

Return Type
Nothing

Example
This example creates a snapshot of the active report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.CreateSnapshot Set objImpRep = Nothing Set objImpApp = Nothing End Sub

CreateStoredProcedure Method
Syntax
Application.CreateStoredProcedure

Applies To
Application Object

Description
Creates a stored procedure object that you can use to define and execute a database stored procedure.

Discussion
Use the CreateStoredProcedure method to create an OLE object to define and execute database-stored procedures. This enables you to create an object that provides a common interface to database-stored procedures in different databases and on different platforms. Once you've created a stored procedure object, use the SetProcedure Method and the Execute Method to define and execute the specific stored procedure. For the current list of supported databases, visit the Cognos Software Services Web site (http://support.cognos.com).

Return Type
Nothing

DatabaseConnected Method
Syntax
Application.DatabaseConnected

Applies To
Application Object

Administration Guide 547

Chapter 55: Methods

Description
Returns a Boolean value based on whether the catalog is connected to its database. If the database is connected, the DatabaseConnected method returns -1 (TRUE). Otherwise, the DatabaseConnected method returns 0 (FALSE).

Return Type
Boolean

Delete Method
Syntax
object.Delete

Applies To
Database Object CatalogLevel Object SchemaLevel Object Table Object Column Object FolderItem Object TableLink Object UserClass Object

Description
Deletes an object from the ownership collection to which it belongs.

Discussion
The Delete method removes the object permanently from the ownership collection and destroys the object. To bring the object back, you must recreate the object using the Add method.

Return Type
Nothing

Example
This example deletes the Order folder from the active catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog objImpCat.Folders("Order").Delete Set objImpCat = Nothing Set objImpApp = Nothing End Sub

DisconnectDatabase Method
Syntax
Application.DisconnectDatabase

Applies To
Application Object 548 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Description
Disconnects from the catalog from the database.

Discussion
Use the DisconnectDatabase method to allow operations on the catalog itself, such as changing the folders or modifying the database definition for the catalog.

Return Type
Nothing

DistributedUpdate Method
Syntax
Catalog.DistributedUpdate

Applies To
Catalog Object

Description
Performs Catalog update against the master Catalog.

Discussion
Use to synchronize a personal copy of a distributed master catalog with the master catalog. An error will be returned if the master catalog cannot be found, or if the catalog is not of the type Distributed.

Return Type
Nothing

Example
This example changes a distributed catalog to reflect changes made to the master catalog. To run this macro, you must first open a distributed catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog objImpCat.DistributedUpdate Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Execute Method
Syntax
StoredProcedure.Execute [Input] [,Input]...[Output] [,Output]... [ReturnValue]

Applies To
StoredProcedure Object

Description
Executes a database-stored procedure.

Administration Guide 549

Chapter 55: Methods

Discussion
Use the Execute method to execute a database-stored procedure that you've set up using the CreateStoredProcedure method. When you execute a stored procedure, you can: pass parameters to it. return parameters from it. return the value that's calculated by the stored procedure. The Execute method returns a variant value containing the status for the stored procedure. Parameters Input Description Optional. Specifies an input parameter for the stored procedure. Type: Variant Output Optional. Specifies an output parameter for the stored procedure. Type: Variant ReturnValue Optional. Specifies the returned value for the stored procedure. Type: Variant

Return Type
Nothing

Export Method
Syntax
object.Export FileName ExportFilter

Applies To
ReportDocument Object

Description
Saves the active report in a format that's usable by other applications.

Discussion
Use the Export method to save a report in a format that can be used by another application. When you use the Export method to export in ASCII format, Impromptu assigns default values to the ASCII export parameters. Parameters FileName Description Required. Specifies the name of the new file. Type: String

550 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods Parameters ExportFilter Description Required. Specifies the file name of the application export filter. Type: String Acceptable values for the ExportFilter are: x_ascii.flt = ASCII x_dbase.flt = dBASE x_excel.flt = Excel x_dat.flt = PowerPlay x_sql.flt = SQL x_text.flt = Text x_iqd.flt = PowerPlay, Transformer

Return Type
Nothing

Example
This example exports the active report as an ASCII file. The new file will have the same name as the active report with an ASCII file extension (.csv). To run this macro, you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4) objImpRep.Export strFileName & ".csv", "x_ascii.flt" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ExportASCII Method
Syntax
ReportDocument.ExportASCII FileName [,IncludeHeader] [,UseQuotes] [,Delimiter] [,EOL]

Applies To
ReportDocument Object

Description
Exports the specified ReportDocument object as a delimited ASCII file (CSV).

Discussion
Use the ExportASCII method to save a report as a delimited ASCII file. You can then use the contents of the ASCII file in other applications that read and use ASCII files. Parameters FileName Description Required. Specifies the name of the new ASCII file. Type: String

Administration Guide 551

Chapter 55: Methods Parameters IncludeHeader Description Optional. Specifies whether to include the report header. Type: Boolean TRUE (-1) = includes the report header (default). FALSE (0) = omits the report header. UseQuotes Optional. Specifies whether data items are enclosed in quotes. TRUE (-1) = encloses data items in quotes. FALSE (0) = omits the quotes. Type: Boolean Delimiter Optional. Specifies delimiter to separate data items. The default delimiter is a comma. Type: String EOL Optional. Specifies the end of line character for the exported file. The following are acceptable values for EOL: 0 = Carriage Return+Line Feed (default) 1 = Line Feed+Carriage Return 2 = Carriage Return 3 = Line Feed Type: Integer

Return Type
Nothing

Example
This example exports the active report as an ASCII file. The new file will have the same name as the active report with an ASCII file extension (.csv). To run this macro, you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") 'Open Impromptu catalog objImpApp.OpenCatalog _ "c:\Program Files\Cognos\<rendition_id>\samples\Impromptu\" & _ "additional reports\gosales.cat","Systems",,,,1 'Open the report that will be exported to text format Set objImpRep = objImpApp.OpenReport _ ("c:\Program Files\Cognos\<rendition_id>\samples\Impromptu\" & _ "additional reports\currency.imr") Set objImpRep = objImpApp.ActiveDocument strFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4) objImpRep.ExportAscii strFileName & ".csv" , ,-1, , , Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ExportData Method
Syntax
ReportDocument.ExportData FileName

552 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Applies To
ReportDocument Object

Description
Exports the specified ReportDocument object as a PowerPlay data file (DAT).

Discussion
Use the ExportData method to save a report as a PowerPlay data definition file. Once you've saved a report as a PowerPlay file, you can use PowerPlay to perform drill-down operations on the data contained in the file. Parameters FileName Description Required. Specifies the name of the new PowerPlay file. Type: String

Return Type
Nothing

Example
This example exports the active report as a PowerPlay data file. The new file will have the same name as the active report with a PowerPlay data file extension (.dat). To run this macro, you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strPPFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strPPFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4) objImpRep.ExportData strPPFileName & ".dat" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ExportdBASE Method
Syntax
ReportDocument.ExportdBASE FileName

Applies To
ReportDocument Object

Description
Exports the specified ReportDocument object as a dBASE file (.dbf).

Discussion
Use the ExportdBASE method to save Impromptu reports as dBASE files. This allows you to create new views of the data in existing dBASE files and save them permanently as new dBASE files. Parameters FileName Description Required. Specifies the name of the new dBASE file. Type: String

Administration Guide 553

Chapter 55: Methods

Return Type
Nothing

Example
This example exports the active report as a dBASE file. The new file will have the same name as the active report with a dBase file extension (.dbf). To run this macro, you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strdBaseFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strdBaseFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4) objImpRep.ExportdBase strdBaseFileName & ".dbf" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ExportExcelWithFormat Method
Syntax
ReportDocument.ExportExcelWithFormat FileName

Applies To
ReportDocument Object

Description
Exports the specified ReportDocument object as a Microsoft Excel file (.xls).

Discussion
Use the ExportExcelWithFormat method to save a report, with format characteristics, in a file format that's usable by Microsoft Excel. Use reports saved in Microsoft Excel format, as you would any other Microsoft Excel file. You can also use IBM CognosScript's OLE automation capabilities to invoke Microsoft Excel and perform operations on the files you've created. Parameters FileName Description Required. Specifies the location, name and extension of the new Microsoft Excel file. Type: String

Return Type
Nothing

Example
This example exports the active report as a Microsoft Excel file. The new file will have the same name as the active report with an Microsoft Excel file extension (.xls). To run this macro, you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strExcelFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strExcelFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4)

554 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


objImpRep.ExportExcelWithFormat strExcelFileName & ".xls" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ExportHotFile Method
Syntax
ReportDocument.ExportHotFile FileName

Applies To
ReportDocument Object

Description
Exports the specified ReportDocument object as an Impromptu HotFile (IMS).

Discussion
Use the ExportHotFile method to save a report as an Impromptu HotFile. This is particularly useful for setting up access to information from multiple, heterogeneous databases. For example, you could use the IBM Cognos Scheduler to execute macros that build HotFiles from several different databases overnight. Once the Hotfiles are created, you can use them to create reports containing information from all of the source databases. Parameters FileName Description Required. Specifies the name, location and extension of the new HotFile. Type: String

Return Type
Nothing

Example
This example exports the active report as a Hotfile. The new file will have the same name as the active report with a Hotfile file extension (.ims). To run this macro, you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strHotFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strHotFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4) objImpRep.ExportHotFile strHotFileName & ".ims" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ExportSQL Method
Syntax
ReportDocument.ExportSQL FileName

Applies To
ReportDocument Object

Administration Guide 555

Chapter 55: Methods

Description
Exports the current query as a Structured Query Language file (SQL).

Discussion
You can use the SQL statements that Impromptu generates in other database query applications that support SQL. Note: Impromptu uses application-specific SQL when processing occurs on the PC. If you intend to use Impromptu's SQL statements in other applications, you can ensure that generated SQL statements are portable by setting all processing to occur on the server. See Adjust the Client/Server Balance in the Impromptu Admin online help. Parameters FileName Description Required. Specifies the name of the new SQL file. Type: String

Return Type
Nothing

Example
This example exports the active report as a SQL file. The new file will have the same name as the active report with an SQL file extension (.sql). To run this macro, first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strSQLFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strSQLFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4) objImpRep.ExportSQL strSQLFileName & ".sql" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ExportText Method
Syntax
ReportDocument.ExportText FileName

Applies To
ReportDocument Object

Description
Exports the specified ReportDocument object as a Text file (.txt).

Discussion
Use the ExportText method to save the data in a report as a text file. Impromptu automatically includes header information in the text file, and it aligns data values under the appropriate item name in the header. You can then use the contents of the text file in other applications. Parameters FileName Description Required. Specifies the name of the new Text file. Type: String

556 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Return Type
Nothing

Example
This example exports the active report as a Text file. The new file will have the same name as the active report with a Text file extension (.txt). To run this macro, you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strTextFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strTextFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4) objImpRep.ExportText strTextFileName & ".txt" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ExportTransformer Method
Syntax
ReportDocument.ExportTransformer FileName

Applies To
ReportDocument Object

Description
Exports the active report as a PowerPlay Transformer file (IQD).

Discussion
Use the ExportTransformer method to save a report for use with PowerPlay Transformer. PowerPlay Transformer can read the IQD file and transform it into files that can be used in PowerPlay Explorer and PowerPlay Reporter. Parameters FileName Description Required. Specifies the name of the new PowerPlay Transformer file. Type: Sting

Return Type
Nothing

Example
This example exports the active report as a Transformer file. The new file will have the same name as the active report with a Transformer file extension (.iqd). To run this macro, you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strIQDFileName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strIQDFileName = Left$(objImpRep.FullName, Len _ (objImpRep.FullName) - 4) objImpRep.ExportTransformer strIQDFileName & ".iqd" Set objImpRep = Nothing Set objImpApp = Nothing

Administration Guide 557

Chapter 55: Methods


End Sub

FileSetPrinter Method
Syntax
Application.FileSetPrinter PrinterName

Applies To
Application Object

Description
Sets the default printer for Impromptu reports.

Discussion
Use the FileSetPrinter method to change the printer that Impromptu uses when printing reports. For example, you can use the FileSetPrinter method to print a single report on multiple printers, each of which is located in a different area of your company. Make sure that the value you specify for PrinterName matches exactly (including the case) the device name that's listed in the [Devices] section of the WIN.INI file. In general, this should be the name of the printer as it's displayed in Print Manager, up to but not including the "on <port number>" qualifier. For example, if you see the following printer description in Print Manager:
HP LaserJet 4Si/4SiMX PS 300dpi on LPT1 [\\OTRS1\OTR6C1]

To select this printer in a macro, enter for PrinterName as:


HP LaserJet 4Si/4SiMX PS 300dpi

Parameters PrinterName

Description Required. Specifies the name of the printer (as displayed in Print Manager without the connection suffix on <connection>) that Impromptu uses when printing reports. Note: PrinterName must match exactly the strings that are registered in the WIN.INI file under the [Devices] section. PrinterName is case-sensitive. For example, the string "Postscript Printer" does not match "PostScript Printer". Type: String

Return Type
Nothing

Example
This example prints the Impromptu report to a specific printer and then changes the printer setting.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.FileSetPrinter "HP LaserJet 5P/5MP PostScript" Set objImpRep = objImpApp.OpenReport("C:\Program Files\" & _ "Cognos\<rendition_id>\Samples\Impromptu\Reports\" & _ "All Country Sales.imr") objImpRep.Print objImpApp.FileSetPrinter "HP LaserJet 4Si/4SiMX PS" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

558 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

GenerateReport Method
Syntax
Application.GenerateReport Catalog ,DataBase ,[HostDatabase] ,[DatabaseOwner] ,Table ,Template ,[ReportName] ,[UserClassID] ,[UserClassPassword] ,[DatabaseID] ,[DatabasePassword]

Applies To
Application Object

Description
Automatically creates, formats, and saves an Impromptu report for a specific table in a database, or a HotFile.

Discussion
Use the GenerateReport method to automatically create reports for entire tables in both databases and HotFiles. Because GenerateReport can use tables from both HotFiles and databases, it can automatically gather information from multiple databases and servers into a single report. When the IBM Cognos Scheduler executes a macro that runs an Impromptu report, the Scheduler passes Impromptu all security information required by both Impromptu and the database. Parameters Catalog Description Required. Specifies the name of the catalog containing the table for used for the new report. Type: String DataBase Required. Specifies the logical database name or the HotFile name containing the table used for the new report. Type: String HostDatabase Optional. Specifies the name of the database containing the DatabaseOwner and Table used for the new report. Required for databases that support multiple databases on a single server. Type: String DatabaseOwner Optional. Specifies the database owner name. Required for databases that support owners. Type: String Table Required. Specifies the name of the table used for the new report. Type: String Template Required. Specifies the name and location of a template used to apply formatting to the new report. Type: String ReportName Optional. Specifies a file name for the new report. If no ReportName is specified, Impromptu assigns a name. UserClassID Optional. Specifies the UserClass name. Required only if the catalog is not open. Type: String

Administration Guide 559

Chapter 55: Methods Parameters UserClassPassword Description Optional. Specifies the password for the UserClass. Required only if the catalog is not open. Type: String DatabaseID Optional. Specifies the database didentification. Required only if the catalog is not open and the database supports multiple users. Type: String DatabasePassword Optional. Specifies the database password. Required only if the catalog is not open and the database supports multiple users. Type: String

Return Type
Nothing

Example
This example creates, formats, and saves a new report based on the BRANCH table in the Outdoors Sales Data catalog.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Const catalog = "C:\Program Files\Cognos\" & _ "\<rendition_id>\samples\Impromptu\Reports\" & _ "Great Outdoors Sales Data.CAT" Const database = "OUTDOORS" Const table = "BRANCH" Const template = "C:\Program Files\Cognos\" & _ "\<rendition_id>\samples\Impromptu\Templates\" & _ "Standard\Simple List.imt" Const report = "C:\Program Files\Cognos\" & _ "\<rendition_id>\samples\Impromptu\Reports\branch.imr" Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.GenerateReport catalog, database, , , table, _ template, report objImpApp.CloseCatalog objImpApp.Quit Set objImpRep = Nothing Set objImpApp = Nothing End Sub

GetAppVersionInfo Method
Syntax
Application.GetAppVersionInfo([Major,[Minor,[Build,[Services]]]])

Applies To
Application Object

Description
Returns version information for Impromptu applications.

Discussion
Use this method to retrieve version information about an Impromptu application. Each parameter adds a level of detail to the information returned major release minor release

560 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods build service

When using parameters, each must be a defined variable, not a hard-coded integer or string, and you must include them from left to right. For example, you can't include Services without also including Major, Minor and Build. When no parameters are included, an integer value representing Major, Minor and Build is returned by default. In this case, if the Build value includes a decimal, it will be lost. The following example returns all version information:
Dim Version As Long Dim Major As String, Minor As String, Build as String, Services As String Version = ImpApp.GetAppVersionInfo(Major, Minor, Build, Services)

The returned information looks something like this: Major = 5 Minor = 1 Build = 133 Services = R97K This translates into version 5.1, build 133, DMS service R97K. Parameters Major Description Optional: Specifies the major version number. Type: Long, Integer or String Minor Optional: Specifies the minor version number. Type: Long, Integer or String Build Optional: Specifies the build number. Type: Long, Integer or String Services Optional: Specifies the full DMS service release version. Type: Long, Integer or String

Return Type
Long

GetDataValue Method
Syntax
ReportDocument.GetDataValue(Column, Row)

Applies To
ReportDocument Object

Description
Returns a string that contains the data value for a specific data item in the active query.

Discussion
Use the GetDataValue method to assign a specific value in a query to a variable. The value returned is always stored as a string. You can use conversion functions to convert the string to another datatype, if required. To get the data value from the first row and first column in the query, use (1,1).

Administration Guide 561

Chapter 55: Methods Note: The values for Column and Row refer to a column and row in the active query, not in a list frame. You can use the GetDataValue method to return a specific value from any type of report. Parameters Column Description Required. Specifies the query column number containing the data item value. Type: Integer Row Required. Specifies the query row number containing the data item value. Type: Long

Return Type
String

Example
This example shows the data value in the interesecting cell of column two and row three of the active report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strReturnValue As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strReturnValue = objImpRep.GetDataValue(2,3) MsgBox strReturnValue Set objImpRep = Nothing Set objImpApp = Nothing End Sub

GetErrorNumber Method
Syntax
Application.GetErrorNumber

Applies To
Application Object

Description
Returns an OLE automation error number from Impromptu.

Discussion
As IBM CognosScript macros and OLE automation scripts written in other applications run, you can use the GetErrorNumber method to trap errors as they occur. The following table lists the error numbers and their associated errors: Error No 24577 24578 24579 24580 24581 Description An error has occurred during execution of the query. The stored procedure name has to be initialized first. Parameter number <parm> type is not supported. Syntax error. The char descriptor has to be one of VarChar, Char, or LongVarChar. Stored procedure has to be executed first.

562 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods Error No 24582 24583 24584 24585 24587 24588 24589 24590 24591 24592 24593 24594 24595 24596 24597 24598 24599 24600 24601 24602 24603 24604 24605 24606 24608 24609 24610 24611 24612 24613 24614 Description The user class password is not correct. Out of memory. Parameter <parm> is invalid. Catalog is not distributed. Cannot update. Update failed due to internal error. Contact Cognos support. Current catalog specifies a master catalog which is not an Impromptu catalog. Could not open the master catalog for update. Master catalog is from an incompatible version. Catalog method called when no catalog was open. No valid selection for this operation. This catalog could not be found. (<catalogname>) Unable to open this catalog. (<catalogname>) Table name parameter is empty. Specified table was not found. Unable to generate default report. This template could not be found. (<templatename>) Report could not be opened. Current catalog is read-only. Unable to add table <Database><HostDatabase><DBOwner><TableName>. Database name is invalid. Could not connect to database due to wrong or insufficient information provided. Login error while connecting to the database. Database is already connected. Login error: <errortype> Cannot execute a method. Cannot convert to a snapshot report. This report cannot be converted to access the database. Invalid printer name. The printer driver is not installed. Extended device mode is not supported with this driver. The driver could not get the size of the initialization buffer.

Administration Guide 563

Chapter 55: Methods Error No 24615 24616 24617 24618 24641 24642 Description The report cannot be edited Multiple errors have occured with Impromptu. Use GetNextQueryError method to retrieve the error information. User class restriction. The report can not be created. *** Unknown Error Type *** Impromptu cannot open the catalog. Impromptu could not connect to the database.

Return Type
Integer

Example
This example attempts to open a catalog using an invalid path. The error number returned is shown.
Sub Main() Dim objImpApp As Object On Error GoTo ErrorHandler Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\" & _ "GREAT OUTDOORS SALES DATA.CAT" ErrorHandler: MsgBox objImpApp.GetErrorNumber resume done done: Set objImpApp = Nothing End Sub

24577 An error has occurred during execution of the query.


An error condition has been detected during the execution of the current query. The content of this message will vary depending on the nature of the problem.

24578 The stored procedure name has to be initialized first.


You've attempted to execute a stored procedure before you've set the procedure name. Use the SetProcedure Method to set the name of the stored procedure.

24579 Parameter number <type> type is not supported.


You've specified an invalid parameter type for a stored procedure parameter.

24580 Syntax error the char descriptor has to be VarChar, Char, or LongVarChar.
You've specified an invalid descriptor for a variable length parameter of a stored procedure. Specify either VarChar[n], Char[n], or LongVarChar[n], where n indicates the maximum size for the variable length parameter. See the SetProcedure Method.

564 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

24581 Stored procedure has to be executed first.


You've attempted to obtain the value of an output parameter before you've exected the stored procedure. Use the Execute Method to execute the stored procedure.

24582 The user class password is not correct.


You've specified an invalid user class password. Ensure that the user class password is valid.

24583 Out of memory.


The OLE automation procedure has run out of memory. Try closing some applications and running the automation script again.

24584 Parameter <parm> is invalid.


You've specified an invalid parameter as the input to a method. For example, Impromptu has encountered a Boolean value for a parameter when a string value is expected. Make sure that you've specified the parameters correctly. Ensure that you also provide a comma to delimit each parameter when omitting values for some parameters.

24585 Catalog is not distributed. Cannot update.


You've tried to use the UpdateCatalog method to obtain the latest changes for a catalog. The UpdateCatalog method is valid only for distributed catalogs, not for personal, shared, or secured catalogs.

24587 Update failed due to internal error. Contact Cognos support.


IBM CognosScript has encountered a fatal internal error.

24588 Current catalog specifies a master catalog which is not an Impromptu Catalog.
When attempting to update your local copy of a distributed catalog, Impromptu has encountered a problem with the master catalog.

24589 Could not open the master catalog for update.


The UpdateCatalog method could not open the master catalog. Make sure that you have the necessary LAN access, and that the master catalog exists and is intact.

24590 Master catalog is an incompatible version.


During an UpdateCatalog, the master catalog could not be opened because it was created with an earlier version of Impromptu. Contact your database administrator.

Administration Guide 565

Chapter 55: Methods

24591 Catalog method called when no catalog was open.


You've attempted to call a method that operates on a catalog when no catalog is currently open. Use the OpenCatalog Method to open a catalog before using methods such as ChangeUserClass, ConnectDatabase, CloseCatalog, UpdateCatalog, or AddTable.

24592 No valid selection for this operation.


The GetSelectedText method has not found any valid selected text. Use this error to trap whether an Impromptu user has selected text prior to launching a macro that uses the GetSelectedText method.

24593 This catalog could not be found. <catalogname>


A catalog name specified in a method could not be found. Ensure that the name is specified correctly, and that you have read access to it.

24594 Unable to open this catalog. <catalogname>


A catalog that you've specified in either the OpenCatalog method or or GenerateReport method could not be opened. Ensure that the name is specified correctly, and that you have read access to it.

24595 Table name parameter is empty.


You have not specified a value for theTable from within either the GenerateReport method or the AddTable method.

24596 Specified table was not found.


Within the GenerateReport method or the AddTable method, the specified Table could not be found. Ensure that you've specified the correct name for the table.

24597 Unable to generate default report.


Login or table information is valid, however, the GenerateReport method is unable to generate a default report. Ensure that the template name is specified correctly. Ensure also that the method didn't try to create the report on a full disk, and that the name specified for the report doesn't already exist.

24598 This Template could not be found. <templatename>


The ApplyTemplate method could not locate the specified template. Ensure that you've specified the correct name for the template and that you have the necessary LAN access to it.

24599 Report could not be opened.


The OpenReport method could not locate the specified Impromptu report. Ensure that you've specified the correct name for the report and that you have the necessary LAN access to it. 566 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

24600 Current catalog is read-only.


You've attempted to make changes to the current catalog with the UpdateCatalog method. Check that the catalog file (CAT) is not read-only.

24601 Unable to add table <Database><HostDatabase><DBOwner><TableName>.


The AddTable method was unable to add the specified table. Ensure that the database (Impromptu logical database name), HostDatabase (Host database name), DBOwner (host database owner), and TableName are all specified correctly. Ensure also that your connection to the database is active.

24602 Database name is invalid.


The AddTable method has detected an invalid database name. Ensure that the database (Impromptu logical database name) name is specified correctly.

24603 Wrong or insufficient information provided. Could not connect database.


In the ConnectDatabase method, the information provided was not sufficient to connect the database. Ensure that you've provided all of the required parameters (user ID, password).

24604 Login error while connecting the database.


In the ConnectDatabase method, an error other than a security error occurred during an attempt to connect to the database.

24605 Database is already connected.


You've used the ConnectDatabase method when the catalog is already connected to its associated database.

24606 Login error. <errortype>


In the ConnectDatabase method, the user ID and password are specified incorrectly or are not sufficient for the current level of security.

24608 Cannot execute a method.


Impromptu is busy and cannot execute a macro method.

24609 Cannot convert to a snapshot report.


The CreateSnapshot method is unable to save the current report as a snapshot. Ensure that your disk has sufficient space to store a snapshot of the report data.

Administration Guide 567

Chapter 55: Methods

24610 This report cannot be converted to access the database.


The current report cannot revert to database access from a snapshot. Ensure that the connection to the database is active.

24611 Invalid printer name.


You have specified the name of a printer that does not exist in the FileSetPrinter method. Make sure that the value specified for PrinterName matches exactly (including the case) the device name that's listed in the [Devices] section of your WIN.INI file. In general, this should be the name of the printer as it's displayed in Print Manager, up to but not including the "on <port number>" qualifier.

24612 The printer driver is not installed.


Windows is unable to locate the printer driver for the printer that you've specified in the FileSetPrinter method. Ensure that the printer driver is installed correctly.

24613 Extended device mode is not supported with this driver. 24614 The driver could not get the size of the initialization buffer. 24615 The report cannot be edited. 24616 Multiple errors have occured with Impromptu. Use GetNextQueryError() method to retrieve the error information.
The current report cannot execute because of query errors. Use the GetNextQueryError method to return the error number(s) and description.

24617 User class restriction.The report can not be created.


A user class restriction, such as being prohibited from accessing a specific table or folder, is preventing the current report from executing successfully. Ensure that the restrictions for the current user class do not conflict with the report requirements.

24618 *** Unknown Error Type ***


Impromptu has encountered an unexpected error. Contact Cognos Support.

24641 Impromptu cannot open the required catalog.


The required catalog cannot be open. Ensure you have specified the correct catalog name.

568 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

24642 Impromptu could not connect to the database.


Ensure that the correct database has been specified.

GetFilterFor Method
Syntax
UserClass.GetFilterFor(FilteredObject)

Applies To
UserClass Object

Description
Returns the filter expression (if one exists) for the input object.

Discussion
If the object contains no filter, Nothing is returned. An error occurs when the parameter is not a Column or Table object. If the filter expression exists for the Column or Table object, the object will be a member of the FilteredColumns or FilteredTables collection. Parameters FilteredObject Description Required. Specifies the filter object, either a Column or Table for the user class. Type: Object

Return Type
Object

Example
This example returns the filter expression for the COUNTRY column. In this case, the filter applies to the first user class in the ActiveUserClass collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as object Dim objUser As Object Dim objFilter As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) Set objFilter = objUser.GetFilterFor _ (objDB.Tables("COUNTRY").Columns("COUNTRY")) MsgBox objFilter.Formula Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

GetNextQueryError Method
Syntax
Application.GetNextQueryError

Administration Guide 569

Chapter 55: Methods

Applies To
Application Object

Description
Returns the next query error in the current macro.

Discussion
The GetNextQueryError method returns a string that contains the number and associated text for an Impromptu query error. When a query error is detected, it raises the error number 24616, indicating that some type of query error has occurred. When occurs, use the GetNextQueryError method to return query error numbers along with their descriptions. Query Errors fall into the following categories: Error Range 100 to 299 300 to 499 500 or greater Error Type Critical errors. These can occur at either compile-time or runtime, depending on the nature of the error. Warnings. These are ignored unless the UseQueryWarnings property is set to 1. Critical runtime errors.

The following list describes briefly the errors returned using the GetNextQueryError method: Error String Query Error 100: Cannot execute query. Processing requirements exceed the current Client/Server limits. Query Error 101: Data item [%1] could not be found. Query Error 102: Data item [%1] is invalid because [%2] could not be found. Query Error 103: Using the Governor denied Database Column [%1]. Query Error 104: This report will result in a 'cross product' query. This User Profile prevents the use of 'cross product' reports. Query Error 105: The query for this report contains an 'outer join'. This User Profile prevents the use of 'outer join' queries. Query Error 106: This report sorts on the non-indexed columns. Query Error 107: This report contains circular [DATASET] references: %1. Query Error 108: This report contains a prompt nested within a sub-report: %1. Query Error 109: This report uses %1 tables. This exceeds the current Governor restriction of %2 tables for a report. Query Error 110: Data item [%1] is invalid because it contains additional invalid Data Items. Query Error 111: Invalid SQL query. Use read-only SELECT statements. Query Error 112: Prompt uses column %1 of report %2 which doesn't exist. Query Error 113: Prompt shows column %1 of report %2 which doesn't exist. Query Error 300: This report is expected to use %1 tables.

570 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods Error String Query Error 301: This report is expected to return %1 rows. Query Error 302: The expected report preparation time is %1. Query Error 303: This report suppresses duplicates. Query Error 304: This report will result in a 'cross product' query. Query Error 305: This report sorts on the non-indexed columns. Query Error 306: The query for this report contains an 'outer join'. Query Error 307: This crosstab report contains a query column, %1, that no longer exists. Query Error 308: This crosstab report contains a bad reference to %2 in a conditional format. Query Error 309: This crosstab report contains a bad reference in %1 to %2. Query Error 310: This crosstab report contains a bad reference to %2 in the detail filter. Query Error 311: This crosstab report contains a bad reference to %2 in the summary filter. Query Error 500: This report exceeded the current Governor Restriction of %1 report preparation time. Query Error 501: Database Retrieval Limit reached. Governor restrictions specify a retrieval limit of %1 rows for the current User Profile. Query Error 502: Could not open the following [DATASET] report: %1.

Return Type
String

Example
This example traps Impromptu query errors in sequence and shows a message for each one that appears.
Sub Main() Dim objImpApp As object Dim objImpRep As object Dim strErr as String On Error goto HndlErr Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.visible 1 objImpApp.UseQueryWarnings 1 objImpApp.OpenCatalog _ "sybase.cat","admin","admin_pwd","qcimprom","qcimprom",1 Set objImpRep = objImpApp.OpenReport("sybase01.imr") HndlErr: do strErr = objImpApp.GetNextQueryError if strErr <> "" then MsgBox strErr else exit do end if loop resume next Set objImpRep = Nothing Set objImpApp = Nothing End sub

Administration Guide 571

Chapter 55: Methods

Query Error 100 Cannot execute query. Processing requirements exceed the current Client/Server limits.
The current report exceeds one or more of the client/server limits imposed in the Client/Server tab-Query dialog box. For example, the report uses a local Impromptu function when client/server load balancing is set to database only. Ensure that the client/server settings meet the requirements of the report.

Query Error 101 Data item [%1] could not be found.


A data item used in the current report is invalid because Impromptu is unable to locate it's associated column.

Query Error 102 Data item [%1] is invalid because [%2] could not be found.
A data item used in the current report is invalid because Impromptu is unable to locate the catalog expression upon which it is based. Ensure that the data items in the report do not depend on catalog calculations that no longer exist.

Query Error 103 Using the Governor denied Database Column [%1].
The current report cannot execute because of a report governor restriction. Ensure that the current user class has sufficient access to all of the tables, folders, and columns in the catalog.

Query Error 104 This report will result in a 'cross product' query. This User Profile prevents the use of 'cross product' reports.
The current report cannot execute because of a report governor restriction that prevents cross-product reports. Ensure that the current user class has sufficient privilege to execute cross product reports, or change the user class restrictions.

Query Error 105 The query for this report contains an 'outer join'. This User Profile prevents the use of 'outer join' queries.
The current report cannot execute because of a report governor restriction that prevents the use of outer joins. Ensure that the current user class has sufficient privilege to use outer joins, or change the user class restrictions.

Query Error 106 This report sorts on the non-indexed columns.


The current report cannot execute because of a report governor restriction that prevents sorting on non-indexed columns. Ensure that the current user class has sufficient privilege to sort on non-indexed columns, or change the user class restrictions.

Query Error 107 This report contains circular [DATASET] references %1.
The current report cannot execute because a dataset used within an expression contains a reference to itself. Ensure that the datasets used in the report do not contain any references to themselves.

572 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Query Error 108 This report contains a prompt nested within a sub-report %1.
The current report cannot execute because a dataset used within an expression contains a runtime prompt (either a pick-list or type-in). Ensure that the datasets used within expressions in the report do not contain any runtime prompts.

Query Error 109 This report uses %1 tables. This exceeds the current Governor restriction of %2 tables for a report.
The current report cannot execute because it accesses more tables than are currently allowed by the report governor for the current user class. Ensure that the current user class has sufficient privilege to access the required number of tables, or change the user class restrictions.

Query Error 110 Data item [%1] is invalid because it contains additional invalid Data Items.
The current report contains an expression that Impromptu has tagged as invalid. If you encounter this error, contact Cognos Support.

Query Error 111 Invalid SQL query. Use read-only SELECT statements.
This message occurs only if you've manually edited the SQL statements for the current query using the SQL Query dialog box. Impromptu supports only SELECT statements. Impromptu returns this message if you enter an invalid SQL statement, or if you attempt to enter a read/write statement (such as INSERT, DROP TABLE, or CREATE TABLE, for example). Verify that manually entered SQL statements are valid.

Query Error 112 Prompt uses column %1 of report %2 which doesn't exist.
A runtime prompt (either a catalog Picklist or a report Picklist) within a report you're trying to run contains a reference to a column that Impromptu cannot find. Ensure that the column used to filter data in the Picklist exists in the database.

Query Error 113 Prompt shows column %1 of report %2 which doesn't exist.
A runtime prompt (either a catalog Picklist or a report Picklist) within a report you're trying to run contains a reference to a column that Impromptu cannot find. Ensure that the column used to display filter data in the Picklist exists in the database.

Query Error 300 This report is expected to use %1 tables.


The report you're running is going to use more tables than the current warning level allows. Either change the Governor settings for the current user class so that the warning level allows more tables, or tell Impromptu to ignore warning messages by setting the UseQueryWarnings property to 0. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Administration Guide 573

Chapter 55: Methods

Query Error 301 This report is expected to return %1 rows.


The report you're running is going to use more rows than the current warning level allows. Either change the Governor settings for the current user class so that the warning level allows more rows, or tell Impromptu to ignore warning messages by setting the UseQueryWarnings property to 0. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 302 The expected report preparation time is %1.


The report you're running requires more time to execute than the current warning level allows. Either change the Governor settings for the current user class so that the warning level allows more execution time, or tell Impromptu to ignore warning messages by setting the UseQueryWarnings property to 0. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 303 This report suppresses duplicates.


Impromptu has issued a warning for the current user class because the current query supresses duplicates and the Governor is set to warn the user when this occurs. Either change the Governor settings for the current user class so that the suppression of duplicates is allowed or tell Impromptu to ignore warning messages by setting the UseQueryWarnings property to 0. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 304 This report will result in a 'cross product' query.
The Governor warns the user when the current query generates a cross-product. Either change the Governor settings for the current user class so that cross-product queries are allowed or tell Impromptu to ignore warning messages by setting the UseQueryWarnings property to 0. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 305 This report sorts on the non-indexed columns.


Governor warns the user when the current query sorts on non-indexed columns. Either change the Governor settings for the current user class so that sorting on non-indexed columns is allowed or tell Impromptu to ignore warning messages by setting the UseQueryWarnings property to 0. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 306 The query for this report contains an 'outer join'.
The Govenor warns the user when the current query uses an outer join. You can change the Governor settings for the current user class so that outer joins are allowed, or tell Impromptu to ignore warning messages by setting the UseQueryWarnings property to 0. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 307 This crosstab report contains a query column (%1) that no longer exists.
A crosstab report contains a reference to a column that Impromptu cannot locate. Ensure that the column has not been deleted from the database or renamed.

574 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 308 This crosstab report contains a bad reference to %2 in a conditional format.
A crosstab report that uses conditional formatting contains an invalid reference to a data item within the conditional format. Ensure that the columns and data items used in a conditional format exist within the catalog. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 309 This crosstab report contains a bad reference in %1 to %2.
A crosstab report uses a calculation that contains an invalid reference to a data item. Ensure that the columns used in calculated data items exist within the catalog. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 310 This crosstab report contains a bad reference to %2 in the detail filter.
A crosstab report that filters detail data contains an invalid reference to another column or data item. Ensure that the columns and data items used in the detail filter exist within the catalog. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 311 This crosstab report contains a bad reference to %2 in the summary filter.
A crosstab report that filters summary data contains an invalid reference to another column or data item. Ensure that the columns and data items used in the summary filter exist within the catalog. Note: This error is ignored unless the UseQueryWarnings property is set to 1.

Query Error 500 This report exceeded the current Governor restriction of %1 report preparation time.
A report has exceeded the maximum time allowed to complete the execution of a query. Either change the Governor settings for the current user class so more time is allowed for the query, or assign a user class with sufficient privileges to execute the report.

Query Error 501 Database Retrieval Limit reached. Governor restrictions specify a retrieval limit of %1 rows for the current User Profile.
A report has exceeded the maximum number of rows allowed for a query. Either change the Governor settings for the current user class so more rows can be retrieved by the query, or assign a user class with sufficient privileges to execute the report.

Query Error 502 Could not open the following [DATASET] report %1.
Impromptu has been unable to locate a dataset report that's used in the filter for the current report. Ensure that the dataset report exists, and that it's located in a directory to which you have read access.

Administration Guide 575

Chapter 55: Methods

GetParameter Method
Syntax
StoredProcedure.GetParameter(n)

Applies To
StoredProcedure Object

Description
Returns the value from the nth parameter for a stored procedure.

Discussion
Use the GetParameter method to return parameter values from database-stored procedures. Ensure that the variables assigned are of the correct type and size to hold the value returned by GetParameter.

Parameters
Parameters n Description Required. Specifies the index number corresponding to an input or output parameter of a stored procedure call. Type: Integer

Return Type
Nothing

GetSelectedText Method
Syntax
ReportDocument.GetSelectedText

Applies To
ReportDocument Object

Description
Returns a string value containing the currently selected text in the active report.

Discussion
Use the GetSelectedText method to assign the value of selected text in an Impromptu report to a string variable. Use this method when launching a macro which operates on selected text. For example, you could select a summary value for total sales over a given period, and then launch a macro that compares the selected value to previous sales totals.

Return Type
String

Example
This example copies the selected text of the active report to the Clipboard and shows a message if the action was successful. To run this macro, you must first open a report and select text from it.
Sub Main() Dim objImpApp As Object

576 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


Dim objImpRep As Object Dim strSelectedText As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strSelectedText = objImpRep.GetSelectedText objImpRep.CopyToClipboard If objImpRep.CopyToClipboard = 0 then MsgBox strSelectedText & " copied to the clipboard." End If Set objImpRep = Nothing Set objImpApp = Nothing End Sub

InsertQualificationLevel Method
Syntax
Database.InsertQualificationLevel(NewLevelName,[LevelType])

Applies To
Database Object

Description
Inserts a database qualification level into a Database object.

Discussion
SchemaLevel objects are added first. If the Database object already has SchemaLevel objects then CatalogLevel objects are added. If the Database already has a CatalogLevel object, inserting a CatalogLevel object will change the existing CatalogLevel object to a SchemaLevel object. The SchemaLevel object and the Table objects will be moved beneath the CatalogLevel object in the hierarchy. Note: This method will fail if the Database object already has two qualification levels, or if the Database has no Tables. Parameters NewLevelName Description Required. Specifies the name of the new qualification level object. Type: String LevelType Optional. Specifies whether the new level is a catalog or schema level. Type: Boolean The values are: False (0) = catalog level True (-1) = schema level If the LevelType parameter is omitted, the following will be added: A schema level will be added to the database with no qualification. A catalog will be added if the database already has one level of qualification.

Return Type
Nothing

Example
This example creates a new catalog and inserts one schema qualification level and one catalog qualification level. Administration Guide 577

Chapter 55: Methods


Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateCatalog "C:\Catalogs\Sample.cat", "OUTDOORS", 0 Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") objDB.InsertQualificationLevel "Schema 1a", 1 objDB.InsertQualificationLevel "Catalog 1", 0 objDB.CatalogLevels.Add "Catalog 2" objDB.CatalogLevels(2).SchemaLevels.Add "Schema 2a" objDB.CatalogLevels(2).SchemaLevels.Add "Schema 2b" objDB.CatalogLevels(1).SchemaLevels.Add "Schema 1b" Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Interactive Method
Syntax
Application.Interactive Flag

Applies To
Application Object

Description
Sets or returns whether the application is interactive.

Discussion
Use the Interactive property to determine the value of the current setting, and for macros or macro subsections that may produce long and costly queries or require all data to be retrieved without interruption. Setting the Interactive property to 0, "locks" the macro and disables the Interrupt button (displayed in the lower-left corner of the screen). Setting the Interactive property to 1, enables the Interrupt button and allows the user to interrupt data retrieval. Default: False Parameters Flag Description Optional. Specifies whether users can interrupt the retrieval of data. Type: Boolean False (0) = disables user interaction with the application. True (1) = enables user interaction with the application.

Return Type
Nothing

Example
This example stops the user from interacting with Imrpomptu.
Sub Main() Dim objImpApp As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Interactive False Set objImpApp = Nothing End Sub

578 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

MoveTo Method
Syntax
FolderItem.MoveTo(DestinationFolder)

Applies To
FolderItem Object

Description
Moves the folder to the destination folder.

Discussion
Use the CopyTo method to keep a copy of the source-folder in its original location. Parameters DestinationFolder Description Required. Specifies the new folder location. Type: Object

Return Type
Nothing

Example
This example moves the Orderdetl folder to the Order folder and the Customer column to the Order folder.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\GO Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders objCatFolders("Ordrdetl").MoveTo objCatFolders("Order") objCatFolders("Customer").Items("Customer").MoveTo objCatFolders("Order") objCatFolders("Order").Items.AddFolder "Additional Info." objCatFolders("Order").Items.AddFolder "Conditions" objCatFolders("Order").Name = "Orders" objCatFolders("Orders").Items("Ordrdetl").Name = "Order Details" objCatFolders("Orders").Items("Customer").Name = "Customer Name" objImpApp.CloseCatalog Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

OpenCatalog Method
Syntax
Application.OpenCatalog CatalogName ,[UserClassID] ,[UserClassPassword] ,[DatabaseID] ,[DatabasePassword] ,[ConnectToDatabase] ,[DistributedCopyFilePath]

Applies To
Application Object

Description
Opens the specified catalog. Administration Guide 579

Chapter 55: Methods

Discussion
Use the OpenCatalog method to open a specific Impromptu catalog. Only one catalog can be open at a time. If you attempt to open more than one, the open operation will fail. If you invoke an OLE automation script from the Scheduler, the OpenCatalog method automatically connects to the database. In addition, the Scheduler passes all security information required by both Impromptu and the database to Impromptu. If you open a catalog that is a distributed master catalog and you are not a member of the Creator user class, then you must specifiy a file location for the distributed copy. The parameter, DistributedCopyFilePath is required. The distributed copy becomes the active catalog. If the Creator user class opens a catalog that is a distributed master but does not pass the parameter, DistributedCopyFilePath, then the distributed master catalog opens. Parameters CatalogName Description Required. Specifies the location, name, and file extension of the catalog. Type: String UserClassID Optional. Specifies the name of the user class. Required for shared and distributed catalogs with multiple user classes. Type: String UserClassPassword Optional. Specifies the user class password. Required for shared and distributed catalogs with multiple user classes. Type: String DatabaseID Optional. Specifies the database identification. Required only for databases with database user IDs. Type: String DatabasePassword Optional. Specifies the database password. Required only for databases with database user IDs. Type: String ConnectToDatabase Optional. Specifies whether to automatically connect the catalog to the database. Type: Boolean False (0) = you do not need access to the database. True (-1) = connect to database. Default: True DistributedCopyFilePath Optional. Specifies the file path of the distributed copy of a distributed master catalog. (Required only when members of a user class outside the Creator open a distributed master catalog). Type: String

Return Type
Boolean

Example
This example opens an existing catalog and modifies the catalog folder structure.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object

580 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


Dim objCatFolders As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\GO Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders objCatFolders("Ordrdetl").MoveTo objCatFolders("Order") objCatFolders("Customer").Items("Customer").MoveTo objCatFolders("Order") objCatFolders("Order").Items.AddFolder "Additional Info." objCatFolders("Order").Items.AddFolder "Conditions" objCatFolders("Order").Name = "Orders" objCatFolders("Orders").Items("Ordrdetl").Name = "Order Details" objCatFolders("Orders").Items("Customer").Name = "Customer Name" objImpApp.CloseCatalog Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

OpenCatalogEx Method
Syntax
Application.OpenCatalogEx CatalogName ,[UserClassID] ,[UserClassPassword] ,[DatabaseID] ,[DatabasePassword] ,[ConnectToDatabase] ,[DistributedCopyFilePath] ,[AccManSignonName] ,[AccManPassword]

Applies To
Application Object

Description
Opens the specified catalog with the option to add security authentication.

Discussion
Use the OpenCatalogEx method to open a specific Impromptu catalog and then apply Access Manager authentication. Only one catalog can be open at a time. If you attempt to open more than one, the open operation will fail. If you open a catalog that is a distributed master catalog and you are not a member of the Creator user class, then you must specifiy a file location for the distributed copy. The parameter, DistributedCopyFilePath is required. The distributed copy becomes the active catalog. If the Creator user class opens a catalog that is a distributed master but does not pass the parameter, DistributedCopyFilePath, then the distributed master catalog opens. If you use the AccManSignonName and AccManPassword parameters, users are not prompted to login to Access Manager when they run the automation script unattended. Parameters CatalogName Description Required. Specifies the location, name, and file extension of the catalog. Type: String UserClassID Optional. Specifies the name of the user class. Required for shared and distributed catalogs with multiple user classes. Type: String UserClassPassword Optional. Specifies the user class password. Required for shared and distributed catalogs with multiple user classes. Type: String

Administration Guide 581

Chapter 55: Methods Parameters DatabaseID Description Optional. Specifies the database identification. Required only for databases with database user IDs. If the AccMan signon name has a database signon associated to it, the database signon overrides the DatabaseID. Type: String DatabasePassword Optional. Specifies the database password. Required only for databases with database user IDs. If the AccMan signon name has a database signon associated to it, the database signon overrides the DatabasePassword. Type: String ConnectToDatabase Optional. Specifies whether to automatically connect the catalog to the database. Type: Boolean False (0) = you do not need access to the database. True (-1) = connect to database. Default: True DistributedCopyFilePath Optional. Specifies the file path of the distributed copy of a distributed master catalog. (Required only when members of a user class outside the Creator open a distributed master catalog). Type: String AccManSignonName Optional. Use Access Manager for security authentication. Required if the catalog is secured against a namespace. If signon name is supplied, a valid AccMan password and user class name is also expected. Type: Variant string AccManPassword Optional. Use Access Manager for security authentication. Required if the catalog is secured against a namespace. See AccManSignonName. Type: Variant string

Return Type
Boolean

Example
This example opens and closes a catalog that has been secured with a Basic Signon in Access Manager.
Sub main Dim objimpapp As object Dim objimpcat As object Dim sCatFileName As string sCatFileName = "C:\Catalogs\GO Samples.cat" 'create an Impromptu application object Set objimpapp = CreateObject("Impromptu.Application") objimpapp.Visible 1 ' Access Manager is used for authentification objimpapp.OpenCatalogEx sCatFileName,"Creator",,,,,, _ "administrator" ' The administrator user has no password Set objimpcat = objimpapp.ActiveCatalog ' other processing is done here

582 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


objimpcat.close objimpapp.Quit Set objimpapp = Nothing End Sub

OpenDrillDownReport Method
Syntax
Application.OpenDrillDownReport(Report,Predicate)

Applies To
Application Object

Description
Opens an existing Impromptu report for access by another application or report.

Discussion
Drill-down refers to the capability of one report or application to open an existing Impromptu report in the background and to extract information from it via a query. Any application that can provide a drill-down ability can access an Impromptu report. The terms of the query are described and passed using "predicates". A predicate is a string that provides the case-sensitive column names (equivalent of the names on the Data tab of a report query) and values to use as data filters. The columns named in the predicate must exist in both the drilling and drilled-down reports for values to be returned. For example, if you wanted to restrict the data displayed in a report to a range of dates, you'd specify the date range as a predicate, like this:
Dim Report as String Dim SelString as String SelString = "[""LowestDate""=""1997-03-31"",""HighestDate""=""1998-03-31""]" Dim Rep As object Rep=App.OpenDrillDownReport(Report, SelString)

The predicate is typically created and defined using a Dim statement and the object name used as the predicate, as with SelString above. Each portion of the predicate string takes the following form:
"[""columnName""=""value""]"

Here, "columnName" is a column existing in both the source application and the target report, and "value" is an applicable numeric, date (in YYYY-MM-DD format), or character value or values. The paired double quotes and square brackets are required. A series of values is indicated using this syntax:
"[""columnName""=[""value"",""columnName""=""value""]]"

A range of values is indicated using this syntax:


"[""columnName""=(""value"",""value"")]"

With ranges, the first value is less than the second; that is, the first value must be a lower numeric value, an earlier date value, or start with a character with a higher sort order for text values. A predicate contains one or more column names and their values. The predicate is passed as a single string. The placement of square brackets creates AND and OR logic. For example, a single set of outside brackets indicates AND, like this:
"[""a""=""value"",""b""=""value"",""c""=""value""]"

While, a pair of square brackets means OR, like this means OR.
"[[""a""=""value"",""b""=""value"",""c""=""value""]]"

By nesting the square brackets, you can include both AND and OR, like this:
"[""a""=""value"",[""b""=""value"",[""c""=""value"",""d""=""value""]]]"

Each left-facing square bracket ([) creates another nesting level and "toggles" between AND an OR. So, the above example translates to the Boolean equivalent of "a AND (b OR (c AND d))". Administration Guide 583

Chapter 55: Methods The value supplied for a column must be consistent with the column's datatype. Instead of a value, you can use the keywords NB or NULL. NB means a zero-length string, and is valid only for character expressions. NULL is equivalent to the SQL predicate IS NULL. Parameters Report Description Required. Specifies the name and location of the Impromptu report. Type: String Predicate Required. Specifies the criteria for the report query. Type: String

Return Type
Object

Example
This example opens a report and uses constant declarations to pass query information. The first constant sets the Impromptu report to open. The second constant provides the column names and values to use in the query. In this case, the value for Product can be either Star Lite or StarDome. The query returns all sales data that is available through the All Country Sales report for one of these products.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Const strReport = "C:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\All Country Sales.imr" Const strPredicate = _ "[[""Product""=""Star Lite"",""Product""=""StarDome""]]" Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.OpenDrillDownReport _ (strReport, strPredicate) Set objImpRep = Nothing Set objImpApp = Nothing End Sub

OpenReport Method
Syntax
Application.OpenReport(FileName ,["PromptValueA1[, PromptValueA2, ][|PromptValueB1[, PromptValueB2, ]]..."])

Applies To
Application Object

Description
Opens an Impromptu report.

Discussion
Use the OpenReport method to open an existing Impromptu report. The OpenReport method returns an Impromptu ReportDocument object. Use the OpenReport method to assign a value to an object variable created for an Impromptu report.

584 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods For reports that prompt for picklist and Type In prompts at runtime, use PromptValueX# to specify values. PromptValuesX# must be enclosed in quotation marks, specified in the correct order, and must be separated by a vertical slash character ( | ). Parameters FileName Description Required. Specifies the name and location of the Impromptu report. Type: String PromptValueX# Optional. Specifies values for picklist and Type-In prompts. Values within prompts are separated by commas. Values between prompts are separated by a vertical bar. For Type-In prompts that use filter expressions containing the In operator, all values are considered. Type: String

Return Type
Object

Example
This example uses a report that prompts for two values. The values are passed to the report when the report is opened. Do not add spaces between passed values.
Sub Main() Dim objImpApp As object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible 1 objImpApp.OpenCatalog _ "c:\cognos\samples\outdoors.cat","Creator",,,,1 Set objImpRep = _ objImpApp.OpenReport("c:\cognos\samples\" & _ "prompt1.imr","40100,40101|42000") objImpRep.CloseReport objImpApp.Quit Set objImpApp = Nothing Set objImpRep = Nothing End Sub

Related Topics
"OpenReportNoExecute Method" (p. 586) "OpenReportExA Method" (p. 585)

OpenReportExA Method
Syntax
Application.OpenReportExA(FileName ,["<[All=true|false]>PromptValueA1[, PromptValueA2, ][|<[All=true|false]>PromptValueB1[, PromptValueB2, ]]..."])

Applies To
Application Object

Description
Opens an Impromptu report.

Administration Guide 585

Chapter 55: Methods

Discussion
Use the OpenReportExA method to open an existing Impromptu report. The OpenReportExA method returns an Impromptu ReportDocument object. Use the OpenReportExA method to assign a value to an object variable created for an Impromptu report. For reports that prompt for picklist prompts at runtime, use PromptValueX# to specify values. PromptValuesX# must be enclosed in quotation marks, specified in the correct order, and must be separated by a vertical slash character ( | ). Parameters FileName Description Required. Specifies the name and location of the Impromptu report. Type: String Header "<>" All Required. The new prompt header value "<>" is mandatory for every prompt. Optional. Specifies the select all option in picklist prompts. True - Includes the select all option. False - Omits the select all option. Type: String PromptValueX# Optional. Specifies values for picklist and Type-In prompts. Values within prompts are separated by commas. Values between prompts are separated by a vertical bar. Type: String

Return Type
Object

Example
The following example has two prompts. The first chooses "select all", while the second sets the prompt values to Kite, House, and bat.
objImpApp.OpenReportExA("c:\cognos\samples\prompt1.imr","<All=true>|<>Kite,Hou se,Bat")

Related Topics
"OpenReport Method" (p. 584) "OpenReportNoExecute Method" (p. 586)

OpenReportNoExecute Method
Syntax
Application.OpenReportNoExecute(FileName)

Applies To
Application Object

Description
Opens an Impromptu report without executing the query.

586 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Discussion
Use this method to return an Impromptu ReportDocument object and to assign a value to an object variable created for an Impromptu report. Parameters FileName Description Required. Specifies the name and location of the Impromptu report. Type: String

Return Type
Object

Example
This example opens an existing report in Impromptu (called Annual_Sales.imr) and then publishes it as a PDF called Annual_Sales.pdf in the C:\Temp folder. Users who do not have Impromptu can now use Adobe Acrobat Reader to view the report.
Sub Main() Dim ImpApp as Object Dim ImpRep as Object Dim PDFPub as Object Set ImpApp = CreateObject("Impromptu.Application") ImpApp.Visible True Set ImpRep = ImpApp.OpenReportNoExecute("C:\My Documents\Annual_Sales.imr") ImpRep.Reexecute Set PDFPub = ImpRep.PublishPDF PDFPub.Publish "C:\Temp\Annual_Sales.pdf" Set objImpRep = Nothing Set objImpApp = Nothing Set objPDFPub = Nothing End Sub

Related Topics
"OpenReport Method" (p. 584)

Print Method, PrintOut Method


Syntax
ReportDocument.Print [FromPage] ,[ToPage] ,[Copies] ReportDocument.PrintOut [FromPage] ,[ToPage] ,[Copies]

Applies To
ReportDocument Object

Description
Prints the active report.

Discussion
Use either the Print or PrintOut method to print an Impromptu report from within an OLE automation script. Use the Printout method to print an Impromptu report in another scripting language. The methods are equivalent and both automatically collate multiple copies. Parameters FromPage Description Optional. Specifies the page number of the first page to print. Type: Integer

Administration Guide 587

Chapter 55: Methods

Parameters ToPage

Description Optional: Specifies the page number of the last page to print. Type: Integer

Copies

Optional: Specifies the number of copies to print. Type: Integer

Return Type
Nothing

Example
This example prints two copies of pages two and three of the active report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.Print 2,3,2 Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Publish Method
Syntax
PublishExcel.Publish (FileName) PublishHTML.Publish (Dir,Prefix) PublishPDF.Publish (FileName)

Applies To
PublishExcel Object PublishHTML Object PublishPDF Object

Description
Saves the referenced report as a Microsoft Excel file, HTML or PDF, as appropriate.

Discussion
If Publish is successful, a value of True is returned. If Publish fails, a value of False is returned. Parameters Dir Description Required. Specifies the directory location of the new HTML and related files. For a list of the files produced during the publish step, see "Created HTML Files" in the Mastering Impromptu Reports book. Type: String Prefix Required. Specifies the file prefix of the new HTML files. Type: String FileName Required. Specifies the location and name of the PDF or Microsoft Excel file to be generated. Type: String

588 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Return Type
Boolean

Example
The first example creates a report in HTML format and then publishes the report to a file. The HTML file is placed in a folder called tmp that has the prefix called myfiles. Users who do not have Impromptu can now use a Web browser to view the report.
Sub Main() Dim objImpApp as Object Dim objHTML as Object Dim objImpRep as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\Great Outdoors Sales " & _ "Data.cat","Creator" Set objImpRep = objImpApp.OpenReport _ ("c:\cognos\reports\annual product sales.imr") Set objHTML = objImpRep.PublishHTML objHTML.Publish "c:\tmp","myfiles" Set objImpRep = Nothing Set objHTML = Nothing Set objImpApp = Nothing End Sub

The second example opens an existing report in Impromptu (called Annual_Sales.imr) and then publishes it as a PDF called Annual_Sales.pdf in the C:\Temp folder. Users who do not have Impromptu can now use Adobe Acrobat Reader to view the report.
Sub Main() Dim ImpApp as Object Dim ImpRep as Object Dim PDFPub as Object Set ImpApp = CreateObject("Impromptu.Application") ImpApp.Visible True Set ImpRep = ImpApp.OpenReportNoExecute("C:\My Documents\Annual_Sales.imr") ImpRep.Reexecute Set PDFPub = ImpRep.PublishPDF PDFPub.Publish "C:\Temp\Annual_Sales.pdf" Set objImpRep = Nothing Set objImpApp = Nothing Set objPDFPub = Nothing End Sub

Related Topics
"Products (Publish as HTML) Sample" (p. 721) "PublishHTML Property" (p. 681) "PublishPDF Property" (p. 682) "Sales By Country (Publish as HTML) Sample" (p. 722)

PublishXML Method
Syntax
PublishXML.Publish

Applies To
ReportDocument Object

Description
Saves the referenced report as an XML file.

Administration Guide 589

Chapter 55: Methods

Discussion
Use the PublishXML method to save Impromptu reports in XML format. You must first open the report with the OpenReport method or the OpenReportNoExecute method. After the report is open, you can call the PublishXML method with this report object. If you open the report with the OpenReportNoExecute, then the output of the PublishXML method is limited. No actual data values from the database are put in the XML output and the information about the report formatting in XML describes the formatting of the empty report. Parameters Outpath Description Required. Specifies the location and name of the XML file. Type: String Parts Optional. Specifies the information that is included in the XML file. Use the sum of one or more of the following values to specify XML content: 0=Document root and report header data only 1=Layout specification 2=Queries specification 4=Result sets 8=Report rendering The default value used when the Parts parameter is omitted is 15. With the default value, XML content includes layout specification, queries specification, results sets, and report rendering. Type: Integer

Return Type
Nothing

Example
This example opens the sample report Sales by Channel.imr that uses the sample catalog, Great Outdoors Sales Data.cat. It then publishes the sample report, in XML format, to a file called Sales by Channel and places the report into a folder called c:\tmp.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\Great Outdoors Sales Data.cat" _ ,"Creator" Set objImpRep = objImpApp.OpenReport("c:\Program Files\" & _ "Cognos\<rendition_id>\samples\Impromptu\Reports\" & _ "Sales by Channel.imr") objImpRep.PublishXML "c:\tmp\Sales by Channel.xml" Set objImpRep = Nothing Set objImpApp = Nothing End Sub

QueryDialog Method
Syntax
ReportDocument.QueryDialog

Applies To
ReportDocument Object

590 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Description
Shows the Data tab of the Query dialog box and suspends your macro while you enter information.

Discussion
To manually change any part of the query, use this method to suspend the macro while you enter information. Choose OK or Cancel to continue with the rest of the macro. Selecting OK saves your changes and applies them to subsequent actions. Selecting Cancel abandons any changes. Once you choose OK or Cancel Impromptu returns a Boolean value of True (which is -1) for OK, or False (which is 0) for Cancel. Note: This method will show the Query dialog box even if Impromptu is not visible.

Return Type
Boolean

Example
This example shows the query dialog box during macro execution so that the user can interact before the macro continues.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim Button As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.QueryDialog Set objImpRep = Nothing Set objImpApp = Nothing End Sub

QueryItems Method
Syntax
ReportDocument.QueryItems

Applies To
ReportDocument Object

Description
Returns a collection of all the query items in the current report.

Discussion
Use this method and the QueryItem object to gather information about the queries in a report.

Return Type
Collection

Example
This example shows the name of the first folder and the number of query items from the current report. To run this example, you must set Impromptu to single instance and open the report.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objImpRep As Object Dim objQueryItemsCol As Object ' collection Dim objFolderItemCol As Object ' collection Dim count As Integer Set objImpApp = CreateObject("CognosImpromptu.Application")

Administration Guide 591

Chapter 55: Methods


objImpApp.Visible True Set objImpCat = objImpApp.ActiveCatalog Set objFolderItemCol = objImpCat.Folders(1).Items ' get children of 1st folder MsgBox "The first folder is " & objFolderItemCol(1).Name Set objImpRep = objImpApp.ActiveDocument Set objQueryItemsCol = objImpRep.QueryItems count = objQueryItemsCol.count MsgBox "QueryItems.Count = " & count End Sub

Related Topics
"QueryItem Object" (p. 475) "QueryItem Property" (p. 685) "QueryItems Collection" (p. 501)

Quit Method
Syntax
Application.Quit

Applies To
Application Object

Description
Exits Impromptu.

Discussion
Use the Quit method to exit the Impromptu application. Important: Save any changes in open reports before using the Quit method, as no verification is performed prior to exiting Impromptu in an OLE automation script. Use the Modified Property to determine if there are any outstanding changes to be saved, and then use the Save Method (Reports) to save them.

Return Type
Nothing

Example
This example saves the active reportit exits Impromptu.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.Save objImpApp.Quit Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ReExecute Method
Syntax
ReportDocument.ReExecute

Applies To
ReportDocument Object 592 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Description
Re-executes the query for the current report.

Discussion
Use the ReExecute method to execute the query for a specified report. The difference between the ReExecute method and the RetrieveAll method is that ReExecute actually executes the query again whereas RetrieveAll simply brings back data based on the current database cursor. If there were changes to the database since the last query execution, RetrieveAll will not reflect these changes whereas ReExecute will.

Return Type
Nothing

Example
This example runs the report query to reflect changes in the database since the last query was performed.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.ReExecute Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Related Topics
"RetrieveAll Method" (p. 597)

Remove Method
Syntax
collection.Remove(Index)

Applies To
DeniedTables Collection DeniedColumns Collection DeniedSchemas Collection DeniedCatalogs Collection DeniedFolderItems Collection DeniedSelectValues Collection

Description
Removes the item from the reference collection.

Discussion
If you want to remove an item from an ownership collection, use the Delete method. Parameters Index Description Required. Specifies the index number or the name of the item to remove. Type: Variant

Administration Guide 593

Chapter 55: Methods

Return Type
Nothing

Example
This example removes the first Table object from the DeniedTables collection. This macro will run only if denied tables exist.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDenTableObj As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) Set objDenTableObj = objUser.DeniedTables(1) objUser.DeniedTables(1).Remove objDenTableObj Set objDenTableObj = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedCatalogs Property" (p. 632) "DeniedColumns Property" (p. 633) "DeniedFolderItems Property" (p. 634) "DeniedSchemas Property" (p. 635) "DeniedSelectValues Property" (p. 635) "DeniedTables Property" (p. 636)

RemoveFilterFor Method
Syntax
UserClass.RemoveFilterFor(ObjectFiltered)

Applies To
UserClass Object

Description
Removes a filter for the input object.

Discussion
Use this method to remove the filter expression from the Column or Table object set by the CreateFilterFor method. These objects are thus removed from the FilteredTables and FilteredColumns collection. An error occurs when the parameter is not a Column or Table object. Parameters ObjectFiltered Description Required. Specifies the filter object, either a Column or Table for the user class. Type: Object

Return Type
Nothing

594 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Example
This example removes the filter expression for the specified column.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.RemoveFilterFor objDB.Tables _ ("COUNTRY").Columns("COUNTRY") Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

RemoveQualificationLevel Method
Syntax
Database.RemoveQualificationLevel

Applies To
Database Object

Description
Removes the qualification level immediately below the Database object.

Discussion
All lower level objects will be moved under the database. For example, if the Database object contains two qualification levels and this method is used, the catalog qualification level is removed the Database object will have Tables qualified by Schemas. This method will fail if the Database object doesnt have any qualification levels. It will also fail if, by removing the qualification level, two items of the same name will be in the same collection. For example, if removing the schema qualification level places two tables with the same name in the Tables collection, the method will fail.

Return Type
Nothing

Example
This example removes the qualification level directly below the Database object.
Sub Main() Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\GOSample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") objDB.RemoveQualificationLevel objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Administration Guide 595

Chapter 55: Methods

Reset Method
Syntax
PublishHTML.Reset

Applies To
PublishHTML Object

Description
Resets the PublishHTML object to the settings as they were last saved in the Save as HTML options dialog box and the HTML tab of the Report Properties dialog box.

Discussion
If youve never changed the settings, the defaults are: TOC = True FromPage = 1 ToPage = 65535 TOCByPageNumber = False SuppressTOCDuplicates=False ExportMetaTags=False If the method is successful, a value of True is returned. If the method failed, a value of False is returned.

Return Type
Boolean

Example
This example opens an Impromptu report that contains sales information and publishes the report in HTML format so that the user can use a Web browser to view it.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\sample.cat" , "Creator" Set objImpRep = objImpApp.OpenReport _ ("c:\Program Files\cognos\<rendition_id>\samples\Impromptu\Reports" & _ "\Sales by Country (Publish as HTML).imr") ' set publishing options objImpRep.PublishHTML.Reset objImpRep.PublishHTML.FromPage = 2 objImpRep.PublishHTML.ToPage = 4 objImpRep.PublishHTML.TOCByPageNumber = 0 objImpRep.PublishHTML.ClearTOCColumns objImpRep.PublishHTML.TOCAddColumn "Country" objImpRep.PublishHTML.Publish "c:\temp","myfiles" Set objImpRep = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number: " & Err & " occurred at line " & Erl Resume Done End Sub

596 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

RetrieveAll Method
Syntax
ReportDocument.RetrieveAll

Applies To
ReportDocument Object

Description
Retrieves all data from the database for the active report.

Discussion
Use this method to retrieve all rows from the database for the active report.

Return Type
Nothing

Example
This example retrieves all the rows from the connected database for the active report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.RetrieveAll Set objImpRep = Nothing Set objImpApp = Nothing End Sub

RetrieveRows Method
Syntax
ReportDocument.RetrieveRows Rows

Applies To
ReportDocument Object

Description
Retrieves a specific number of rows from the database for the active report.

Discussion
Use this method to retrieve a specific number of rows from the database for the active report. For example, you can retrieve the first 200 rows from the database. Parameters Rows Description Required. Specifies the number of rows to retrieve from the database. Type: Integer

Return Type
Long

Example
This example retrieves 200 rows from the database for the active report.

Administration Guide 597

Chapter 55: Methods


Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.RetrieveRows 200 Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Save Method (Catalogs)


Syntax
Catalog.Save

Applies To
Catalog Object

Description
Saves the open catalog.

Discussion
The save method is only necessary when the macro does not close the catalog or quit the application. For the Catalog object, the catalog is saved using the name in its Filename property. An error results if the filename is invalid or if the save-location is inaccessible.

Return Type
Nothing

Example
This example adds the table called COUNTRY to the tables collection and saves the changes to the open catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables.Add "COUNTRY","00123ABC,0f0d0e0b" objImpCat.Save Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Other Save Methods


"Save Method (Reports)" (p. 598)

Save Method (Reports)


Syntax
ReportDocument.Save [SaveAsSnapshot]

Applies To
ReportDocument Object

598 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Description
Saves the active report either as an Impromptu report or as a snapshot.

Discussion
Use this method to save reports as snapshots when you want to run reports without opening a catalog want a static view of the data at a specific time want to view the report without access to the database source do not need to add new tables or data to you report Parameters SaveAsSnapshot Description Optional. Specifies whether to save the active report as a snapshot. Type: Boolean TRUE (-1) = save as snapshot FALSE (0) = save as a report (default)

Return Type
Nothing

Example
This example saves the current report and exits Impromptu.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.Save objImpApp.Quit Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Other Save Methods


"Save Method (Catalogs)" (p. 598)

SaveAs Method
Syntax
ReportDocument.SaveAs ReportName ,[Description] ,[SaveAsSnapshot]

Applies To
ReportDocument Object

Description
Saves the active report with a different name than its current one.

Discussion
Use the SaveAs method to save an active report under a new file name or in a different location. For example, you can update the name of a report so that it contains the current date by using the Date$ function together with the SaveAs method, as followings:
Fname$ = "TTLS" + Mid$(Date$,1,2) _ + Mid$(Date$,4,2)

Administration Guide 599

Chapter 55: Methods


ImpRep.SaveAs FName$

Parameters ReportName

Description Required. Specifies the name and location of the new report. Type: String

Description

Optional. Specifies a description for the new report Type: String Optional. Specifies whether to save the report as a snapshot. Type: Boolean TRUE (-1) = save as snapshot FALSE (0) = save as a report Default: False

SaveAsSnapshot

Return Type
Nothing

Example
This example saves the active report and gives it a new name.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strRepName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument strRepName = "NewName.imr" objImpRep.SaveAs "C:\Cognos\Reports\" & strRepName Set objImpRep = Nothing Set objImpApp = Nothing End Sub

SetProcedure Method
Syntax
StoredProcedure.SetProcedure "ProcedureName([[Descriptor] IN] [,[Descriptor] IN]... [,[Descriptor] OUT] [,[Descriptor] OUT]...) [STATUS]"

Applies To
StoredProcedure Object

Description
Sets the name, placeholders for input and output parameters, and a placeholder for the return value for a database stored procedure.

Discussion
Use the SetProcedure method to set the name and parameters when executing a database-stored procedure. Before you attempt to run a database-stored procedure, you must know: the stored procedure name; the datatype, order, and number input and output parameters for the stored procedure; the maximum size of any variable length parameters (such as VARCHAR and CHAR strings) for the stored procedure. Parameters can be 600 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods in out in out

You can pass a value to the stored procedure and expect the stored procedure to return a different value using the same argument. For Descriptor, specify one of CHAR[n], VARCHAR[n], or LONGVARCHAR[n], where n is the maximum size of the variable length parameter. Impromptu's stored procedure methods do not support other variable length types (such as VARBINARY[n]). The square brackets ( [.] ) surrounding the maximum size indicator are required syntax. For stored procedures that don't use variable length input or output parameters, you can specify only the IN and OUT keywords to indicate that parameters will be passed when the procedure is executed. Later, when you use the Execute method to execute the stored procedure, replace each instance of IN and OUT with variables that you've defined in the IBM CognosScript macro. Similarly, if the stored procedure returns a value and you want to obtain that value in Impromptu, you must include the STATUS keyword in the SetProcedure method. When you later use the Execute method to execute the stored procedure, assign its return value to a variable that also replaces the STATUS keyword. You can include a total of 15 input and output parameters in a SetProcedure declaration. For example, the following statements create variables for use as input parameters and a return value for a stored procedure. The stored procedure, called sp_do_cust_sales, takes a customer number, a start date, and an end date as input parameters. It then creates a new table for the specified customer and returns the total sales for that customer within the specified time period. (The details of the stored procedure are not included here.)
. . . Dim CustNo As Integer Dim StartDate As Long Dim EndDate As Long Dim TotalSales As Single ImpSP.SetProcedure "sp_do_cust_sales(IN, IN, IN) STATUS" TotalSales = ImpSP.Execute CustNo, StartDate, _ EndDate, TotalSales . . .

Note: TotalSales is used both within the Execute method and as the variable for the return value. If you don't specify variable types for the input and output parameters of the STATUS value, they're created as variants. The quotation marks are required syntax. Parameters ProcedureName Description Required. Specifies the name of the stored procedure as defined in the database. Type: String

Administration Guide 601

Chapter 55: Methods Parameters Descriptor Description Optional. Specifies the datatype and size of the parameters. Required only for stored procedures with variable length input or output parameters. Type: Variant Enter one of the following: VARCHAR[n] LONGVARCHAR[n] CHAR[n] Type: Variant IN, OUT STATUS Optional. Specifies one or more parameter placeholders. Type: Variant Optional. Provides a value placeholder for stored procedures which return a value. Type: Variant

Return Type
Nothing

Title Method
Syntax
ReportDocument.Title Title

Applies To
ReportDocument Object

Description
Returns or sets the report description.

Discussion
Use the Title property to: change the report description; return the current value of the report description. Parameters Title Description Optional. Specifies the report description. Type: String

Return Type
String

Example
This example uses the name of the active report as the description and then shows the new description.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim strImpRep As String

602 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods


Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument Set strImpRep = Left$(objImpRep.Name, Len _ (objImpRep.Name) - 4) objImpRep.Title strImpRep Msgbox "The Report Description is: " _ & objImpRep.Title Set objImpRep = Nothing Set objImpApp = Nothing End Sub

TOCAddColumn Method
Syntax
PublishHTML.TOCAddColumn(Column) PublishExcel.TOCAddColumn(Column)

Applies To
PublishHTML Object

Description
Adds the specified grouped column to the Report Navigator when a report is published as HTML and PDF.

Discussion
If TOCAddColumn is successful, a value of True is returned. If TOCAddColumn fails, a value of False is returned. If you add a non-grouped or non-associated column, an error occurs.

Note:
For the Column parameter, the 0-based index is the index of all columns in the query, not just the grouped columns. Parameters Column Description Required. Specifies the name or index number of the new column to add to the Report Navigator. (The index count begins at 0). Type: String or Long

Return Type
Boolean

Example
This example opens an Impromptu report that contains sales information and publishes it in HTML format so that it can be viewed using a Web browser.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\sample.cat" , "Creator" Set objImpRep = objImpApp.OpenReport _ ("c:\Program Files\Cognos\<rendition_id>\samples\Impromptu\Reports" & _ "\Sales by Country (Publish as HTML).imr") ' set publishing options objImpRep.PublishHTML.Reset objImpRep.PublishHTML.FromPage = 2 objImpRep.PublishHTML.ToPage = 4 objImpRep.PublishHTML.TOCByPageNumber = 0

Administration Guide 603

Chapter 55: Methods


objImpRep.PublishHTML.ClearTOCColumns objImpRep.PublishHTML.TOCAddColumn "Country" objImpRep.PublishHTML.Publish "c:\temp","myfiles" Set objImpRep = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number: " & Err & " occurred at line " & Erl Resume Done End Sub

UpdateCatalog Method
Syntax
Application.UpdateCatalog

Applies To
Application Object

Description
Updates the open catalog.

Discussion
Use the UpdateCatalog method to refresh the contents of an open distributed catalog based on changes in the source catalog. This method is valid only when the open catalog is a local copy of a distributed master catalog.

Return Type
Nothing

Example
This example updates a distributed catalog based on any changes made to the master catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog objImpApp.UpdateCatalog Set objImpCat = Nothing Set objImpApp = Nothing End Sub

UseDatabase Method
Syntax
ReportDocument.UseDatabase

Applies To
ReportDocument Object

Description
Changes the active report from using snapshot data to using data from the database.

Discussion
If the macro is currently using data that is stored in a snapshot and you want to access data from the database, use this method to return to database access. 604 IBM(R) Cognos(R) Impromptu(R)

Chapter 55: Methods

Return Type
Nothing

Example
This example changes the active report from a snapshot to a report that retrieves data from the database. To run this macro, you must first use a report that was saved as a snapshot.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument objImpRep.UseDatabase Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Visible Method
Syntax
object.Visible Flag

Applies To
Application Object ReportDocument Object

Description
Sets or returns whether the Impromptu Application or ReportDocument is visible when activated in an OLE automation script.

Discussion
By default, the visibility of the Impromptu report document is the same as the Impromptu application. That is, if you run the application invisibly, the report document will also run invisibly. Default: False Tip: It's a good idea to set the report document and the application to run visibly when you first create a macro. By displaying the report and the application, you can debug your macros more effectively. In addition, if errors occur when Impromptu is running invisibly and no Quit method has been specified, then Impromptu remains in memory and you'll be unable to load it again. If this happens, write a simple macro that creates an Impromptu application object and then use the Quit method for that object. This should clean the application. Parameters Flag Description Optional. Specifies whether the Application or ReportDocument object is visible. Type: Boolean True = visible False = not visible

Return Type
Boolean

Example
This example makes the Impromptu Application visible.

Administration Guide 605

Chapter 55: Methods


Sub Main() Dim objImpApp As Object Const Catalog_Name = "C:\Program Files\Cognos\<rendition_id>" & _ "samples\Impromptu\Reports\Great Outdoors Sales Data.cat" Const True = -1 Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog Catalog_Name, "Creator" objImpApp.Visible True Set objImpApp = Nothing End Sub

606 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Name ActiveCatalog Property ActiveDocument Property ActiveUserClass Property AllSelectedFrames Property Application Property CanAddOrModifyFolders Property CanAddOrModifyUserClasses Property

Description Returns the active catalog object. Returns the active report document. Returns the active user class. Returns a list of the selected frame objects and their child objects on the active Report Document. Returns the Impromptu Application object. Sets or returns whether the UserClass object can add or modify folders. Sets or returns whether the UserClass object can add or modify user classes.

CanCreateNewReports Property Sets or returns whether the UserClass object can create new reports. CanDirectEnterSQL Property CatalogLevels Property CatalogName Property CatalogOpened Property Columns Property Condition Property ConnectionString Property Count Property CreatorUserClass Property CrossProductPermission Property CSVExportOptions Property Sets or returns whether the UserClass object can enter SQL Queries. Returns a collection of all underlying catalog qualification levels. Returns the name of the catalog for the specified application. Returns a Boolean value based on whether the application has a catalog open. Returns a collection of Column objects owned by the Table object. Returns the join expression. Returns the fully-qualified location of the database. Returns the number of objects in the collection. Returns the active user class object if you are the creator of the catalog. Sets or returns whether the UserClass object has cross-product permission. Determines how leading zeroes in text and numeric values with null or missing values are handled in a ReportDocument when CSV output is generated and viewed in Microsoft Excel. Returns whether the database is connected to the catalog. Returns a collection of DatabaseConnection objects for the UserClass object. Administration Guide 607

DatabaseConnected Property DatabaseConnections Property

Chapter 56: Properties

Name DatabaseDefinitions Property DatabaseItem Property Databases Property DBObject Property Definition Property DeniedCatalogs Property DeniedColumns Property DeniedFolderItems Property DeniedSchemas Property DeniedSelectValues Property

Description Returns a collection of defined databases, indexed by logical name. Returns a string giving the fully qualified database column name of a selected text frame in a SelectedFrames collection. Returns a collection of Database objects. Returns the Database object associated with the connection. Returns the database connection string from the Cognos.ini file or the DatabaseDefinition object. Returns a collection of CatalogLevel objects to which the UserClass object is denied access. Returns a collection of Column objects to which the UserClass object is denied access. Returns a collection of FolderItem objects to which the UserClass object is denied access. Returns a collection of SchemaLevel objects to which the UserClass object is denied access. Returns a collection of FolderItem objects to which the UserClass object is denied permission to perform a select values operation. Returns a collection of Table objects to which the UserClass object is denied access. Sets or returns the textual description of the Catalog. Sets or returns the password for logging onto the database or for logging onto a catalog as a userclass. Returns which document has returned errors when running multiple documents. Determines whether HTML meta tags will be added to the HTML report output. Determines which report objects are added to Microsoft Excel report output. Returns the name and location of the Catalog. Returns a collection of Column objects for which the UserClass object has filters. Returns a collection of Table objects for which the UserClass object has filters. Returns a reference to the catalog folder item for the query item in the report. Returns the folder path for the catalog folder item for the query item in the report. Returns the top-level Items collection in a catalog. Returns a string that contains the fully-qualified formula for a selected text frame. Returns the string representation of an expression. Returns the string representation of an expression that includes the select all support for prompts.

DeniedTables Property Description Property EncryptedPassword Property ErrorDocument Property ExportMetaTags Property ExportOptions Property Filename Property FilteredColumns Property FilteredTables Property FolderItem Property FolderPath Property Folders Property Formula Property FormulaEx Property FormulaExB Property

608 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Name FromPage Property FullName Property HasTextBlobLimit Property IsDistributed Property IsExternal Property IsKey Property IsLocked Property IsSynonym Property Item Property Items Property LeftTable Property

Description Sets or returns which page of the Impromptu report will be the first page of the HTML report output. Returns the full name of the application or document, including the path. Sets or returns whether the UserClass object has a text-blob limit. Sets or returns whether the object is distributed. Returns whether the database is an external HotFile. Sets or returns whether the Column object is a key. Sets or returns whether the catalog is locked. Sets or returns whether the table is a synonym. Returns the specified object in the collection. Returns a collection of child FolderItem objects. Returns the "left" table in the single-step link.

MasterCatalogFilename Property Returns the filename for the master catalog. MasterName Property MasterTable Property MaxQueryExecutionTime Property MaxRowsRetrieved Property MaxTablesPerReport Property MaxTextBlobCharacters Property MetaDataItem Property MetaDataPath Property MinimizeConnectTime Property Modified Property Name Property NameSpace Property NonIndexSortingPermission Property OuterJoinPermission Property Parent Property Returns the name of the master table if the Table object is an alias; otherwise, returns the name of the table. Returns the MasterTable object if the Table object is an alias. Sets or returns the time limit to run a query for the UserClass object. Sets or returns the maximum number of rows the UserClass object can retrieve. Sets or returns the maximum number of tables the UserClass object can retrieve. Sets or returns the maximum number of text-blob characters for the UserClass object. Returns a reference to the metadata item for the query item in the report. Returns the metadata path for the query item in the report. Sets or returns whether the connect time is minimized. Returns whether the active report has been modified since the last time it was saved. Sets or returns the name of the object. Sets or returns a namespace for the catalog. Sets or returns whether the UserClass object can sort non-indexed columns. Sets or returns the outer join permission for the UserClass object. Returns the parent object.

Administration Guide 609

Chapter 56: Properties

Name Path Property PlainTextPassword Property PublishHTML Property PublishPDF Property QualificationLevel Property QueryExecutionTimeWarnAfter Property QueryItem Property QueryProcessing Property ReadIsolationLevel Property ResultType Property RightTable Property RowsRetrievedWarnAfter Property SchemaLevels Property SelectDistinctPermission Property SelectedFrames Property SQL Property SuppressTOCDuplicates Property TableLinks Property Tables Property TablesPerReportWarnAfter Property TOC Property TOCByPageNumber Property ToPage Property Type Property

Description Returns the path in which the document is stored. Sets the unencrypted password for the database. Returns an object that is an HTML representation of a Report Document object. Returns an object that is a PDF representation of a Report Document object. Sets or returns the number of parent names that precede the table name in the SQL statement. Sets or returns the time for the query execution at which the UserClass object is warned. Returns a report query column name. Sets or returns the state of query processing for the UserClass object. Sets or returns the read-transaction isolation level to request when connecting to the database. Returns the type of value for an expression. Returns the "right" table in the join. Sets or returns the number of rows retrieved at which the UserClass object is warned. Returns a collection of SchemaLevel objects. Sets or returns whether the UserClass object can set the query to select distinct values in a database. Returns a list of the selected frame objects on the active Report Document. Returns the SQL string from the Profile tabQuery dialog box. Sets or returns whether report footer information is added to the Report Navigator when a report is saved as HTML. Returns a collection of TableLink objects. Returns a collection of Table objects. Sets or returns the number of tables used per report at which the UserClass object is warned. Sets or returns whether the HTML and PDF report output includes the Report Navigator. Sets or returns whether the Report Navigator contains page numbers and activates the Report Navigator. Sets or returns which page of the Impromptu report will be the last page of the HTML report output. Depending on the object, sets or returns the data type of the Column object, the type of join, the query item or the type of database. Sets or returns a unique metadata identification for the object.

UniqueID Property

610 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Name UseQueryWarnings Property UserClasses Property UserName Property Value Property Version Property Weight Property WindowState Property

Description Sets whether Impromptu ignores governor restriction warnings when executing a query. Returns a collection of UserClass objects based on this UserClass object. Sets or returns the name used to log onto the database. Returns the Expression object associated with the FolderItem object. Defines the Microsoft Excel version of the exported report. Sets or returns the weight of the table. Sets or returns the Application window state (minimized, maximized or last setting).

Related Topics
"Collections" (p. 487) "Methods" (p. 507) "Objects" (p. 461)

ActiveCatalog Property
Syntax
Application.ActiveCatalog

Applies To
Application Object

Description
Returns the active catalog.

Discussion
Use this property to get the active Catalog object. The active catalog is the same as the Catalog object, and can be manipulated the same way as the Catalog object. Only one catalog at a time can be open.

Type
Object

Access
Read

Example
This example creates a catalog and attaches it to the OUTDOORS database. In this case, GO Sample is the active catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.CreateCatalog "GO Sample.cat", "OUTDOORS" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders objImpCat.Description = "Great Outdoors Sales Data Sample"

Administration Guide 611

Chapter 56: Properties


objCatFolders.AddFolder "Admin." objImpCat.Close Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Catalog Object" (p. 464)

ActiveDocument Property
Syntax
Application.ActiveDocument

Applies To
Application Object

Description
Returns the currently active Report Document object for the specified Application object.

Discussion
When you have several reports open in an automation script, use the ActiveDocument property to write a generic subroutine that can access the methods of the active report. In this way, you don't have to write separate subroutines to operate on the various reports in your script.

Type
Object

Access
Read

Example
This example returns the name of the active report in a message box. To run this macro you must first open a report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument MsgBox objImpRep.Name Set objImpRep = Nothing Set objImpApp = Nothing End Sub

ActiveUserClass Property
Syntax
Catalog.ActiveUserClass

Applies To
Catalog Object

Description
Returns the active user class.

612 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Discussion
Only the "Creator " UserClass object can edit itself. Other user classes may be able to modify their subordinate classes. See UserClass Object for details.

Type
Object

Access
Read

Example
This example creates a user class profile for the active user class.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass objUser.PlainTextPassword = "creator" objUser.QueryProcessing = 3 objUser.MinimizeConnectTime = false objUser.CrossProductPermission = 2 Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"UserClass Object" (p. 484)

AllSelectedFrames Property
Syntax
ReportDocument.AllSelectedFrames

Applies To
ReportDocument Object

Description
Returns a list of selected frame objects and their corresponding child objects on the active Report Document.

Discussion
AllSelectedFrames returns a list of pointers to each frame object selected on the Report Document. The list, also called the SelectedFrames collection, is arranged in the order in which the objects were selected. Each object in the list is followed by any child objects of the parent . Individual SelectedFrame objects within the collection can be referenced by adding an index value to the property:
report.AllSelectedFrames(2)

Or, you can use the Item property with an index value:
SelectedFrames.Item(2)

Use the Count property first to determine the number of objects in the collection.

Administration Guide 613

Chapter 56: Properties

Example
This example returns the number of SelectedFrames in each of two SelectedFrames collections created, objList and objFullList. The AllSelectedFrames property returns the objFullList collection.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim objList As Object Dim objFullList As Object Dim intParentFrames As Integer Dim intChildFrames As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument Set objList = objImpRep.SelectedFrames Set objFullList = objImpRep.AllSelectedFrames intParentFrames = objList.Count intChildFrames = objFullList.Count - objList.Count MsgBox "Parent Frames:" & intParentFrames MsgBox "Child Frames:" & intChildFrames Set objFullList = Nothing Set objList = Nothing Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Related Topics
"SelectedFrame Object" (p. 480) "SelectedFrames Collection" (p. 502) "SelectedFrames Property" (p. 692)

Application Property
Syntax
object.Application

614 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Applies To
Application Object CatalogLevel Object Column Object Database Object DatabaseDefinitions Collection DatabaseConnection Object DeniedCatalogs Collection DeniedFolderItems Collection DeniedSelectValues Collection FilteredColumns Collection FolderItem Object Items Collection PublishPDF Object SchemaLevel Object SelectedFrame Object Table Object TableLink Object UserClass Object Catalog Object CatalogLevels Collection Columns Collection DatabaseConnections Collection Databases Collection DatabaseDefinition Object DeniedColumns Collection DeniedSchemas Collection DeniedTables Collection FilteredTables Collection Folders Collection PublishHTML Object ReportDocument Object SchemaLevels Collection SelectedFrames Collection Tables Collection TableLinks Collection UserClasses Collection

Description
Returns the Impromptu Application object.

Discussion
Use the Application property to access the Application methods for the active report. For example, if the active report is an OLE object called ImpRep, you can change the printer for the active report by accessing the FileSetPrinter method for the Application object as follows:
ImpRep.Application.FileSetPrinter "PostScript Printer on LPT1"

By using the Application property, you don't have to know the precise name of the Application object that contains the report object.

Type
Object

Access
Read

Example
This example accesses the methods exposed by the Impromptu Application object to print the active report. The name of the application is shown to the user.
Sub Main()

Administration Guide 615

Chapter 56: Properties


Dim objImpApp As object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\Great Outdoors Sales Data.cat" _ ,"Creator",,,,1 Set objImpRep = _ objImpApp.OpenReport("c:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\Customer Discount.imr") objImpRep.Application.FileSetPrinter _ "PostScript Printer on LPT1" MsgBox "The current application is " &objImpRep.Application objImpRep.CloseReport objImpApp.Quit End Sub

CanAddOrModifyFolders Property
Syntax
UserClass.CanAddOrModifyFolders

Applies To
UserClass Object

Description
Sets or returns whether the UserClass object can add or modify folders.

Discussion
Use this property to determine whether the UserClass object can add or modify folders in the catalog. Default: True Note: Your choice of catalog type at the time of catalog creation sets up the initial default values for this property. In personal distributed catalogs all user classes can add folders and modify the folder structure, but the Creator user class can modify what has been defined in the master distributed catalog and inherited in the distributed catalog copies. In a shared or secured catalog , only the Creator user class can modify the catalog structure. When you edit a shared catalog, other users cannot open the catalog. You cannot edit an open shared catalog if other users are using the catalog.

Type
Boolean

Access
Read/Write

Example
This example gives the active user class permission to add or modify catalog folders and to enter SQL statements directly into report queries. However, this user class cannot add or modify user classes.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.CanAddOrModifyFolders = true

616 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


objUser.CanAddOrModifyUserClasses = false objUser.CanDirectEnterSQL = true Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CanAddOrModifyUserClasses Property
Syntax
UserClass.CanAddOrModifyUserClasses

Applies To
UserClass Object

Description
Sets or returns whether the UserClass object can add or modify user classes.

Discussion
Use this property to determine whether the UserClass object can add or modify user classes in the catalog. Default: True Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Boolean

Access
Read/Write

Example
This example does not give the active user class permission to the add or modify user classes. However, this user class can add or modify catalog folders and enter SQL statements directly into report queries.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.CanAddOrModifyFolders = true objUser.CanAddOrModifyUserClasses = false objUser.CanDirectEnterSQL = true Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CanCreateNewReports Property
Syntax
UserClass.CanCreateNewReports

Administration Guide 617

Chapter 56: Properties

Applies To
UserClass Object

Description
Sets or returns whether the UserClass object can create new reports.

Discussion
Use this property to determine whether the UserClass object can create new reports from the catalog. Default: True Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Boolean

Access
Read/Write

Example
This example gives the active user class permission to create new reports from the catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.CanCreateNewReports = true Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CanDirectEnterSQL Property
Syntax
UserClass.CanDirectEnterSQL

Applies To
UserClass Object

Description
Sets or returns whether the UserClass object can enter SQL queries.

Discussion
Use this property to determine whether the UserClass object can enter SQL queries directly in the report Default: True for the Creator, False for its children Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Boolean 618 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Access
Read/Write

Example
This example gives the active user class permission to enter SQL statements directly into report queries. However, this user class cannot add or modify catalog folders or add or modify user classes. Direct entry SQL is usually a privilege extended to only the Creator because the user class may access stored procedures within the database and write to the database.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = IobjmpCat.ActiveUserClass.UserClasses(1) objUser.CanAddOrModifyFolders = false objUser.CanAddOrModifyUserClasses = false objUser.CanDirectEnterSQL = true Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CatalogLevels Property
Syntax
Database.CatalogLevels

Applies To
Database Object

Description
Returns an collection of CatalogLevel objects.

Discussion
If the Database object does not support catalog qualification, trying to access a specific CatalogLevel object will fail.

Type
Object

Access
Read

Example
This example shows the name of the first CatalogLevels collection.
Sub Main() Dim objImpApp As Object Dim objCatalogLevels As Object Set objImpApp = CreateObject("Impromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\oSample.cat", _ "Creator",,"aaa","bbb", True Set objCatalogLevels = _ objImpApp.ActiveCatalog.Databases(1).CatalogLevels If Not objCatalogLevels Is Nothing Then MsgBox "First catalog level name is " _ & objCatalogLevels(1).Name Else

Administration Guide 619

Chapter 56: Properties


MsgBox "This database doesn't support catalog levels." End If Set objCatalogLevels = Nothing Set objImpApp = Nothing End Sub

CatalogName Property
Syntax
Application.CatalogName

Applies To
Application Object

Description
Returns a string containing the name of the currently open catalog.

Discussion
If no catalog is currently open, CatalogName returns an empty string.

Return Type
String

Example
This example shows the name of the active catalog.
Sub Main() Dim objImpApp As Object Dim strCatName As String Set objImpApp = CreateObject("CognosImpromptu.Application") strCatName = objImpApp.CatalogName If strCatName <> "" Then Msgbox "The currently open catalog is:" & strCatName Else Msgbox "No catalog is currently open." End If Set objImpApp = Nothing End Sub

CatalogOpened Property
Syntax
Application.CatalogOpened

Applies To
Application Object

Description
Returns a Boolean value based on whether the application has a catalog open.

Discussion
Use this property when you want to run reports. When you open a report the associated catalog opens. Only one catalog can be open at a time. If there is a catalog open you must close it before you run a report based on another catalog. If no catalog is open, the property returns false. Default: False

620 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Return Type
Boolean

Example
This example shows a message that indicates whether a catalog is open.
Sub Main() Dim objImpApp As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Const Cat_Open = -1 If objImpApp.CatalogOpened = Cat_Open Then Msgbox "There is an open catalog." Else Msgbox "No catalog is currently open." End If Set objImpApp = Nothing End Sub

Columns Property
Syntax
Table.Columns

Applies To
Table Object

Description
Returns a collection of Column objects owned by the Table object.

Discussion
The Column objects in the Columns collection can be indexed either by name or by number.

Type
Object

Access
Read

Example
This example shows the name of the first column in the COUNTRY table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objColumnName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objColumnName = objDB.Tables("COUNTRY").Columns(1).Name MsgBox objColumnName Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Administration Guide 621

Chapter 56: Properties

Condition Property
Syntax
TableLink.Condition

Applies To
TableLink Object

Description
Returns the Expression object representing the join.

Discussion
Before you can create joins between tables, you must know how the table columns are related. Use the Condition property to create, remove, analyse or test joins. Joins between tables usually use Impromptu keys created from the corresponding database primary keys in one table and database foreign keys in the other table of a one-to-many relationship. The correspondence between tables in an equi-join is determined by identical values (=) in the columns that join the tables. The expression that describes a non-equi-join uses comparison operators: <> not equal to < less than > greater than <= less than or equal to >= greater than or equal to

Type
Object

Access
Read

Example
This example creates an inner join between the BRANCH_CD column in the BRANCH table and the BRANCH_CD column in the CUSTSITE table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objNewLink As Object Dim objNewLinkExpression As Object Dim strCondition as String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) Set objNewLink = objImpCat.TableLinks.Add (objDB.Tables _ ("BRANCH"), objDB.Tables("CUSTSITE")) Set objNewLinkExpression = objNewLink.Condition With objNewLinkExpression .Append objDB.Tables("BRANCH").Columns("BRANCH_CD") .Append 24 '= .Append objDB.Tables("CUSTSITE").Columns("BRANCH_CD") .Commit End With Set objNewLinkExpression = Nothing Set objNewLink = Nothing Set objDB = Nothing

622 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Expression Object" (p. 470)

ConnectionString Property
Syntax
DatabaseDefinition.ConnectionString

Applies To
DatabaseDefinition Object

Description
Returns the fully-qualified location of the database.

Discussion
The ConnectionString contains security prompt, host, database type and location information that is specific to each database. Impromptu uses this information to open the database. The security prompt information indicates the number of parameters in the ConnectionString. Each parameter starts with a caret (^) and is followed by a name that identifies the parameter. If the caret is following by a question mark, Impromptu does not echo user input when it prompts the user for values. For example, the security prompt value is usually ^User ID:^?Password: The host information is always LOCAL, the database type is a two-character code representing the database type and the location information format varies depending on the type of database. For the location information, Impromptu replaces any % characters from left to right with values from the security prompts information.

Type
String

Access
Read

Example
This example shows the location of the attached database.
Sub Main() Dim objImpApp As Object Set objImpApp = CreateObject("CognosImpromptu.Application") MsgBox objImpApp.DatabaseDefinitions("OUTDOORS").ConnectionString Set objImpApp = Nothing End Sub

Count Property
Syntax
collection.Count

Administration Guide 623

Chapter 56: Properties

Applies To
CatalogLevels Collection Columns Collection DatabaseConnections Collection DatabaseDefinitions Collection Databases Collection DeniedCatalogs Collection DeniedColumns Collection DeniedFolderItems Collection DeniedSchemas Collection DeniedSelectValues Collection DeniedTables Collection FilteredColumns Collection FilteredTables Collection Folders Collection Items Collection SchemaLevels Collection SelectedFrames Collection TableLinks Collection Tables Collection UserClasses Collection

Description
Returns the number of objects in the collection.

Discussion
Use this property in a For...Next loop to count to the end of the collection.

Type
Integer

Access
Read

Example
This example returns the number of tables in the active catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim intNumTables As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\test.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) intNumTables = objDB.Tables.Count MsgBox intNumTables Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CreatorUserClass Property
Syntax
Catalog.CreatorUserClass

Applies To
Catalog Object 624 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Description
Returns the active user class object if you are the creator of the catalog.

Discussion
Use this property to show creator user class details such as query restrictions, security levels, filters and other permissions. Only the "Creator" UserClass object can edit itself. Other user classes may be able to modify their subordinate classes. See UserClass Object for details. If you are not the creator of the catalog, this property returns nothing.

Type
Object

Access
Read

Example
This example creates a user class profile for the creator user class.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.CreatorUserClass objUser.PlainTextPassword = "creator" objUser.QueryProcessing = 3 objUser.MinimizeConnectTime = true objUser.CrossProductPermission = 2 Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

CrossProductPermission Property
Syntax
UserClass.CrossProductPermission

Applies To
UserClass Object

Description
Sets or returns whether the UserClass object has cross-product permission.

Discussion
Use this property to determine whether a UserClass object can create cross-product reports, is warned when attempting to them, or is prevented from them. Use the following values for this property: 0 = Allow 1 = Warn 2 = Prevent (Default) Default: 2

Administration Guide 625

Chapter 56: Properties Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Integer

Access
Read/Write

Example
This example gives the active user class permission to create cross-product reports.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.CrossProductPermission = 0 Set User = Nothing Set ImpCat = Nothing Set ImpApp = Nothing End Sub

CSVExportOptions Property
Syntax
ReportDocument.CSVExportOptions

Applies To
ReportDocument Object

Description
Determines how leading zeroes in text and numeric values with null or missing values are handled in a ReportDocument when CSV output is generated and viewed in Microsoft Excel.

Discussion
When you create a report and generate comma delimited ASCII (.csv) file output, use the CSVExportOptions property to specify how to generate leading zeroes in text numeric values with null or missing values If no value is assigned to the CSVExportOptions property, it returns the value specified in the report properties. The default value is obtained from the report properties. The options available include Option 0 Description Generates CSV output with neither the Mark text fields for import into Microsoft Excel nor the Output numeric fields with missing values as 0(zero) option specified. When the output is viewed in Microsoft Excel, leading zeroes in text fields do not appear, and null or missing values in numeric fields appear as empty cells. This is the default behavior.

626 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties Option 1 Description Generates CSV output with only the Mark text fields for import into Microsoft Excel option specified. When the output is viewed in Microsoft Excel, leading zeroes appear in the text. On export, an equal sign (=) is added before the quotation marks that define the text string containing numerica data. For example, "08310" changes to ="08310". This causes Microsoft Excel to treat the field as text rather than a numeric value, so that it displays any leading zeroes. 2 Generates CSV output with only the Output numeric fields with missing values as 0(zero) option specified. Writes missing numeric values as zero. When the output is viewed in Microsoft Excel, missing values, that is numbers for which the database returned NULL, appear as the number zero. Generates CSV output with both the Mark text fields for import into Microsoft Excel and the Output missing numeric values as 0(zero) options specified. When the output is viewed in Microsoft Excel, leading zeroes appear in text fields, and null or missing values in numeric fields appear as zero.

Type
Integer

Access
Read/Write

Example
This example shows the syntax to use when you create a report and wish to control how leading zeroes in text and numeric values with missing or null values are generated in CSV report output. Two scenarios are provided. In the first scenario, you generate the CSV output with Option 0 specified. In the second, you generate the output with Option 3 specified.
Sub Main() Dim objImpApp As Object Dim objImpReport As Object ' Start up Impromptu and open the report Set objImpApp = CreateObject("CognosImpromptu.Application.cer5") Set objImpReport = objImpApp.OpenReport(imrFilePath) ' Publish to CSV with neither "mark text for Excel" nor "export NULL as zero" objImpReport.CSVExportOptions = 0 objImpReport.ExportASCII outputPath & "\Options_0.csv", true, true, ",", 0 ' Publish to CSV with both "mark text for Excel" and "export NULL as zero" objImpReport.CSVExportOptions = 3 objImpReport.ExportASCII outputPath & "\Options_3.csv", true, true, ",", 0 ' Terminate the impromptu instance objImpReport.CloseReport objImpApp.Quit End Sub

DatabaseConnected Property
Syntax
Application.DatabaseConnected

Applies To
Application Object

Description
Returns whether the database is connected to the catalog. Administration Guide 627

Chapter 56: Properties

Discussion
Returns a Boolean value based on whether the catalog is connected to its database. If the database is connected, the DatabaseConnected method returns -1 (true). Otherwise, the DatabaseConnected method returns 0 (false). Default: False

Return Type
Boolean

Example
This example shows a confirmation message if the database is connected to the catalog.
Sub Main() Dim objImpApp As Object Set objImpApp = CreateObject("Impromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", "Creator", , , , True If objImpApp.DatabaseConnected Then MsgBox "The database is connected." End If Set objImpApp = Nothing End Sub

DatabaseConnections Property
Syntax
UserClass.DatabaseConnections

Applies To
UserClass Object

Description
Returns a collection of DatabaseConnection objects for the UserClass object.

Discussion
The database objects in this collection can only be referenced by name. Note: In this release of Impromptu OLE Automation, there can only be one DatabaseConnection object in the DatabaseConnections collection.

Type
Object

Access
Read

Example
This example shows the user name for the first DatabaseConnection object in the DatabaseConnection collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Dim strUserName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Imp_cat\" & _ "bi admin.cat","Creator",,"biadmin","biadmin" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass strUserName = objUser.DatabaseConnections(1).UserName

628 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


MsgBox strUserName Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

DatabaseDefinitions Property
Syntax
Application.DatabaseDefinitions

Applies To
Application Object

Description
Returns a collection of defined databases, indexed by logical name.

Discussion
The items in this collection are indexed by logical name. They can be referenced by logical name or by index. If the index number or name you specify doesn't exist, the macro will not run.

Type
Object

Access
Read

Example
This example shows the name of the first database in the DatabaseDefinitions collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim strDBName as String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objDB = objImpApp.DatabaseDefinitions strDBName = objDB(1).Name MsgBox "The Name of the first Impromptu Database " & _ "is " & objDBName & "." Set objDB = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DatabaseDefinition Object" (p. 469)

DatabaseItem Property
Syntax
SelectedFrame.DatabaseItem

Applies To
SelectedFrame Object

Description
Returns a string giving the fully qualified database column name of a selected text frame in a SelectedFrames collection. Administration Guide 629

Chapter 56: Properties

Discussion
DatabaseItem returns a string for text frames and an empty string for non-text frames. The string takes this form:
database[.catalog[.schema]].table.column

DatabaseItem returns nothing when referencing calculated items that involve more than one database column.

Type
String

Access
Read

Example
This example shows the fully qualified database column name of a selected text frame in an active report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim objSelectedFrame As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument Set objSelectedFrame = objImpRep.SelectedFrames(1) With objSelectedFrame MsgBox .Name MsgBox .Formula MsgBox .DatabaseItem MsgBox .QueryItem End With Set objSelectedFrame = Nothing Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Databases Property
Syntax
Catalog.Databases

Applies To
Catalog Object

Description
Returns a collection of Database objects.

Discussion
The items in the collection can be indexed by name or by number. Note: In this release of Impromptu OLE Automation, there can only be one Database object in the Databases collection.

Type
Object

Access
Read

630 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Example
This example shows the name of the first Database object in the Database collection connected to the active catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim strDBName As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog strDBName = objImpCat.Databases(1).Name MsgBox strDBName Set objImpCat = Nothing Set objImpApp = Nothing End Sub

DBObject Property
Syntax
DatabaseConnection.DBObject

Applies To
DatabaseConnection Object

Description
Returns the Database object associated with the connection.

Discussion
The DatabaseConnections collection is also a property of the UserClass object.

Type
Object

Access
Read

Example
This example shows the name of the Database object name that is associated with the first DatabaseConnections collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDBConnect As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Imp_cat\" & _ "bi admin.cat","Creator",,"biadmin","biadmin" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass Set objDBConnect = objUser.DatabaseConnections(1) MsgBox objDBConnect.DBObject.Name Set objDBConnect = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"UserClass Object" (p. 484)

Administration Guide 631

Chapter 56: Properties

Definition Property
Syntax
Database.Definition

Applies To
Database Object DatabaseDefinitions Property

Description
Returns the database connection string from the Cognos.ini file or the DatabaseDefinition object.

Discussion
The Cognos.ini file specifies the location of the databases you can use with a catalog. The Cer.ini specifies the location where the Impromptu application and components are stored as well as the default location for temporary result sets. You cannot change the preferences in the Cognos.ini file for the database connection.

Type
String (DatabaseDefinition) Object (Database)

Access
Read

Example
This example shows the location of the attached database, as referenced in the Cognos.ini file.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objDBDefinition as String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objDB = objImpApp.DatabaseDefinitions objDBDefinition = objDB("OUTDOORS").Definition MsgBox objDBDefinition Set objDB = Nothing Set objImpApp = Nothing End Sub

DeniedCatalogs Property
Syntax
UserClass.DeniedCatalogs

Applies To
UserClass Object

Description
Returns a collection of CatalogLevel objects to which the UserClass object is denied access.

Discussion
Use this property to determine the CatalogLevel objects in the DeniedCatalogs collection.

632 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties Any CatalogLevel objects that are in the DeniedCatalogs collection for the parent UserClass object are not inherited by the DeniedCatalogs collection of the child UserClass object.

Type
Object

Access
Read

Example
This example shows the name of the first CatalogLevel object from the DeniedCatalogs collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) If objUser.DeniedCatalogs.Count > 0 Then MsgBox "Denied Catalogs:" & objUser.DeniedCatalogs(1).Name End if Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"CatalogLevel Object" (p. 465)

DeniedColumns Property
Syntax
UserClass.DeniedColumns

Applies To
UserClass Object

Description
Returns a collection of Column objects to which the UserClass object is denied access.

Discussion
Use this property to determine the Column objects in the DeniedColumns collection. Any Column objects that are in the DeniedColumns collection for the parent UserClass object are not inherited by the DeniedColumns collection of the child UserClass object database

Type
Object

Access
Read

Example
This example shows the name of a the first Column object in the DeniedColumns collection.
Sub Main()

Administration Guide 633

Chapter 56: Properties


Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) If Not objUser.DeniedColumns(1) is Nothing Then MsgBox objUser.DeniedColumns(1).Name End if Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedColumns Collection" (p. 493)

DeniedFolderItems Property
Syntax
UserClass.DeniedFolderItems

Applies To
UserClass Object

Description
Returns a collection of FolderItem objects to which the UserClass object is denied access.

Discussion
Use this property to determine the FolderItem objects in the DeniedFolderItems collection. Note: Any FolderItem objects that are in the DeniedFolderItems collection for the parent UserClass object are not inherited by the DeniedFolderItems collection of the child UserClass object.

Type
Object

Access
Read

Example
This example shows the name of the first FolderItem object in the DeniedFolderItems collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) If objUser.DeniedFolderItems.Count > 0 Then MsgBox objUser.DeniedFolderItems(1).Name End if Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

634 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Related Topics
"DeniedFolderItems Collection" (p. 494)

DeniedSchemas Property
Syntax
UserClass.DeniedSchemas

Applies To
UserClass Object

Description
Returns a collection of SchemaLevel objects to which the UserClass object is denied access.

Discussion
Use this property to determine the SchemaLevel objects in the DeniedSchemas collection. Any SchemaLevel objects that are in the DeniedSchemas collection for the parent UserClass object are not inherited by the DeniedSchemas collection of the child UserClass object.

Type
Object

Access
Read

Example
This example shows the first SchemaLevel object in the DeniedSchemas collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) If Not objUser.DeniedSchemas(1) Is Nothing Then MsgBox "Denied Schemas:" & objUser.DeniedSchemas(1).Name End If Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedSchemas Collection" (p. 495)

DeniedSelectValues Property
Syntax
UserClass.DeniedSelectValues

Applies To
UserClass Object

Administration Guide 635

Chapter 56: Properties

Description
Returns a collection of FolderItem objects for which this UserClass object is denied permission to perform a select values operation.

Discussion
Use this property to determine the FolderItem objects that are denied permission to use a select distinct statement on columns with many unique values Any SchemaLevel objects that are in the DeniedSchemas collection for the parent UserClass object are not inherited by the DeniedSchemas collection of the child UserClass object. Note: If the SelectDistinctPermission property is set to 2 (Prevent), all columns are denied the permission to perform a Select Distinct operation regardless of whether they are FolderItem objects in the DeniedSelectValues collection.

Type
Object

Access
Read

Example
This example adds the Cust No. column to the DeniedSelectValues collection and then shows the name of this column.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\great sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.DeniedSelectValues.Add objImpCat.Folders("Customers").Items("Cust No") If objUser.DeniedSelectValues(1) > 0 Then MsgBox objUser.DeniedSelectValues(1).Name End If Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"FolderItem Object" (p. 471)

DeniedTables Property
Syntax
UserClass.DeniedTables

Applies To
UserClass Object

Description
Returns a collection of Table objects to which the UserClass object is denied access.

Discussion
Use this property to determine the Table objects in the DeniedTables collection.

636 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties Any Table objects that are in the DeniedTables collection for the parent UserClass object are not inherited by the DeniedTables collection of the child UserClass object.

Type
Object

Access
Read

Example
This example shows the name of the first Table object in the DeniedTables collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\ourtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) If objUser.DeniedTables.Count > 0 Then MsgBox objUser.DeniedTables(1).Name End If Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"DeniedTables Collection" (p. 497) "Table Object" (p. 482)

Description Property
Syntax
Catalog.Description

Applies To
Catalog Object

Description
Sets or returns a text description of the Catalog.

Discussion
Access is Read-Only if the catalog is a distributed copy of a master.

Type
String

Access
Read/Write (distributed master Catalog) Read (distributed copy Catalog)

Example
This example shows the filename and description of the active, non-distributed catalog.
Sub Main() Dim objImpApp As Object

Administration Guide 637

Chapter 56: Properties


Dim objImpCat As Object Dim strFileName As String Dim strDesc As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog objImpCat.IsDistributed = False strFileName = objImpCat.Filename MsgBox "The filename of the Catalog is " & strFileName strDesc = objImpCat.Description MsgBox "The Catalog Description is " & strDesc Set objImpCat = Nothing Set objImpApp = Nothing End Sub

EncryptedPassword Property
Syntax
UserClass.EncryptedPassword

Syntax
DatabaseConnection.EncryptedPassword

Applies To
DatabaseConnection Object

Description
Sets or returns the password for logging onto the database or for logging onto a catalog as a userclass.

Discussion
Note that this string can be read and written, unlike the PlainTextPassword property which can only be written.

Type
String

Access
Read/Write

Example
This example shows the encrypted password for the active user connected to the first DatabaseConnection object in the DatabaseConnections collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Imp_cat\" & _ "bi admin.cat","Creator",,"biadmin","biadmin" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass MsgBox objUser.DatabaseConnections(1).EncryptedPassword Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

638 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Related Topics
"UserClass Object" (p. 484)

ErrorDocument Property
Syntax
Application.ErrorDocument Insert

Applies To
Application Object

Description
Returns which document has returned errors when running multiple documents.

Discussion
Use this property when you get unexpected results when you run multiple reports. You can determine which report caused the error. You can use the GetNextQueryError to trap the specific error.

Type
Object

Access
Read

ExportMetaTags Property
Syntax
PublishHTML.ExportMetaTags

Applies To
PublishHTML Object

Description
Determines whether HTML meta tags will be added to the HTML report output.

Discussion
When a report is published in HTML format, you can have HTML meta tags added to the report header . When used without being assigned a value, the property returns its current setting. The default is False. The tags are added to each page generated, including any table of contents pages. The tags take this form:
<meta name = "Data" content = "column name, catalog ID, data type, column name, catalog ID, data type >

The content tag will contain name, catalog ID and data type for each data column in the report.

Type
Boolean

Access
Read/Write

Administration Guide 639

Chapter 56: Properties

Example
This example opens an Impromptu report and publishes it in HTML format. Because ExportMetaTags is set to True, information about the contents of the report is added to the header of the report as a meta tag.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object Dim objImpHTMLRep as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible 1 Set objImpRep = objImpApp.OpenReport("C:\Program Files\" & _ "Cognos\<rendition_id>\samples\Impromptu\Reports\Product Orders.imr") Set objImpHTMLRep = objImpRep.PublishHTML objImpHTMLRep.Reset objImpHTMLRep.ExportMetaTags = True objImpHTMLRep.Publish "C:\Temp", "country" objImpApp.Quit Set objImpHTMLRep = Nothing Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Products (Publish as HTML) Sample" (p. 721) "Publish Method" (p. 588) "PublishHTML Object" (p. 473) "PublishHTML Property" (p. 681) "Sales By Country (Publish as HTML) Sample" (p. 722)

ExportOptions Property
Syntax
PublishExcel.ExportOptions

Applies To
PublishExcel Object

Description
Determines which report objects will be added to Microsoft Excel report output.

Discussion
When you publish a report in Microsoft Excel format, you can specify the report objects to export with the ExportOptions property. If no value is assigned, this property returns the current setting. The default value is obtained from the report properties. The options available for export include Option 0 1 2 4 8 Description None Images Static charts Text frames Summary expressions

640 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties You can also construct combinations of the available options. For example, where ExportOptions = 15 (1+2+4+8), all images, static charts, text frames, and summary expressions are exported. If you choose Microsoft Excel 2000 as the export version, any export options other than 0 (None) will be ignored, as they are not supported.

Type
Integer

Access
Read/Write

Example
This example creates a report in Microsoft Excel format, where all images, static charts, text frames, and summary expressions are exported.
Sub Main() Dim ImpApp as Object Dim ImpRep as Object Dim ImpExcelRep as Object Dim ImpPath as String MsgBox "Publish as Excel" Set ImpApp = CreateObject("CognosImpromptu.Application") ImpApp.Visible 1 'make Impromptu visible ImpPath = "C:\Program Files\Cognos\<rendition_id>\Samples\Impromptu\" Set ImpRep = ImpApp.OpenReport (ImpPath & "Reports\currency.imr") ImpRep.Visible 1 Set ImpExcelRep = ImpRep.PublishExcel ImpExcelRep.Version 1 ImpExcelRep.ExportOptions 15 ImpExcelRep.Publish ImpPath & "Reports\currency.xls" ImpApp.Quit Set ImpExcelRep = Nothing Set ImpRep = Nothing Set ImpApp = Nothing End Sub

Related Topics
"Publish Method" (p. 588) "PublishExcel Object" (p. 472) "Version Property" (p. 704)

Filename Property
Syntax
Catalog.Filename

Applies To
Catalog Object

Description
Returns the name and location of the catalog.

Discussion
The string must be a valid filename.

Type
String

Administration Guide 641

Chapter 56: Properties

Access
Read

Example
This example shows the filename and description for the active, non-distributed catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim strFileName As String Dim strDesc As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog objImpCat.IsDistributed = False strFileName = objImpCat.Filename MsgBox "The filename of the Catalog is " & strFileName strDesc = objImpCat.Description MsgBox "The Catalog Description is " & strDesc Set objImpCat = Nothing Set objImpApp = Nothing End Sub

FilteredColumns Property
Syntax
UserClass.FilteredColumns

Applies To
UserClass Object

Description
Returns a collection of Column objects for which the UserClass object has filters.

Discussion
Use this property to determine the Column objects in the FilteredColumns collection. Any Table objects that are in the FilteredColumns collection for the parent UserClass object are not inherited by the FilteredColumns collection of the child UserClass object.

Type
Object

Access
Read

Example
This example shows the name of the first Column object in the FilterColumns collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) If objUser.FilteredColumns.Count > 0 Then MsgBox objUser.FilteredColumns(1).Name End If

642 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"FilteredColumns Collection" (p. 498)

FilteredTables Property
Syntax
UserClass.FilteredTables

Applies To
UserClass Object

Description
Returns a collection of Table objects for which the UserClass object has filters.

Discussion
Use this property to determine the Table objects in the FilteredTables collection. Any Table objects that are in the FilteredTables collection for the parent UserClass object are not inherited by the FilteredTables collection of the child UserClass object.

Type
Object

Access
Read

Example
This example shows the name of the first Table object in the FilteredTables Collection. collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB as Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") Set objUser = objImpCat.ActiveUserClass.UserClasses(1) If Not objUser.FilteredTables(1) Is Nothing Then MsgBox objUser.FilteredTables(1).Name End If Set objDB = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"FilteredTables Collection" (p. 498) "Table Object" (p. 482)

Administration Guide 643

Chapter 56: Properties

FolderItem Property
Syntax
QueryItem.FolderItem

Applies To
QueryItem Object

Description
Returns a reference to the catalog folder item for the query item in the report.

Discussion
Use this property to gather information about the queries in a report.

Type
Object

Access
Read

Example
This example shows the name of the first folder, the number of query items, and the properties of each query item from the current report. To run this example, you must set Impromptu to single instance and open the report.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objImpRep As Object Dim objQueryItemsCol As Object ' collection Dim objFolderItemCol As Object ' collection Dim objTempFolderItem As Object Dim objMetaDataItem As Object Dim i, count As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True Set objImpCat = objImpApp.ActiveCatalog Set objImpRep = objImpApp.ActiveDocument Set objQueryItemsCol = objImpRep.QueryItems Set objFolderItemCol = objImpCat.Folders(1).Items ' get children of 1st folder MsgBox "The first folder is " & objFolderItemCol(1).Name count = objQueryItemsCol.count MsgBox "QueryItems.Count = " & count For i = 1 To count Set objTempFolderItem = objQueryItemsCol.Item(i).FolderItem Set objMetaDataItem = objQueryItemsCol.Item(i).MetaDataItem If (objQueryItemsCol.Item(i).FolderPath = "") Then MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _ "Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _ "Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _ " *** FOLDER ITEM NOT FOUND *** " & Chr$(13) & _ "MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _ "MetaDataItem.Name = " & objMetaDataItem.Name Else MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _ "Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _ "Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _ "FolderPath = " & objQueryItemsCol.Item(i).FolderPath & Chr$(13) & _ "FolderItem.Name = " & objTempFolderItem.Name & Chr$(13) & _

644 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


"MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _ "MetaDataItem.Name = " & objMetaDataItem.Name End If Next i End Sub

Related Topics
"FolderPath Property" (p. 645) "MetaDataItem Property" (p. 670) "MetaDataPath Property" (p. 672) "QueryItem Property" (p. 685) "QueryItems Collection" (p. 501) "QueryItems Method" (p. 591)

FolderPath Property
Syntax
QueryItem.FolderPath

Applies To
QueryItem Object

Description
Returns the folder path for the catalog folder item for the query item in the report.

Discussion
Use this property to gather information about the queries in a report.

Type
Object

Access
Read

Example
This example shows the name of the first folder, the number of query items, and the properties of each query item from the current report. To run this example, you must set Impromptu to single instance and open the report.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objImpRep As Object Dim objQueryItemsCol As Object ' collection Dim objFolderItemCol As Object ' collection Dim objTempFolderItem As Object Dim objMetaDataItem As Object Dim i, count As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True Set objImpCat = objImpApp.ActiveCatalog Set objImpRep = objImpApp.ActiveDocument Set objQueryItemsCol = objImpRep.QueryItems Set objFolderItemCol = objImpCat.Folders(1).Items ' get children of 1st folder MsgBox "The first folder is " & objFolderItemCol(1).Name count = objQueryItemsCol.count MsgBox "QueryItems.Count = " & count

Administration Guide 645

Chapter 56: Properties


For i = 1 To count Set objTempFolderItem = objQueryItemsCol.Item(i).FolderItem Set objMetaDataItem = objQueryItemsCol.Item(i).MetaDataItem If (objQueryItemsCol.Item(i).FolderPath = "") Then MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _ "Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _ "Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _ " *** FOLDER ITEM NOT FOUND *** " & Chr$(13) & _ "MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _ "MetaDataItem.Name = " & objMetaDataItem.Name Else MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _ "Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _ "Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _ "FolderPath = " & objQueryItemsCol.Item(i).FolderPath & Chr$(13) & _ "FolderItem.Name = " & objTempFolderItem.Name & Chr$(13) & _ "MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _ "MetaDataItem.Name = " & objMetaDataItem.Name End If Next i End Sub

Related Topics
"FolderItem Property" (p. 644) "MetaDataItem Property" (p. 670) "MetaDataPath Property" (p. 672) "QueryItem Property" (p. 685) "QueryItems Collection" (p. 501) "QueryItems Method" (p. 591)

Folders Property
Syntax
Catalog.Folders

Applies To
Catalog Object

Description
Returns the top-level Items collection in a catalog.

Discussion
The Catalog object is the parent for items in this collection.

Type
Object

Access
Read

Example
This example shows the name of the first Folder object in the Folders collection of the active catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object

646 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


Dim objCatFolders As Object Dim strFolderName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\GO Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders strFolderName = objCatFolders(1).Name MsgBox strFolderName Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Formula Property
Syntax
SelectedFrame.Formula

Applies To
SelectedFrame Object

Description
Returns a string that contains the fully-qualified formula for a selected text frame.

Discussion
Use Formula with a SelectedFrame object to view the formula that defines a selected text frame. It returns an empty string for non-text frames.

Type
String

Access
Read

Example
This example shows the expression that defines the join type for the second join in the TableLinks collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Set objImpApp = CreateObject("Impromptu.Application") objImpApp.OpenCatalog "C:\temp\sample.cat" Set objImpCat = objImpApp.ActiveCatalog MsgBox objImpCat.TableLinks(2).Condition.Formula Set objImpCat = Nothing Set objImpApp = Nothing End Sub

FormulaEx Property
Syntax
Expression.FormulaEx

Applies To
Expression Object

Administration Guide 647

Chapter 56: Properties

Description
Returns the string representation of an expression.

Discussion
Use this property to view the expression that is used as a filter, prompt or calculation. To append to an expression, use the AppendEx method. The returned string has a specific syntax. The syntax specified below are only some of the more complex tokens. For complete formal syntax of strings returned by this property, please contact Cognos Support. All string tokens are enclosed in double quotes. Quotes embedded in names are doubled. Folder item names in the formula string are replaced by qualified names of the metadata items.

Catalog Column Reference


ColumnRef[MetadataName'. 'MetadataName'. 'MetadataName'] MetadataName is the name of the metadata object.

Catalog Folder Item Reference


FolderItemRef['FolderPath'] FolderPath is the path to the folder item.

Query Item Reference


QueryColumnRef['QueryName', 'QueryColumnName'] QueryName is the name of the query. QueryColumnName is the name of the column that contains the query.

Catalog Prompt Definition Reference


PromptDef['PromptName','PromptMessage','DatabaseDataType', 'DatabaseDataSize','DatabaseUseDefaultValues','DatabasePrecision','DatabaseScale', 'DatabaseIsNullAllowed', 'PromptType', ] PromptName is the name of the prompt. PromptMessage is the user information that appears with the prompt. DatabaseDataType is the SQL data type, which is represented as a two-character literal. See the database data type list for more information. DatabaseDataSize is the size of data in the database, which is positive. DatabaseUseDefaultValues determines whether the prompt uses the default database values. DatabasePrecision is the number of digits in the DatabaseDataSize parameter. DatabaseScale is the exponential of the database data, where the value indicates the location of the decimal with respect to the digits in the DatabaseDataSize. DatabaseIsNullAllowed specifies whether the database permits null values. 0: False 1: True PromptType is the type of prompt in the expression, which is represented as a two-character literal. ti: type-in fp: file picklist rp: report picklist cp: catalog picklist ds: dataset

648 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties Depending on the prompt type, the parameters that follow are listed in the following table: Prompt Type Definition Description

ti 'ResultType','DefaultValue' A type-in prompt definition. ResultType is the data type expected by the prompt, which is represented as a two-character literal. See the result type list for more information. DefaultValue is the default string the prompt displays. A file picklist prompt definition. fp 'TextFilePath','ResultType','Sort TextFilePath is the full path to the text file. Values' ResultType is the data type expected by the prompt, which is represented as a two-character literal. See the result type list for more information. SortValues determines whether the list of values in the picklist is is sorted. rp 'ReportFilePath','ResultType','U seQueryColumnName','UseQu eryColumnPosition','DisplayQu eryColumnName','DisplayQuer yColumnPosition','SortValues' A report picklist prompt definition. ReportFilePath is the full path to the report. ResultType is the data type expected by the prompt, which is represented as a two-character literal. See the result type list for more information. UseQueryColumnName is the name of the query column used in the prompt. UseQueryColumnPosition is the position of the query column used in the prompt. DisplayQueryColumnName is the name of the query column displayed by the prompt. DisplayQueryColumnPosition is the position of the query column displayed by the prompt. SortValues determines whether the list of values in the picklist is is sorted. A catalog picklist prompt definition. cp 'UseCatalogColumnPath','Displ UseCatalogColumnPath is the path within the catalog of the ayCatalogColumnPath','SortVal column used in the prompt. ues' DisplayCatalogColumnPath is the path within the catalog of the column displayed by the prompt. SortValues determines whether the list of values in the picklist is is sorted.

Administration Guide 649

Chapter 56: Properties Prompt Type Definition Description

A dataset prompt definition. ds 'SubqueryReportFilePath','Resul SubqueryReportFilePath is the full path to the Impromptu tType','SubqueryColumnName', report. 'SubqueryColumnPosition' Type: String ResultType is the data type expected by the prompt, which is represented as a two-character literal. See the result type list for more information. Type: String SubqueryColumnName is the name of the subquery column. Type: String SubqueryColumnPosition is the position of the subquery column in the report. Type: Integer The Formula property continues to exist for the SelectedFrame object and to support macros that have not been changed to use the new expression OLE property, FormulaEx. To use the new capabilities of the new property, you must change macros that use the Formula property to use the FormulaEx property.

Database Data Type List


ch - sqlChar da - sqlDate de - sqlDecimal do - sqlDouble dt - sqlDateTime fl - sqlFloat in - sqlInteger iv - sqlInterval lv - sqlLongVarChar qu - sqlQuad si - sqlSmallInt tm - sqlTime tx - sqlText un - sqlUnknown vc - sqlVarChar Result Type List dm datetime dt date iv interval nu number st string tm time

Type
String

Access
Read

Example
This is an example of the output from FormulaEx property.
ColumnRef["OUTDOORS"."ORDRDETL"."QTY"] FolderItemRef["ORDRDETL"."Type-in-prompt"] PromptDef["\ORDRDETL\Type-in prompt","",iv,4,f,1,0,f,ti,iv,"002 02:00:00.000"]

650 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties This example writes the folder expressions for all items in the catalog folders to a text file.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objFolders As Object Dim objFolder As Object Dim objItems As Object Dim objItem As Object Dim intFoldersCount, intItemsCount, intSumItems As Integer Dim i, j As Integer On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Interactive True objImpApp.OpenCatalog "c:\Catalogs\sample.cat", _ "Creator", , , , False 'open the text file which will be the recipient of ' the string 'representation of various Impromptu expressions Open "c:\Catalogs\sample.txt" For Output As #1 Set objImpCat = objImpApp.ActiveCatalog Set objFolders = objImpCat.Folders MsgBox "There are " & objImpCat.Folders.Count & " folders." intSumItems = 0 intFoldersCount = objFolders.Count If intFoldersCount > 0 Then For i = 1 To intFoldersCount Set objFolder = objFolders(i) MsgBox "Reporting items in folder " _ & objFolder.Name & "." Print #1, "Folder name is " & objFolder.Name & "." Set objItems = objFolder.Items intItemsCount = objItems.Count For j = 1 To intItemsCount Set objItem = objItems(j) If not objItem.Value is Nothing Then intSumItems = intSumItems + 1 Print #1, "The FormulaEx is " & _ objItem.Value.FormulaEx End If Set objItem = Nothing Next Print #1, "End of items for folder " & _ objFolder.Name & "." Print #1, "------------" Set objFolder = Nothing Set objItems = Nothing Next End If MsgBox "Done reporting on " & intSumItems & " items." Set objFolders = Nothing ' close the text file Close #1 objImpCat.Close Set objImpCat = Nothing ' stop Impromptu objImpApp.Quit Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & " occurred at line " & Erl Resume Done End Sub

Administration Guide 651

Chapter 56: Properties

FormulaExB Property
Syntax
Expression.FormulaExB

Applies To
Expression Object

Description
Returns the string representation of an expression that includes the select all support for prompts.

Discussion
Use this property to view the expression that is used as a filter, prompt or calculation. This property is an extension of the FormulaEx property with the addition of support for the select all option in prompts. To append to an expression, use the AppendEx method. The returned string has a specific syntax. The syntax specified below are only some of the more complex tokens. For complete formal syntax of strings returned by this property, please contact Cognos Software Services. All string tokens are enclosed in double quotes. Quotes embedded in names are doubled. Folder item names in the formula string are replaced by qualified names of the metadata items.

Catalog Column Reference


ColumnRef[MetadataName'. 'MetadataName'. 'MetadataName'] MetadataName is the name of the metadata object.

Catalog Folder Item Reference


FolderItemRef['FolderPath'] FolderPath is the path to the folder item.

Query Item Reference


QueryColumnRef['QueryName', 'QueryColumnName'] QueryName is the name of the query. QueryColumnName is the name of the column that contains the query.

Catalog Prompt Definition Reference


PromptDef['PromptName','PromptMessage','DatabaseDataType', 'DatabaseDataSize','DatabaseUseDefaultValues','DatabasePrecision','DatabaseScale', 'DatabaseIsNullAllowed', 'PromptType', ] PromptName is the name of the prompt. PromptMessage is the user information that appears with the prompt. DatabaseDataType is the SQL data type, which is represented as a two-character literal. See the database data type list for more information. DatabaseDataSize is the size of data in the database, which is positive. DatabaseUseDefaultValues determines whether the prompt uses the default database values. DatabasePrecision is the number of digits in the DatabaseDataSize parameter. DatabaseScale is the exponential of the database data, where the value indicates the location of the decimal with respect to the digits in the DatabaseDataSize. DatabaseIsNullAllowed specifies whether the database permits null values. 0: False

652 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties 1: True PromptType is the type of prompt in the expression, which is represented as a two-character literal. ti: type-in fp: file picklist rp: report picklist cp: catalog picklist ds: dataset The following tables lists the parameters that are available for file, report and catalog picklists that use the FormualaExB property. Prompt Type Definition fp 'TextFilePath','ResultType','SortValues',' AllowSelectAll' Description A file picklist prompt definition. TextFilePath is the full path to the text file. ResultType is the data type expected by the prompt, which is represented as a two-character literal. See the result type list for more information. SortValues determines whether the list of values in the picklist is is sorted. AllowSelectAll determines whether the user can select all values from the multi-select prompt. rp 'ReportFilePath','ResultType','UseQuery ColumnName','UseQueryColumnPositio n','DisplayQueryColumnName','Display QueryColumnPosition','SortValues','Allo wSelectAll' A report picklist prompt definition. ReportFilePath is the full path to the report. ResultType is the data type expected by the prompt, which is represented as a two-character literal. See the result type list for more information. UseQueryColumnName is the name of the query column used in the prompt. UseQueryColumnPosition is the position of the query column used in the prompt. DisplayQueryColumnName is the name of the query column displayed by the prompt. DisplayQueryColumnPosition is the position of the query column displayed by the prompt. SortValues determines whether the list of values in the picklist is is sorted. AllowSelectAll determines whether the user can select all values from the multi-select prompt. A catalog picklist prompt definition. cp 'UseCatalogColumnPath','DisplayCatalog UseCatalogColumnPath is the path within the ColumnPath','SortValues','AllowSelectAll' catalog of the column used in the prompt. DisplayCatalogColumnPath is the path within the catalog of the column displayed by the prompt. SortValues determines whether the list of values in the picklist is is sorted. AllowSelectAll determines whether the user can select all values from the multi-select prompt.

Administration Guide 653

Chapter 56: Properties

Database Data Type List


ch - sqlChar da - sqlDate de - sqlDecimal do - sqlDouble dt - sqlDateTime fl - sqlFloat in - sqlInteger iv - sqlInterval lv - sqlLongVarChar qu - sqlQuad si - sqlSmallInt tm - sqlTime tx - sqlText un - sqlUnknown vc - sqlVarChar Result Type List dm datetime dt date iv interval nu number st string tm time

Type
String

Access
Read

Example
This is an example of the output from the FormulaExB property for a catalog picklist prompt with select all enabled.
PromptDef["\CountryPrompt","Country?",ch,256,f,1,0,f,cp,FolderItemRef["Country "."Country"],FolderItemRef["Country"."Country"],t,t]

This example writes the folder expressions for all items in the catalog folders to a text file.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objFolders As Object Dim objFolder As Object Dim objItems As Object Dim objItem As Object Dim intFoldersCount, intItemsCount, intSumItems As Integer Dim i, j As Integer On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Interactive True objImpApp.OpenCatalog "c:\Catalogs\sample.cat", _ "Creator", , , , False 'open the text file which will be the recipient of ' the string 'representation of various Impromptu expressions Open "c:\Catalogs\sample.txt" For Output As #1 Set objImpCat = objImpApp.ActiveCatalog Set objFolders = objImpCat.Folders MsgBox "There are " & objImpCat.Folders.Count & " folders." intSumItems = 0 intFoldersCount = objFolders.Count If intFoldersCount > 0 Then For i = 1 To intFoldersCount Set objFolder = objFolders(i)

654 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


MsgBox "Reporting items in folder " _ & objFolder.Name & "." Print #1, "Folder name is " & objFolder.Name & "." Set objItems = objFolder.Items intItemsCount = objItems.Count For j = 1 To intItemsCount Set objItem = objItems(j) If not objItem.Value is Nothing Then intSumItems = intSumItems + 1 Print #1, "The FormulaExB is " & _ objItem.Value.FormulaExB End If Set objItem = Nothing Next Print #1, "End of items for folder " & _ objFolder.Name & "." Print #1, "------------" Set objFolder = Nothing Set objItems = Nothing Next End If MsgBox "Done reporting on " & intSumItems & " items." Set objFolders = Nothing ' close the text file Close #1 objImpCat.Close Set objImpCat = Nothing ' stop Impromptu objImpApp.Quit Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & " occurred at line " & Erl Resume Done End Sub

FromPage Property
Syntax
PublishHTML.FromPage

Applies To
PublishHTML Object

Description
Sets or returns which page of the Impromptu report will be the first page of the HTML report output.

Discussion
The default value is the current value in the Options box. If youve never changed the default value, it is 1. The FromPage value should be less than or equal to the ToPage value.

Type
integer

Access
Read/Write

Administration Guide 655

Chapter 56: Properties

FullName Property
Syntax
object.FullName

Applies To
Application Object ReportDocument Object

Description
Returns a string containing the file name for the specified Impromptu application.

Discussion
Use the FullName method to assign the file name to a string variable for the specified Impromptu application object or report. You can then determine the exact name and location of the Impromptu executable file and any reports that are open in the automation script. Use these string values within the script to open a log file to track the progress of the automation script, for example. Within the log file, you could write the name of each Impromptu report executed or printed within the automation script.

Type
String

Example
This example shows the complete filename, including location, of the active report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") MsgBox "Application's full path is " & objImpApp.FullName Set objImpRep = objImpApp.OpenReport("C\Reports\Customer Discount.imr") Msgbox "Reports's full path is " & objImpRep.FullName Set objImpRep = Nothing Set objImpApp = Nothing End Sub

HasTextBlobLimit Property
Syntax
UserClass.HasTextBlobLimit

Applies To
UserClass Object

Description
Sets or returns whether the UserClass object has a text-blob limit.

Discussion
If set to True, the UserClass object has a limit on the number of characters it can reference from a large text object in the database. If set to False, the UserClass is not limited by the number of characters in a text-blob . Use the MaxTextBlobCharacters property to set the limit. This property is automatically set to True when the MaxTextBlobCharacters property has been set. Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

656 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Type
Boolean

Access
Read/Write

Example
This example limits the number of characters that the user class can reference from a large text object in the database. In this case, the maximum number of characters is 50.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.HasTextBlobLimit = True objUser.MaxTextBlobCharacters = 50 Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"MaxTextBlobCharacters Property" (p. 670)

IsDistributed Property
Syntax
object.IsDistributed

Applies To
Catalog Object FolderItem Object

Description
Sets or returns whether the object is distributed.

Discussion
Use this property to specify that Catalog is a distributed master catalog or to specify whether a folder item is of the distributed type. Users can use distributed catalogs to make personal copies from the master catalog so that they can change the folder structure without affecting the master catalog. This property returns True if the folder item is distributed; otherwise, it returns False. A distributed folder item is read-only. Default: False

Type
Boolean

Access
Read/Write

Administration Guide 657

Chapter 56: Properties

Example
This example changes the open catalog to a distributed master catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim strFileName As String Dim strDesc As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog objImpCat.IsDistributed = True strFileName = objImpCat.Filename MsgBox "The filename of the Catalog is " & strFileName strDesc = objImpCat.Description MsgBox "The Catalog Description is " & strDesc Set objImpCat = Nothing Set objImpApp = Nothing End Sub

IsExternal Property
Syntax
DatabaseDefinition.IsExternal

Applies To
DatabaseDefinition Object

Description
Returns whether the database is an external HotFile.

Discussion
To add HotFiles to a catalog, you can add HotFiles from a directory to a catalog as tables to create an external HotFile create a HotFile DatabaseDefinition entry and add HotFiles at that location to a catalog as tables to create an internal HotFile create a HotFile DatabaseDefinition entry and create a new catalog from that database to create a HotFile database This property returns True if the database is an external HotFile database; otherwise, it returns False. Default: False

Type
Boolean

Access
Read

Example
This example shows whether the catalog is attached to an external, local data table (HotFile).
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim strDBDefinition As String Dim strType As String Dim intIsExternal As Integer On error goto ErrorRoutine

658 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


Set objImpApp = CreateObject("CognosImpromptu.Application") Set objDB = objImpApp.DatabaseDefinitions strDBDefinition = objDB("OUTDOORS").Definition MsgBox "Data Base Definition is " & strDBDefinition strType = objDB("OUTDOORS").Type MsgBox "Data Base Type is " & strType & "." intIsExternal = objDB("OUTDOORS").IsExternal if intIsExternal = 0 then MsgBox "Data Base is not External (Value is " & intIsExternal & ")" else MsgBox "Data Base is External (Value is " & intIsExternal & ")" end if Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & " occurred at line " & Erl Resume Done End Sub

IsKey Property
Syntax
Column.IsKey

Applies To
Column Object

Description
Sets or returns whether the Column object is a key.

Discussion
If the IsKey property is True, then the Column object is a key. If False, the Column object is not a key.

Type
Boolean

Access
Read/Write

Example
This example adds a new REGION column to the COUNTRY table and uses this column as a key.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("COUNTRY").Columns.Add "REGION",1 objDB.Tables("COUNTRY").Columns("REGION").IsKey = true Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Administration Guide 659

Chapter 56: Properties

IsLocked Property
Syntax
Catalog.IsLocked

Applies To
Catalog Object

Description
Sets or returns whether the catalog is locked.

Discussion
This property returns True if the catalog is locked; otherwise, it returns False. The locked catalog is created and maintained outside Impromptu by Architect. Do not change a locked catalog because changes will be lost when Architect updates the catalog. Do not lock an unlocked file because you will not be able to unlock it again. Default:False

Type
Boolean

Access
Read/Write

Example
This example shows whether the active catalog is locked.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim strFileName As String Dim intIsLocked As Integer Dim strNameSpace As String On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog objImpCat.IsDistributed = False strFileName = objImpCat.Filename MsgBox "The file name of the catalog is " & strFileName intIsLocked = objImpCat.IsLocked if intIsLocked = 0 then MsgBox "The catalog is not locked " & _ "(value is " & intIsLocked & " )." else MsgBox "The catalog is locked " & _ "(value is " & intIsLocked & " )." end if strNameSpace = objImpCat.NameSpace MsgBox "The catalog name space is " & strNameSpace & "." Set objImpCat = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & " occurred at line " & Erl Resume Done End Sub

660 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

IsSynonym Property
Syntax
Table.IsSynonym

Applies To
Table Object

Description
Sets or returns whether the table is a synonym.

Discussion
This property returns True if the table is a synonym; otherwise, it returns False. Use this property with Oracle databases only. Default: False

Type
Boolean

Access
Read/Write

Example
This example shows whether there is an alternate table name for the alias table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objMaster As Object Dim strMasterName As String Dim intQualificationLevel As Integer Dim strUniqueID As String Dim intIsSynonym As Integer Dim intWeight As Integer On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("BRANCH").CreateAlias "BRANCH ALIAS" Set objMaster = objDB.Tables("BRANCH ALIAS").MasterTable MsgBox "Master Table Name is " & objMaster.Name strMasterName = objDB.Tables("BRANCH ALIAS").MasterName MsgBox "Master Name is " & strMasterName & "." intQualificationLevel = objDB.Tables _ ("BRANCH ALIAS").QualificationLevel MsgBox "Qualification Level is " & _ intQualificationLevel & "." intIsSynonym = objDB.Tables("BRANCH ALIAS").IsSynonym if intIsSynonym = 0 then MsgBox "Table has no synonym " & _ "(Value is " & intIsSynonym & ")" else MsgBox "Table has a synonym " & _ "(Value is " & intIsSynonym & ")" end if intWeight = objDB.Tables("BRANCH ALIAS").Weight MsgBox "Table weight is " & intWeight & "." Set objMaster = Nothing Set objDB = Nothing

Administration Guide 661

Chapter 56: Properties


Set objImpCat = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & _ " occurred at line " & Erl Resume Done End Sub

Item Property
Syntax
collection.Item

Applies To
CatalogLevels Collection Columns Collection Databases Collection DatabaseConnections Collection DatabaseDefinitions Collection DeniedCatalogs Collection DeniedColumns Collection DeniedFolderItems Collection DeniedSchemas Collection DeniedSelectValues Collection DeniedTables Collection FilteredColumns Collection FilteredTables Collection Folders Collection Items Collection SchemaLevels Collection SelectedFrames Collection Tables Collection TableLinks Collection UserClasses Collection

Description
Returns the specified object in the collection.

Discussion
If the index is a string, the item with that name is returned or Nothing is returned if no such named item exists. (String indexing may not be supported by all collections in all cases. See the specific collection for details.) If the item is a number, the item at that position in the list is returned. The numeric index is 1 based. Out of range indices cause an out of range exception. Other index types may be acceptable see the specific collection for details.

Type
Object

Access
Read

Example
This example shows the name of the first UserClass object in the ActiveUserClasses collection.

662 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUserClass As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\cognos\test.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objUserClass = objImpCat.ActiveUserClass MsgBox objUserClass.UserClasses.Item(1).Name Set objUserClass = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Items Property
Syntax
FolderItem.Items

Applies To
FolderItem Object

Description
Returns an ownership collection of child FolderItem objects.

Discussion
This collection is empty for folder items that represent calculations, filters or prompt expressions because only folders can have children. The names of items in a folder must be unique.

Type
Object

Access
Read

Example
This example shows the name of the first item in the Customers folder. However, if the first item in this folder is a column, the example shows an empty string.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\GO Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders If Not objCatFolders("Customers").Items(1).Name Is Nothing Then MsgBox objCatFolders("Customers").Items(1).Name End If Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

LeftTable Property
Syntax
TableLink.LefTable

Administration Guide 663

Chapter 56: Properties

Applies To
TableLink Object

Description
Returns the "left" table in the single-step link.

Discussion
Use the LeftTable property and the name property to determine the name of the table that represents the one side of a one-to-many relationship.

Type
Object

Access
Read

Example
This example shows the name of the left table in the second join of the TableLinks collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Dim strLeftTable As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\Great Sample.cat" Set objImpCat = objImpApp.ActiveCatalog strLeftTable = objImpCat.TableLinks(2).LeftTable.Name MsgBox "The name of the left table is " & strLeftTable Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

MasterCatalogFilename Property
Syntax
Catalog.MasterCatalogFilename

Applies To
Catalog Object

Description
Returns the filename of the master catalog.

Discussion
Use this property to get the location and name of a distributed master catalog for a distributed catalog copy. Note: The string returned is Read-Only.

Type
String

Access
Read

664 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Example
This example shows the name and location of the distributed master catalog and the distributed catalog copy.
Sub Main() Dim objImpApp As Object Dim objMasterCat As Object Dim objCopyCat As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True objImpApp.OpenCatalog "e:\Catalogs\Master.cat", "Creator", , , , False Set objMasterCat = objImpApp.ActiveCatalog objMasterCat.IsDistributed True MsgBox "Distributed master catalog path is '" & objMasterCat.FileName & "'" objMasterCat.Close objImpApp.OpenCatalog _ "e:\Catalogs\Master.cat", "User", , , , False, "e:\Catalogs\Copy.cat" Set objCopyCat = objImpApp.ActiveCatalog MsgBox "Distributed copy catalog path is '" & objCopyCat.FileName & "'" MsgBox "Its distributed master catalog path is '" _ & objCopyCat.MasterCatalogFileName & "'" objCopyCat.Close Set objCopyCat = Nothing Set objMasterCat = Nothing Set objImpApp = Nothing End Sub

MasterName Property
Syntax
Table.MasterName

Applies To
Table Object

Description
Returns the name of the master table if the table is an alias; otherwise, returns the name of the table.

Discussion
Use this property to determine the name of a master table for an alias table whose master table has been deleted from the catalog after the alias was created. Table.Name and Table.MasterName are identical names for tables that are not aliases.

Type
String

Access
Read

Example
This example shows the name of the master table of the BRANCH ALIAS table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objMaster As Object Dim strMasterName As String Dim intQualificationLevel As Integer Dim strUniqueID As String

Administration Guide 665

Chapter 56: Properties


Dim intIsSynonym As Integer Dim intWeight As Integer On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("BRANCH").CreateAlias "BRANCH ALIAS" Set objMaster = objDB.Tables("BRANCH ALIAS").MasterTable MsgBox "Master Table Name is " & objMaster.Name strMasterName = objDB.Tables("BRANCH ALIAS").MasterName MsgBox "Master Name is " & strMasterName & "." intQualificationLevel = objDB.Tables("BRANCH ALIAS").QualificationLevel MsgBox "Qualification Level is " & intQualificationLevel & "." intIsSynonym = objDB.Tables("BRANCH ALIAS").IsSynonym if intIsSynonym = 0 then MsgBox "Table has no synonym (Value is " & intIsSynonym & ")" else MsgBox "Table has a synonym (Value is " & intIsSynonym & ")" end if intWeight = objDB.Tables("BRANCH ALIAS").Weight MsgBox "Table weight is " & intWeight & "." Set objMaster = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & " occurred at line " & Erl Resume Done End Sub

MasterTable Property
Syntax
Table.MasterTable

Applies To
Table Object

Description
Returns the master table if the table is an alias.

Discussion
Use this property to determine if a table is an alias. This property returns: nothing (if the table is not an alias). the master table object (if the table is an alias and the master table is in the catalog). its own object (if the table is an alias and the master table was deleted from the catalog).

Type
Object

Access
Read

666 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Example
This example creates an alias table for the BRANCH table and then shows the name of the master table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objMaster As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\cognos\fulld1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("BRANCH").CreateAlias "BRANCH ALIAS" Set objMaster = objDB.Tables("BRANCH ALIAS").MasterTable MsgBox objMaster.Name objImpCat.Save Set objMaster = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

MaxQueryExecutionTime Property
Syntax
UserClass.MaxQueryExecutionTime

Applies To
UserClass Object

Description
Sets or returns the time limit to run a query for the UserClass object.

Discussion
Use this property to set the maximum time allowed for running a query for this UserClass object. The time unit is minutes. Use the QueryExecutionTimeWarnAfter Property to determine the time at which the UserClass object is warned. Note: The value for this property must be greater than the value for QueryExecutionTimeWarnAfter property. Default: No limit

Type
Long

Access
Read/Write

Example
This example sets the maximum query execution time for the user class to three minutes. The user is warned after two minutes.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1)

Administration Guide 667

Chapter 56: Properties


objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2 objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true objUser.MaxTextBlobCharacters = 50 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

MaxRowsRetrieved Property
Syntax
UserClass.MaxRowsRetrieved

Applies To
UserClass Object

Description
Sets or returns the maximum number of rows the UserClass object can retrieve.

Discussion
Use this property to determine the maximum number of rows retrievable for a report by this UserClass object. Use the RowsRetrievedWarnAfter Property to determine the row at which the UserClass object is warned. Note: The value for this property must be greater than the value for RowsRetrievedWarnAfter property. Default: No limit

Type
Long

Access
Read/Write

Example
This example limits the number of rows that the user class can retrieve from the database. In this case, the user can retrieve the first 100 rows.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2 objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true

668 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


objUser.MaxTextBlobCharacters = 50 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

MaxTablesPerReport Property
Syntax
UserClass.MaxTablesPerReport

Applies To
UserClass Object

Description
Sets or returns the maximum number of tables the UserClass object can retrieve.

Discussion
Use this property to determine the maximum number of tables the UserClass object can use per report. Use the TablesPerReportWarnAfter Property to warn the UserClass object before. Default: No limit

Notes
The value for this property must be greater than the value for TablesPerReportWarnAfter property. The value in this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Integer

Access
Read/Write

Example
This example sets the maximum number of tables that the user class can use to create a report. In this case, the user can retrieve up to ten tables for a report.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2 objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true objUser.MaxTextBlobCharacters = 50 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing

Administration Guide 669

Chapter 56: Properties


End Sub

MaxTextBlobCharacters Property
Syntax
UserClass.MaxTextBlobCharacters

Applies To
UserClass Object

Description
Sets or returns the maximum number of text-blob characters for the UserClass object.

Discussion
When you set this property, the HasTextBlobLimit Property is automatically set to True. Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface. Default: No limit

Type
Integer

Access
Read/Write

Example
This example limits the maximum number of characters to 50 that the first user class can reference from a large text object in the database.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2 objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true objUser.MaxTextBlobCharacters = 50 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

MetaDataItem Property
Syntax
QueryItem.MetaDataItem

670 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Applies To
QueryItem Object

Description
Returns a reference to the metadata item for the query item in the report.

Discussion
Use this property to gather information about the queries in a report.

Type
Object

Access
Read

Example
This example shows the name of the first folder, the number of query items, and the properties of each query item from the current report. To run this example, you must set Impromptu to single instance and open the report.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objImpRep As Object Dim objQueryItemsCol As Object ' collection Dim objFolderItemCol As Object ' collection Dim objTempFolderItem As Object Dim objMetaDataItem As Object Dim i, count As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True Set objImpCat = objImpApp.ActiveCatalog Set objImpRep = objImpApp.ActiveDocument Set objQueryItemsCol = objImpRep.QueryItems Set objFolderItemCol = objImpCat.Folders(1).Items ' get children of 1st folder MsgBox "The first folder is " & objFolderItemCol(1).Name count = objQueryItemsCol.count MsgBox "QueryItems.Count = " & count For i = 1 To count Set objTempFolderItem = objQueryItemsCol.Item(i).FolderItem Set objMetaDataItem = objQueryItemsCol.Item(i).MetaDataItem If (objQueryItemsCol.Item(i).FolderPath = "") Then MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _ "Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _ "Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _ " *** FOLDER ITEM NOT FOUND *** " & Chr$(13) & _ "MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _ "MetaDataItem.Name = " & objMetaDataItem.Name Else MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _ "Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _ "Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _ "FolderPath = " & objQueryItemsCol.Item(i).FolderPath & Chr$(13) & _ "FolderItem.Name = " & objTempFolderItem.Name & Chr$(13) & _ "MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _ "MetaDataItem.Name = " & objMetaDataItem.Name End If Next i End Sub

Administration Guide 671

Chapter 56: Properties

Related Topics
"FolderItem Property" (p. 644) "FolderPath Property" (p. 645) "MetaDataPath Property" (p. 672) "QueryItem Property" (p. 685) "QueryItems Collection" (p. 501) "QueryItems Method" (p. 591)

MetaDataPath Property
Syntax
QueryItem.MetaDataPath

Applies To
QueryItem Object

Description
Returns the metadata path for the query item in the report.

Discussion
Use this property to gather information about the queries in a report.

Type
Object

Access
Read

Example
This example shows the name of the first folder, the number of query items, and the properties of each query item from the current report. To run this example, you must set Impromptu to single instance and open the report.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objImpRep As Object Dim objQueryItemsCol As Object ' collection Dim objFolderItemCol As Object ' collection Dim objTempFolderItem As Object Dim objMetaDataItem As Object Dim i, count As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True Set objImpCat = objImpApp.ActiveCatalog Set objImpRep = objImpApp.ActiveDocument Set objQueryItemsCol = objImpRep.QueryItems Set objFolderItemCol = objImpCat.Folders(1).Items ' get children of 1st folder MsgBox "The first folder is " & objFolderItemCol(1).Name count = objQueryItemsCol.count MsgBox "QueryItems.Count = " & count For i = 1 To count Set objTempFolderItem = objQueryItemsCol.Item(i).FolderItem Set objMetaDataItem = objQueryItemsCol.Item(i).MetaDataItem If (objQueryItemsCol.Item(i).FolderPath = "") Then MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _ "Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _ "Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _

672 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


" *** FOLDER ITEM NOT FOUND *** " & Chr$(13) & _ "MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _ "MetaDataItem.Name = " & objMetaDataItem.Name Else MsgBox "[ Query Item #" & i & "]" & Chr$(13) & Chr$(13) & _ "Name = " & objQueryItemsCol.Item(i).Name & Chr$(13) & _ "Type = " & objQueryItemsCol.Item(i).Type & Chr$(13) & _ "FolderPath = " & objQueryItemsCol.Item(i).FolderPath & Chr$(13) & _ "FolderItem.Name = " & objTempFolderItem.Name & Chr$(13) & _ "MetaDataPath = " & objQueryItemsCol.Item(i).MetaDataPath & Chr$(13) & _ "MetaDataItem.Name = " & objMetaDataItem.Name End If Next i End Sub

Related Topics
"FolderItem Property" (p. 644) "FolderPath Property" (p. 645) "MetaDataItem Property" (p. 670) "QueryItem Property" (p. 685) "QueryItems Collection" (p. 501) "QueryItems Method" (p. 591)

MinimizeConnectTime Property
Syntax
UserClass.MinimizeConnectTime

Applies To
UserClass Object

Description
Sets or returns whether the connect time to the database is minimized.

Discussion
When this property is set to True, the Application object creates a temporary cache for query results and disconnects from the Database object as soon as the report has been run. Connection to the Database object is re-established when another query is run. When set to False, the Catalog object remains attached to the Database object while the Catalog object is open. Default: False Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Boolean

Access
Read/Write

Example
This example minimizes the catalog connection time to the database for the user class.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object

Administration Guide 673

Chapter 56: Properties


Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2 objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true objUser.MaxTextBlobCharacters = 50 Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Modified Property
Syntax
ReportDocument.Modified

Applies To
ReportDocument Object

Description
Returns whether the active report has been changed since the last time it was saved.

Discussion
Use this property to determine whether to save a report. If the report contains outstanding changes, or if it has never been saved, the Modified property returns the value -1 (TRUE). If the current report hasn't changed since the last time it was saved, the Modified property returns the value 0 (FALSE). Default: False

Type
Boolean

Access
Read

Example
This example saves the current report if the report was modified since the last time it was saved.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Const ReportModified = -1 Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument If objImpRep.Modified = ReportModified Then objImpRep.Save End If Set objImpRep = Nothing Set objImpApp = Nothing End Sub

674 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Name Property
Syntax
object.Name

Applies To
Application Object CatalogLevel Object Column Object Database Object DatabaseDefinition Object FolderItem Object QueryItem Object ReportDocument Object SchemaLevel Object SelectedFrame Object Table Object UserClass Object

Description
Returns the name of the object.

Discussion
Use this property to return the name of an Application object or a ReportDocument object. For an Application object, this property returns the OLE registration name for the Impromptu application as it is stored in the OLE registration database. For Impromptu version 4.0, this string is Cognos.Impromptu. For a ReportDocument object, this property returns the file name of the specified Impromptu report. For Database, CatalogLevel, SchemaLevel, Table, and Column objects, this property returns the name associated with the object. For a QueryItem object, this property returns a string representation of the identifier for the query item.

Type
String

Access
Read (Application, ReportDocument) Read/Write (Database, CatalogLevel, FolderItem, SchemaLevel, Table, Column)

Example
This example shows the name of the first CatalogLevel object in the database.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", "creator" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") If objDB.CatalogLevels.Count > 0 Then MsgBox objDB.CatalogLevels(1).Name End If Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing

Administration Guide 675

Chapter 56: Properties


End Sub

NameSpace Property
Syntax
Catalog.NameSpace

Applies To
Catalog Object

Description
Sets or returns a namespace for the catalog.

Discussion
Use this property to set the namespace that Access Manager uses for authentication. The namespace defined in the directory manager contains all the information necessary to authenticate users and govern their access to data sources. You can set the name to be any string that is not empty or blank. The string can have embedded spaces but not leading or trailing spaces. However, a new namespace must be defined in the directory server first. Because authentication information is stored in a namespace, you must specify the namespace when you try to log on to Access Manager. You specify namespaces for each catalog to determine where to find authentication information. Users, user classes, and all other signon information are defined in the namespace. Not all catalogs have namespaces. If a catalog does not have a namespace, Impromptu will use one of the following locations to get this information: the Impromptu.ini file the default namespace as defined by the Access Manager administrator

Type
String

Access
Read/Write (for the Creator user class) Read (if you open the catalog with any other user class)

Example
This example shows the name of the namespace for the open catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim strFileName As String Dim intIsLocked As Integer Dim strNameSpace As String On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog objImpCat.IsDistributed = False strFileName = objImpCat.Filename MsgBox "The file name of the catalog is " & strFileName intIsLocked = objImpCat.IsLocked if intIsLocked = 0 then MsgBox "The catalog is not locked " & _ "(value is " & intIsLocked & " )." else MsgBox "The catalog is locked " & _ "(value is " & intIsLocked & " )."

676 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


end if strNameSpace = objImpCat.NameSpace MsgBox "The catalog name space is " & strNameSpace & "." Set objImpCat = Nothing Set objImpApp = Nothing End Sub

NonIndexSortingPermission Property
Syntax
UserClass.NonIndexSortingPermission

Applies To
UserClass Object

Description
Sets or returns whether the UserClass object can sort non-indexed columns.

Discussion
Use the following values for this property: 0 = Allow 1 = Warn 2 = Prevent When sorting on non-indexed columns, you can hinder the performance of the Application object. By preventing certain UserClass objects from sorting on non-indexed columns, you can keep the Application object running at peak performance. Default: Allow (0) Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Integer

Access
Read/Write

Example
This example gives the user class permission to sort on non-indexed columns.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.CanCreateNewReports = false objUser.OuterJoinPermission = 1 objUser.NonIndexSortingPermission = 0 objUser.SelectDistinctPermission = 2 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Administration Guide 677

Chapter 56: Properties

OuterJoinPermission Property
Syntax
UserClass.OuterJoinPermission

Applies To
UserClass Object

Description
Sets or returns the outer join permission for the UserClass object.

Discussion
Use the following values for this property 0 = Allow 1 = Warn 2 = Prevent Outer joins can produce very large reports because on queries, all rows in one table even if there is not matching row in another table is retrieved. By preventing outer joins, you can eliminate unnecessarily large reports. Default: 0 (Allow) Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Integer

Access
Read/Write

Example
This example warns the user class when the user class uses outer joins to create or view reports.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.CanCreateNewReports = false objUser.OuterJoinPermission = 1 objUser.NonIndexSortingPermission = 0 objUser.SelectDistinctPermission = 2 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Parent Property
Syntax
collection.Parent

678 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Applies To
CatalogLevel Object Column Object DatabaseConnections Collection DatabaseDefinitions Collection Databases Collection DeniedColumns Collection DeniedSchemas Collection DeniedTables Collection FilteredTables Collection Items Collection SchemaLevel Object SelectedFrame Object TableLink Object CatalogLevels Collection Columns Collection DatabaseDefinition Object Database Object DeniedCatalogs Collection DeniedFolderItems Collection DeniedSelectValues Collection FilteredColumns Collection FolderItem Object ReportDocument Object SchemaLevels Collection Table Object UserClass Object

Description
Returns the parent object for the specified object.

Discussion
Use the Parent property to create generic procedures and functions that operate on parent objects. If the current object is an Impromptu report, you can use the Parent property to perform operations on its Application object For example, to change the user class for an active report object called IMPRep without knowing the name of the Application object, use the following:
ImpRep.Parent.ChangeUserClass "Manager"

Type
Object

Access
Read

Example
This example shows the name of the parent object for the first Table object in the database.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim strCatLoc As String strCatLoc = "C:\Catalogs\Sample.cat" Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True objImpApp.OpenCatalog strCatLoc, "Creator" Set objImpCat = objImpApp.ActiveCatalog MsgBox objImpCat.Databases(1).Tables(1).Parent.Name Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Administration Guide 679

Chapter 56: Properties

Path Property
Syntax
ReportDocument.Path

Applies To
ReportDocument Object

Description
Returns the path, not including the file name, for the specified report.

Discussion
Use the Path property to determine the location of a report. For example, use the Path property when you wish to save all the files created by a macro to the same location as the active report.

Type
String

Access
Read

Example
This example shows the location of the active report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.OpenReport _ ("C\Reports\Customer Discount.imr") Msgbox "The path of the report is:" & objImpRep.Path Set objImpRep = Nothing Set objImpApp = Nothing End Sub

PlainTextPassword Property
Syntax
UserClass.PlainTextPassword DatabaseConnection.PlainTextPassword

Applies To
DatabaseConnection Object UserClass Object

Description
Sets the unencrypted password for the database or for the user class.

Discussion
The string cannot be read to prevent unauthorized users from acquiring the plain-text password.

Type
String

680 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Access
Write

Example
This example sets the database password for a new user's connection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDBConnect As Object Dim objNewUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objNewUser = objImpCat.ActiveUserClass.UserClasses(2) Set objDBConnect = objNewUser.DatabaseConnections(1) objDBConnect.PlainTextPassword = "plain" objImpCat.Save Set objDBConnect = Nothing Set objNewUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

PublishHTML Property
Syntax
ReportDocument.PublishHTML

Applies To
ReportDocument Object

Description
Returns an object that is an HTML representation of a Report Document object.

Discussion
Use PublishHTML with the Publish method create an HTML version of a Report Document object. PublishHTML returns an object which Publish then outputs to a series of files in a directory. The report can be viewed using a browser.

Type
Object

Access
Read

Example
This example opens the Annual Product Sales report and publishes it as HTML. The Publish method places the HTML files into the folder called tmp and all the files have the prefix myfiles.
Sub Main() Dim objImpApp as Object Dim objHTML as Object Dim objImpRep as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\Great Outdoors Sales Data.cat" _ ,"Creator" Set objImpRep = objImpApp.OpenReport("c:\Program Files\" & _ "Cognos\<rendition_id>\samples\Impromptu\Reports\" & _ "Annual Product Sales.imr")

Administration Guide 681

Chapter 56: Properties


Set objHTML = objImpRep.PublishHTML objHTML.Publish "c:\tmp","myfiles" Set objImpRep = Nothing Set objHTML = Nothing Set objImpApp = Nothing End Sub

Related Topics
"Products (Publish as HTML) Sample" (p. 721) "Publish Method" (p. 588) "PublishHTML Object" (p. 473) "Sales By Country (Publish as HTML) Sample" (p. 722)

PublishPDF Property
Syntax
ReportDocument.PublishPDF

Applies To
ReportDocument Object

Description
Returns an object that is a PDF representation of a Report Document object.

Discussion
Use this property with the Publish method to create a PDF version of a Report Document object.

Type
Object

Access
Read

Example
This example opens an existing report in Impromptu (called Annual_Sales.imr) and then publishes it as a PDF called Annual_Sales.pdf in the C:\Temp folder. Users who do not have Impromptu can now use Adobe Acrobat Reader to view the report.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object Dim objPDFPub as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True Set objImpRep = objImpApp.OpenReportNoExecute("C:\My Documents\Annual_Sales.imr") objImpRep.Reexecute Set objPDFPub = objImpRep.PublishPDF objPDFPub.Publish "C:\Temp\Annual_Sales.pdf" Set objImpApp = Nothing Set objImpRep = Nothing Set objPDFPub = Nothing End Sub

Related Topics
"Publish Method" (p. 588) "PublishPDF Object" (p. 474)

682 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

QualificationLevel Property
Syntax
Table.QualificationLevel

Applies To
Table Object

Description
Sets or returns the number of parent names that precede the table name in the SQL statement.

Discussion
Use this property to set or verify the level of qualification for a table. Some databases organize tables into one or two levels of qualification called catalogs and scheme. A database may be structured as database to table (no qualification) database to schema to table (one level of qualification) database to catalog to schema to table (two levels of qualification) When you initially create a table, the level of qualification is set to the default (-1), which means that you use the full (maximum) table name. For example, if the level of qualification is 2, then the table name is preceded by the names of two parents at the most. Depending on the structure of qualification in the database, you may have database.schema.table database.catalog.table catalog.schema.table When you set the level of qualification, use the values from 0 to 3, depending on the number of parent names. For more information about qualification levels, see the Administrator's Guide. This property returns the values from -1 to 3. Default: No qualification (-1)

Type
Integer

Access
Read/Write

Example
This example shows the number of qualification levels for the alias table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objMaster As Object Dim strMasterName As String Dim intQualificationLevel As Integer Dim strUniqueID As String Dim intIsSynonym As Integer Dim intWeight As Integer On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("BRANCH").CreateAlias "BRANCH ALIAS"

Administration Guide 683

Chapter 56: Properties


Set objMaster = objDB.Tables("BRANCH ALIAS").MasterTable MsgBox "Master Table Name is " & objMaster.Name strMasterName = objDB.Tables("BRANCH ALIAS").MasterName MsgBox "Master Name is " & strMasterName & "." intQualificationLevel = objDB.Tables _ ("BRANCH ALIAS").QualificationLevel MsgBox "Qualification Level is " & _ intQualificationLevel & "." intIsSynonym = objDB.Tables("BRANCH ALIAS").IsSynonym if intIsSynonym = 0 then MsgBox "Table has no synonym " & _ "(Value is " & intIsSynonym & ")" else MsgBox "Table has a synonym " & _ "(Value is " & intIsSynonym & ")" end if intWeight = objDB.Tables("BRANCH ALIAS").Weight MsgBox "Table weight is " & intWeight & "." Set objMaster = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & _ Err & " occurred at line " & Erl Resume Done End Sub

QueryExecutionTimeWarnAfter Property
Syntax
UserClass.QueryExecutionTimeWarnAfter

Applies To
UserClass Object

Description
Sets or returns the time for the query execution at which the UserClass is warned.

Discussion
The time set for this property is the time the query is allowed to run before the UserClass object is warned. Note: The value for this property must be less than the value for the MaxQueryExecutionTime Property. Default: No limit

Type
Long

Access
Read/Write

Example
This example sets the maximum query execution time for the user class to three minutes. The user class is warned after two minutes.
Sub Main() Dim objImpApp As Object

684 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2 objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true objUser.MaxTextBlobCharacters = 50 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

QueryItem Property
Syntax
SelectedFrame.QueryItem

Applies To
SelectedFrame Object

Description
Returns a report query column name.

Discussion
QueryItem returns a string containing the query column item that identifies a selected text frame in a SelectedFrames collection. QueryItem returns an empty string for non-text frames.

Type
String

Access
Read

Example
This example shows the query column name of the selected text frame in the active report.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim objSelectedFrame As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument Set objSelectedFrame = objImpRep.SelectedFrames(1) With objSelectedFrame MsgBox .Name MsgBox .Formula MsgBox .DatabaseItem MsgBox .QueryItem End With Set objSelectedFrame = Nothing Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Administration Guide 685

Chapter 56: Properties

QueryProcessing Property
Syntax
UserClass.QueryProcessing

Applies To
UserClass Object

Description
Sets or returns the state of query processing for the UserClass object.

Discussion
Use the following values for this property: 0 = Unknown (this value cannot be specified when setting this property) 1 = Database Only 2 = Limited Local Processing 3 = Flexible Processing The database only option requires that the query be completely processed on the database server in one query submission. Default: Flexible Processing (3) Note: The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Integer

Access
Read/Write

Example
This example sets query processing to the database server for the user class. In this case, the user class cannot perform uery processing on the local computer.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2 objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true objUser.MaxTextBlobCharacters = 50 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

686 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

ReadIsolationLevel Property
Syntax
DatabaseConnection.ReadIsolationLevel

Applies To
DatabaseConnection Object

Description
Sets or returns the read-transaction isolation level to request when connecting to the database.

Discussion
Valid values for this property are -2 = passive transaction 0 = no transactions 1 = isolation level 1 2 = isolation level 2 3 = isolation level 3 4 = isolation level 4 5 = isolation level 5 6 = isolation level 6

Type
Integer

Access
Read/Write

Example
This example shows the numeric value that corresponds to the read-transaction isolation level of the database connection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDBConnect As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Imp_cat\" & _ "bi admin.cat","Creator",,"biadmin","biadmin" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass Set objDBConnect = objUser.DatabaseConnections(1) MsgBox objDBConnect.ReadIsolationLevel Set objDBConnect = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

ResultType Property
Syntax
Expression.ResultType

Administration Guide 687

Chapter 56: Properties

Applies To
Expression Object

Description
Returns an integer value for the type of data resulting from the expression.

Discussion
Valid values for this property are: 1 = Boolean 2 = number 3 = string 4 = date 5 = time 6 = date and time 7 = interval 8 = text blob

Type
Integer

Access
Read

Example
This example shows an integer value that represents the data type resulting from an expression in a column. In this case, the expression in the Sale Amount column would likely return a number.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatColumn as Object Dim objCatFolders as Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders Set objCatColumn = objCatFolders("Orders").Items("Sale Amount") MsgBox "Numeric result type is:" & CatColumn.ResultType Set objCatColumn = Nothing Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

RightTable Property
Syntax
TableLink.RightTable

Applies To
TableLink Object

Description
Returns the "right" table in the join.

688 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Discussion
Use this property with the name property to determine the name of table in a join that represents the many side of a one-to-many relationship

Type
Object

Access
Read

Example
This example shows the name of the right table in the second join of the TableLinks collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Dim strRightTable As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\Great Sample.cat" Set objImpCat = objImpApp.ActiveCatalog strRightTable = objImpCat.TableLinks(2).RightTable.Name MsgBox "The name of the right table is " & strRightTable Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

RowsRetrievedWarnAfter Property
Syntax
UserClass.RowsRetrievedWarnAfter

Applies To
UserClass Object

Description
Sets or returns the number of rows retrieved at which the UserClass object is warned.

Discussion
Use this property to control the number of rows that are retrieved for a report before the UserClass object is warned. Note: The value for this property must be less than the value for the MaxRowsRetrieved Property. Default: No limit

Type
Long

Access
Read/Write

Example
This example limits the number of rows to 100 that the user can retrieve from the database. In this case, the application warns the user after the user retrieves 70 rows.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object

Administration Guide 689

Chapter 56: Properties


Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2 objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true objUser.MaxTextBlobCharacters = 50 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

SchemaLevels Property
Syntax
Object.SchemaLevels

Applies To
CatalogLevel Object Database Object

Description
Returns a collection of SchemaLevel objects.

Discussion
If the Database object has a CatalogLevel collection but no SchemaLevel collection, trying to access an individual schema will fail.

Type
Object

Access
Read

Example
This example shows the name of the first SchemaLevel object in the CatalogLevels collection.
Sub Main() Dim objImpApp As Object Dim objSchemaLevels As Object Dim objCatalogLevels As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", _ "Creator", , "aaa", "bbb", False Set objSchemaLevels = objImpApp.ActiveCatalog.Databases _ (1).SchemaLevels If Not objSchemaLevels Is Nothing Then MsgBox "First schema level name is " & _ objSchemaLevels(1).Name Else Set objCatalogLevels = _ objImpApp.ActiveCatalog.Databases(1).CatalogLevels If Not objCatalogLevels Is Nothing Then

690 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


Set objSchemaLevels = objCatalogLevels _ (1).SchemaLevels If Not objSchemaLevels Is Nothing Then MsgBox "First schema level name is " & _ objSchemaLevels(1).Name Else MsgBox "This database doesn't support " & _ "schema levels." End If Else MsgBox "This database doesn't support " & _ "schema levels." End If If objSchemaLevels = Nothing objCatalogLevels = Nothing objImpApp = Nothing

End Set Set Set End Sub

SelectDistinctPermission Property
Syntax
UserClass.SelectDistinctPermission

Applies To
UserClass Object

Description
Sets or returns whether the UserClass object can set the query to select distinct values in a database.

Discussion
Use the following values for this property: 0 = Allow 1 = Warn 2 = Prevent Displaying duplicate rows can slow processing. By setting this property to Allow, you can optimize your processing time, by eliminating duplicates. Default: Allow (0)

Notes
If this property is set to 2 (Prevent), all columns are denied the permission to perform a Select Distinct operation regardless of whether they are FolderItem objects in the DeniedSelectValues collection. The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Integer

Access
Read/Write

Example
This example prevents the active user class from selecting distinct values for any column in the database.
Sub Main()

Administration Guide 691

Chapter 56: Properties


Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.CanCreateNewReports = false objUser.OuterJoinPermission = 1 objUser.NonIndexSortingPermission = 0 objUser.SelectDistinctPermission = 2 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

SelectedFrames Property
Syntax
ReportDocument.SelectedFrames

Applies To
ReportDocument Object

Description
Returns a list of the selected frame objects on the active report.

Discussion
SelectedFrames returns a list of pointers to each frame object selected on the Report Document. The list, also called the SelectedFrames collection, is arranged in the order in which the objects were selected. Individual SelectedFrame objects within the collection can be referenced by adding an index value to the property: report.SelectedFrames(2) Or, you can use the Item property with an index value: SelectedFrames.Item(2) Use the Count property first to determine the number of objects in the collection.

Example
This example shows the number of SelectedFrames in each of two SelectedFrames collections created, objList and objFullList. The SelectedFrames property returns the objList collection.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Dim objList As Object Dim objFullList As Object Dim intParentFrames As Integer Dim intChildFrames As Integer Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument Set objList = objImpRep.SelectedFrames Set objFullList = objImpRep.AllSelectedFrames intParentFrames = objList.Count intChildFrames = objFullList.Count - objList.Count MsgBox "Parent Frames:" & intParentFrames MsgBox "Child Frames:" & intChildFrames Set objFullList = Nothing Set objList = Nothing Set objImpRep = Nothing Set objImpApp = Nothing

692 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


End Sub

Related Topics
"AllSelectedFrames Property" (p. 613) "SelectedFrames Collection" (p. 502)

SQL Property
Syntax
ReportDocument.SQL

Applies To
ReportDocument Object

Description
Returns the SQL string from the Profile tabQuery dialog box.

Discussion
Use the Report SQL Property to retrieve the SQL string from the Profile tabQuery dialog box. For example, to set the string variable IMP_SQL to be the SQL for the ImpRep Object, insert the following into your macro:
IMP_SQL = ImpRep.SQL

Type
String

Access
Read

Example
This example shows the SQL statement for the active report query.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.ActiveDocument Msgbox objImpRep.SQL Set objImpRep = Nothing Set objImpApp = Nothing End Sub

SuppressTOCDuplicates Property
Syntax
PublishHTML.SuppressTOCDuplicates

Applies To
PublishHTML Object

Description
Sets or returns whether report footer information is added to the Report Navigator when a report is saved as HTML.

Administration Guide 693

Chapter 56: Properties

Discussion
When a report is saved in HTML format, you can create a Report Navigator to act as a table of contents. It contains a list of grouped data items. If the group contains both header and footer information, both can appear in the contents. Sometimes the header and footer contain identical information which means duplicates will appear in the Report Navigator. Set the SuppressTOCDuplicates property to True to prevent footer entries from being added to the Report Navigator. When used without being assigned a value, the property returns its current setting. The default is False. Note: If a grouped data item appears in a header and in a primary list frame, it's not duplicated in the Report Navigator regardless of the setting for SuppressTOCDuplicates. A Report Navigator is not created unless at least one of these properties is set to True: TOC or TOCByPageNumber.

Type
Boolean

Access
Read/Write

Example
This example publishes the open report in HTML format with a table of contents. In this case, footer entries for the report are not added to the Report Navigator.
Sub Main() Dim objImpApp as Object Dim objImpRep as Object Dim objImpHTMLRep as Object Const ReportLocation = "C:\Program Files\Cognos\<rendition_id>\" & _ "samples\Impromptu\Reports\Sales by Country" & _ "(Publish as HTML).imr" Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpRep = objImpApp.OpenReport(ReportLocation) Set objImpHTMLRep = objImpRep.PublishHTML objImpHTMLRep.Reset objImpHTMLRep.TOC = 1 objImpHTMLRep.ClearTOCColumns objImpHTMLRep.TOCAddColumn "Country" objImpHTMLRep.SuppressTOCDuplicates = True objImpHTMLRep.Publish "C:\Temp", "sales" Set objImpHTMLRep = Nothing Set objImpRep = Nothing Set objImpApp = Nothing End Sub

Related Topics
"TOC Property" (p. 697) "TOCByPageNumber Property" (p. 697)

TableLinks Property
Syntax
Catalog.TableLinks

Applies To
Catalog Object

Description
Returns a collection of TableLink objects.

694 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Discussion
Use this property to get the collection of joins.

Type
Object

Access
Read

Example
This example shows the join type of the first table link in the active catalog.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objLink As Object Dim strLinkType As String Set objImpApp = CreateObject("CognosImpromptu.Application") Set objImpCat = objImpApp.ActiveCatalog Set objLink = objImpCat.TableLinks(1) strLinkType = objLink.Type MsgBox "The type of the first link in the" & _ "catalog is " & strLinkType Set objLink = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Related Topics
"TableLink Object" (p. 483)

Tables Property
Syntax
object.Tables

Applies To
CatalogLevel Object Database Object SchemaLevel Object

Description
Returns a collection of Table objects.

Discussion
If the Database object supports qualification levels, attempts to access a specific Table object will fail because the name of the Table object is ambiguous. Full qualification must be provided.

Type
Object

Access
Read

Example
This example shows the name of the first table in the Tables collection.
Sub Main()

Administration Guide 695

Chapter 56: Properties


Dim objDB As Object Dim objImpApp As Object Dim objImpCat As Object Dim strTableName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases("OUTDOORS") strTableName = objDB.Tables(1).Name MsgBox strTableName Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

TablesPerReportWarnAfter Property
Syntax
UserClass.TablesPerReportWarnAfter

Applies To
UserClass Object

Description
Sets or returns the number of tables used per report at which the UserClass object is warned.

Discussion
Use this property to warn the UserClass object that it is reaching the table limit set with the MaxTablesPerReport Property. Default: No limit

Notes
The value for this property must be less than the value of the MaxTablesPerReport property. The value of this property is inherited by all child UserClass objects following the same user class inheritance rules as in the user interface.

Type
Integer

Access
Read/Write

Example
This example sets the maximum number of tables to 10 that a user can retrieve for a report. In this case, the application warns the user after the user retrieves five tables.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\temp\outtest1.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass.UserClasses(1) objUser.MaxRowsRetrieved = 100 objUser.RowsRetrievedWarnAfter = 70 objUser.MaxTablesPerReport = 10 objUser.TablesPerReportWarnAfter = 5 objUser.MaxQueryExecutionTime = 3 objUser.QueryExecutionTimeWarnAfter = 2

696 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


objUser.QueryProcessing = 1 objUser.MinimizeConnectTime = true objUser.MaxTextBlobCharacters = 50 objImpCat.Save Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

TOC Property
Syntax
PublishHTML.TOC PublishExcel.TOC

Applies To
PublishHTML Object

Description
Sets or returns whether HTML and PDF report output includes the Report Navigator.

Discussion
If set, the Report Navigator is created for the HTML and PDF report output. If set to False, the report output does not contain the Report Navigator. If set to True, the report ouput contains a Report Navigator. The default is the current setting.

Type
Boolean

Access
Read/Write

Related Topics
"SuppressTOCDuplicates Property" (p. 693) "TOCByPageNumber Property" (p. 697)

TOCByPageNumber Property
Syntax
PublishHTML.TOCByPageNumber

Applies To
PublishHTML Object

Description
Sets or returns whether the Report Navigator contains page numbers and activates the Report Navigator.

Discussion
If set to False, the Report Navigator is not included. If set to True, the Report Navigator is included. TOCByPageNumber will set TOC to True.

Type
Boolean

Administration Guide 697

Chapter 56: Properties

Access
Read/Write

Related Topics
"SuppressTOCDuplicates Property" (p. 693) "TOC Property" (p. 697)

ToPage Property
Syntax
PublishHTML.ToPage

Applies To
PublishHTML Object

Description
Sets or returns which page of the Impromptu report will be the last page of the HTML report.

Discussion
The default value is the current value in the Options box. If youve never changed the default, it is 65535. The ToPage value should be greater than or equal to the FromPage value.

Type
Integer

Access
Read/Write

Type Property
Syntax
object.Type

Applies To
Column Object DatabaseDefinition Object QueryItem Object TableLink Object

Description
Sets or returns the data type of the Column object, the type of join, the query item or the type of database, depending on the object.

Discussion
Use this property to set or return the datatype of a column or the specification of a join. Also, use this property to return the type of query item or database. Use the following values for the Column object: 1 = Char 2 = Var Char 6 = Decimal 7 = Float 13 = Time 14 = DateTime

698 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

3 = Long Var Char 4 = Small Int 5 = Integer

8 = Double 11 = Quad 12 = Date

15 = Interval 18 = Text

QueryItem objects return the following values: 0 = Null type 1 = Boolean 2 = Numeric 3 = Character String 4 = Date 5 = Time 6 = DateTime 7 = Interval 8 = Text Blob

Use the following values for the TableLink object: 0 = Inner Join 1 = Left Outer Join 2 = Right Outer Join 3 = Full Outer Join The two-character database type code is case sensitive. DatabaseDefinition objects return the following values: "D2" = DB/2 "DB" = DBASE "PX" = PARADOX "MS" = SQLSERVER "MX" = SQLSERVER65 "BD" = BDE "OD" = ODBC "SY" = SYBASE "QS" = HOTFILE "SB" = SQLBASE "CT" = SYSTEM10 "IF" = INFORMIX "IG" = INGRES "IB" = INTERBASE "OR" = ORACLE7

Type
Integer (Column, QueryItem, and TableLink) String (DatabaseDefinition)

Access
Read/Write (Column and TableLink) Read (DatabaseDefinition and QueryItem)

Example
This example shows the database type of the Outdoors database.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim strDBDefinition As String Dim strType As String Dim intIsExternal As Integer On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") Set objDB = objImpApp.DatabaseDefinitions strDBDefinition = objDB("OUTDOORS").Definition MsgBox "Data Base Definition is " & strDBDefinition strType = objDB("OUTDOORS").Type MsgBox "Data Base Type is " & strType & "." intIsExternal = objDB("OUTDOORS").IsExternal

Administration Guide 699

Chapter 56: Properties


if intIsExternal = 0 then MsgBox "Data Base is not External "(Value is " & intIsExternal & else MsgBox "Data Base is External " & "(Value is " & intIsExternal & end if Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & _ " occurred at line " & Erl Resume Done End Sub

" & _ ")" _ ")"

UniqueID Property
Syntax
object.UniqueID

Applies To
Catalog Object Column Object FolderItem Object Table Object

Description
Sets or returns the unique metadata identification for the object.

Discussion
Use this property when you create a new catalog to specify a unique metadata identification by using a 32-bit signed integer. If you use this property to change an existing catalog ID, the change will affect all the reports created with that catalog. For the table object, this property returns the unique metadata identification for the table within a catalog. The unique metadata identification is the string representation of a pair of 32-bit integers in two eight hexadecimal digit character strings separated by a comma. For the column object and the folder item object, this property returns a unique metadata identification for the column in a table or for each folder item with the same format as the identification for the Table object.

Type
Integer (Catalog object) String (Table, Column, and FolderItem objects)

Access
Read/Write (Catalog object) Read (Table, Column, and FolderItem objects)

Example
This example shows the unique metadata identification of the alias table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object

700 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties


Dim objDB As Object Dim objMaster As Object Dim strMasterName As String Dim intQualificationLevel As Integer Dim strUniqueID As String Dim intIsSynonym As Integer Dim intWeight As Integer On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("BRANCH").CreateAlias "BRANCH ALIAS" Set objMaster = objDB.Tables("BRANCH ALIAS").MasterTable MsgBox "Master Table Name is " & objMaster.Name strMasterName = objDB.Tables("BRANCH ALIAS").MasterName MsgBox "Master Name is " & strMasterName & "." strUniqueID = objDB.Tables("BRANCH ALIAS").UniqueID MsgBox "Unique ID is " & strUniqueID & "." intQualificationLevel = objDB.Tables _ ("BRANCH ALIAS").QualificationLevel MsgBox "Qualification Level is " & _ intQualificationLevel & "." intIsSynonym = objDB.Tables("BRANCH ALIAS").IsSynonym if intIsSynonym = 0 then MsgBox "Table has no synonym " & _ "(Value is " & intIsSynonym & ")" else MsgBox "Table has a synonym " & _ "(Value is " & intIsSynonym & ")" end if intWeight = objDB.Tables("BRANCH ALIAS").Weight MsgBox "Table weight is " & intWeight & "." Set objMaster = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & _ " occurred at line " & Erl Resume Done End Sub

UseQueryWarnings Property
Syntax
Application.UseQueryWarnings QueryWarnings

Applies To
Application Object

Description
Sets whether Impromptu ignores warnings when executing a query.

Discussion
The UseQueryWarnings property enables or disables Impromptu's treatment of query warnings as errors. Query warnings are generated with a numeric identifier in the range 300 to 499. To have your OLE automation scripts ignore warnings such as those issued by the report Governor when the number of tables for a user class is exceeded, set UseQueryWarnings to 0.

Administration Guide 701

Chapter 56: Properties Default:False Parameters QueryWarnings Description Required. Specifies whether Impromptu ignores warnings when executing a query. Type: Boolean True = turn off warnings False = use warnings

Type
Boolean

Access
Write

Related Topics
"GetNextQueryError Method" (p. 569)

UserClasses Property
Syntax
UserClass.UserClasses

Applies To
UserClass Object

Description
Returns a collection of UserClass objects based on this UserClass object.

Discussion
Only the UserClass object called "Creator " does not have this relation with its parent object.

Type
Object

Access
Read

Example
This example shows the usernname of the first UserClass object in the active UserClasses collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim strUserName As String Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = ImpApp.ActiveCatalog strUserName = objImpCat.ActiveUserClass.UserClasses(1).Name MsgBox "The name of the user is " & strUserName Set objImpCat = Nothing Set objImpApp = Nothing End Sub

702 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

UserName Property
Syntax
DatabaseConnection.UserName

Applies To
DatabaseConnection Object

Description
Sets or returns the name used to log onto the database.

Discussion
Although each UserClass object does not require a password, a name is required to identify the class.

Type
String

Access
Read/Write

Example
This example shows the username for the first database connection in the DatabaseConnection collection.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDBConnectObj As Object Dim objUser As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "c:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objUser = objImpCat.ActiveUserClass Set objDBConnectObj = objUser.DatabaseConnections(1) MsgBox objDBConnectObj.UserName Set objDBConnectObj = Nothing Set objUser = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Value Property
Syntax
FolderItem.Value

Applies To
FolderItem Object

Description
Returns the Expression object associated with the FolderItem object.

Discussion
This property returns Nothing for folder (non-value) items.

Administration Guide 703

Chapter 56: Properties

Type
Object

Access
Read

Example
This example shows that top-level folders do not have Expression objects.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objCatFolders As Object Dim inti As Integer Dim objExpression As Object Set objImpApp = CreateObject("Impromptu.Application") objImpApp.Visible True objImpApp.OpenCatalog "E:\Catalogs\GO.cat", "Creator" Set objImpCat = objImpApp.ActiveCatalog Set objCatFolders = objImpCat.Folders If objCatFolders.Count > 0 Then For inti = 1 To objCatFolders.Count Set objExpression = objCatFolders(inti).Value ' top level folders do not have expressions associated If objExpression Is Nothing Then MsgBox objCatFolders(inti).Name Set objExpression = Nothing Next inti End If Set objCatFolders = Nothing Set objImpCat = Nothing Set objImpApp = Nothing End Sub

Version Property
Syntax
PublishExcel.Version

Applies To
PublishExcel Object

Description
Defines the Microsoft Excel version of the exported report.

Discussion
Use this property to control the version of Microsoft Excel in which a report is exported. You can export to either Microsoft Excel 2000 or Microsoft Excel 2002 and higher. If no value is assigned, this property returns the current setting. The default value is obtained from the report properties. The values you can use for this property are Value 0 1 Description Microsoft Excel 2000 Microsoft Excel 2002 and higher

Type
Integer

704 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Access
Read/Write

Example
This example creates a report in Microsoft Excel format for Microsoft Excel 2002 or higher.
Sub Main() Dim ImpApp as Object Dim ImpRep as Object Dim ImpExcelRep as Object Dim ImpPath as String MsgBox "Publish as Excel" Set ImpApp = CreateObject("CognosImpromptu.Application") ImpApp.Visible 1 'make Impromptu visible ImpPath = "C:\Program Files\Cognos\<rendition_id>\Samples\Impromptu\" Set ImpRep = ImpApp.OpenReport (ImpPath & "Reports\currency.imr") ImpRep.Visible 1 Set ImpExcelRep = ImpRep.PublishExcel ImpExcelRep.Version 1 ImpExcelRep.ExportOptions 15 ImpExcelRep.Publish ImpPath & "Reports\currency.xls" ImpApp.Quit Set ImpExcelRep = Nothing Set ImpRep = Nothing Set ImpApp = Nothing End Sub

Related Topics
"Publish Method" (p. 588) "PublishExcel Object" (p. 472) "ExportOptions Property" (p. 640)

Weight Property
Syntax
Table.Weight

Applies To
Table Object

Description
Sets or returns the weight of the table.

Discussion
Use this property to help optimize joins for tables. For example, tables with higher weights will be put lower in the SQL from clause so that they are retrieved first. When filtering on a table, that table should be read first for best performance. For example, if you have two tables, one with 10,000 records and one with 50 records, and the query is slow, it may be retrieving the table with 10,000 records first. Use the Weight property for the two tables to verify that this processing is happening. Therefore, all 10,000 records are read, and then the corresponding table with 50 records is read and filtered in or out. You can lower the weight of the table with 50 records to reduce the number of records the query reads. Use the following valid values: minimum value = 1 maximum value = 30,000

Type
Integer Administration Guide 705

Chapter 56: Properties

Access
Read/Write

Example
This example shows the weight of the alias table.
Sub Main() Dim objImpApp As Object Dim objImpCat As Object Dim objDB As Object Dim objMaster As Object Dim strMasterName As String Dim intQualificationLevel As Integer Dim strUniqueID As String Dim intIsSynonym As Integer Dim intWeight As Integer On error goto ErrorRoutine Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.OpenCatalog "C:\Catalogs\Sample.cat" Set objImpCat = objImpApp.ActiveCatalog Set objDB = objImpCat.Databases(1) objDB.Tables("BRANCH").CreateAlias "BRANCH ALIAS" Set objMaster = objDB.Tables("BRANCH ALIAS").MasterTable MsgBox "Master Table Name is " & objMaster.Name strMasterName = objDB.Tables("BRANCH ALIAS").MasterName MsgBox "Master Name is " & strMasterName & "." intQualificationLevel = objDB.Tables _ ("BRANCH ALIAS").QualificationLevel MsgBox "Qualification Level is " & _ intQualificationLevel & "." intIsSynonym = objDB.Tables("BRANCH ALIAS").IsSynonym if intIsSynonym = 0 then MsgBox "Table has no synonym " & _ "(Value is " & intIsSynonym & ")" else MsgBox "Table has a synonym " & _ "(Value is " & intIsSynonym & ")" end if intWeight = objDB.Tables("BRANCH ALIAS").Weight MsgBox "Table weight is " & intWeight & "." Set objMaster = Nothing Set objDB = Nothing Set objImpCat = Nothing Set objImpApp = Nothing Done: Exit Sub ErrorRoutine: MsgBox "Error Number:" & Err & _ " occurred at line " & Erl Resume Done End Sub

WindowState Property
Syntax
object.WindowState

Applies To
Application Object ReportDocument Object

Description
Sets or returns the window size of an application or a report document. 706 IBM(R) Cognos(R) Impromptu(R)

Chapter 56: Properties

Discussion
Use the following values for both applications and report documents: 0 = minimized 1 = maximized 2 = last setting

Type
Integer

Access
Read/Write

Example
This example shows the Impromptu application and then maximizes both the application and report document.
Sub Main() Dim objImpApp As Object Dim objImpRep As Object Set objImpApp = CreateObject("CognosImpromptu.Application") objImpApp.Visible True Set objImpRep = objImpApp.OpenReportNoExecute("C:\My Documents\Annual_Sales.imr") objImpRep.Reexecute objImpApp.WindowState = 1 objImpRep.WindowState = 1 Set objImpApp = Nothing Set objImpRep = Nothing End Sub

Administration Guide 707

Chapter 56: Properties

708 IBM(R) Cognos(R) Impromptu(R)

Chapter 57: Sample Macros


Purpose
Impromptu comes with a library of sample macros, which are installed in the same location as Impromptu, in the \Samples\Impromptu\Macros subdirectory. These macros demonstrate the features of the macro language and act as templates that you can customize for your applications. You can run a macro different ways, depending on the purpose: by using the Macro option on the Tools menu in Impromptu by using the Customize Toolbars command on the Tools menu in Impromptu to set up a Launch button (for more information, see using a command or toolbar button in the Impromptu online help) at startup by using a command line option when you open a report by using IBM CognosScript Editor by using Scheduler Use Scheduler, to coordinate your macros to automatically run unattended at set dates and times. OLE interface can run a macro. Scheduler stores catalog user IDs, database user IDs, and passwords in an encrypted format so that they can't be seen when the tasks are running. For more information, see the Setup tab of each sample.

Customize Samples
You can copy, change, and then use the macro samples for your reports and catalogs. Because the IBM CognosScript language is compatible with Visual Basic, you can change a sample macro by using one of the following: the IBM CognosScript Editor any text editor, such as Notepad. However, you cannot compile or run a macro from a text editor. any Visual Basic compatible macro editor When you customize a sample macro, ensure that you first copy the macro to a different directory or save it under a different name. Compile and run the macro in IBM CognosScript Editor or another Visual Basic-compatible macro editor. If you cannot find the sample macros, check that they were installed. For more information see, the installation guide for instructions.

Annotation Sample
Purpose
Uses custom online help files with reports.

Discussion
This macro works with the Annual Product Sales.imr sample report. When you select a frame on that report and click the launch button, the macro returns short descriptions of the frame. You can use several methods, properties, and objects to open customized help files from within a report. However, you must first create the help file by using a third-party tool for creating Windows help and then create a macro to open topics within that help file.

Administration Guide 709

Chapter 57: Sample Macros

Main Features
This macro uses the HELP_CONTEXT and HELP_CONTEXTPOPUP constants for both standard help windows and help pop-up windows the assignment to lngRetVal before the first Case statement as a call to retrieve the handle for the open help window the SelectedFrames Property to return the name of the selected frame that the Conversion function then converts to an integer The first Select Case statement (for intTopicID) uses the integer. It determines in which type of window the help message appears: HELP_CONTEXT for any topic with links to other topics or HELP_CONTEXTPOPUP for topics without links. (Using a pop-up window with links can cause Windows errors.) the report name for each frame that is provided by Impromptu (for example, Report Body) The second Select Case statement (for strFrame) assigns a number to each of these names. That number maps to a topic in the help file. For example, in the sample, the value 1 links to a help topic with an ID of HIDA_REPORTFRAME_Report_Body. This macro also passes values to WinHelp as lngRetVal (the help window identifier), HELP_FILE (a constant that points to the help file), intHelpConstant (sets the type of help window to open), and lngTopicID (the help topic ID). These values tell WinHelp what text to retrieve, and where and how to show it.

Related Topics
"SelectedFrames Collection" (p. 502)

Setup
To run this macro, first add a launch button to your toolbar with the correct location of the Annotation.mac file. The macro is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu. See "Set Up a Launch Button" in the Mastering Impromptu Reports online book. In the \Samples\Impromptu\Reports subdirectory, open the Annual Product Sales.imr sample report. Select one frame and click the launch button to run the macro. The macro retrieves the Annual Product Sales.hlp file. If you installed Impromptu in a location other than the default location, or a message appears that states the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Set the correct location for the file. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Set the value for the HELP_FILE constant to the correct location for the help file to access. If you don't need both a standard help window and a help pop-up window, remove the applicable constant declaration for HELP_CONTEXT or HELP_CONTEXTPOPUP. In the first Select Case statement (for intTopicID), adjust the code to match the topic numbers in your help file to the correct type of window. If you don't need both types of help windows, remove this Select Case statement and replace it with one of the following statements:
intHelpConstant = HELP_CONTEXT intHelpConstant = HELP_CONTEXTPOPUP

In the second Select Case statement (for strFrame), change the frame names and associated comment to match the frames in your report. Ensure that the numbers assigned map to the correct topic in your help file.

710 IBM(R) Cognos(R) Impromptu(R)

Chapter 57: Sample Macros

Add Catalog Prompts Sample


Purpose
Adds catalog prompts to a catalog.

Discussion
This macro creates a copy of an existing sample catalog, adds a new folder to the copy, and appends the following types of prompts to it: type-in prompt file picklist report picklist catalog picklist

Main Features
This macro checks for an open catalog If a catalog is open, the macro prompts you to close it or to exit the macro. If you close the catalog, the next message explains that the macro creates a new catalog and provides you another chance to exit. If you don't exit, the macro checks to see if the GOSales With Prompts.cat already exists. If so, a message prompts you to delete the existing catalog or to exit the macro. If you say ok, then the macro then executes the remainder of the statements. saves the new catalog uses the Const declarations below the Dim statements to set parameter values used by the AddItem and AppendEx methods. Do not change the values for use_prompt and token_prompt. The other constants relate to the prompt type. uses the parameters of the AppendEx method to define the use and nature of each prompt Each of the AppendEx methods in the macro uses the constant token_prompt as the first parameter. You can use the integer 110 instead. The third parameter always defines the prompt message. The second parameter sets one of four prompt types as 1 (a type-in prompt), 2 (a file picklist prompt), 3 (a report picklist prompt), or 4 (a catalog picklist prompt). uses additional parameters to further refine the prompt definition uses the first set of AddItem and AppendEx methods to create a type-in prompt for a price limit The value is numeric with a default of 1,999.99. uses the second set of AddItem and AppendEx methods to create a file picklist prompt In this case, the fourth parameter points to the file where you can find the picklist values. uses the third set of AddItem and AppendEx methods to create a report picklist prompt In this case, the fourth parameter gives the location of an existing, non-active report. The fifth parameter states that you will be prompted for a date value and the sixth parameter indicates the column, Order Date, which you can use to retrieve values for the picklist. uses the fourth set of AddItem and AppendEx methods to create a catalog picklist prompt In this case, the fourth parameter states which catalog folder item you can use to retrieve values for the picklist.

Setup
For best results, close Impromptu before you run this macro. See "Run a Macro in Impromptu Using a Command Line Option" (p. 460). This macro is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu. It retrieves the citylist.txt file in the \Samples\Impromptu\Reports\Samples Support subdirectory. This sample closes any catalog already open when you run this macro.

Administration Guide 711

Chapter 57: Sample Macros After you run the macro, the new catalog GOSales With Prompts.cat is in the \Samples\Impromptu\Reports\Samples Support subdirectory. It contains the new prompts. If the catalog GOSales With Prompts.cat already exists in this subdirectory, then the macro overwrites the catalog. If a message appears stating that the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Set the correct location for the file. You only need the subdirectory information because a function in the macro determines where you installed Impromptu. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: If you don't have to copy an existing catalog, comment out or delete the FileCopy statement. Change the name of the catalog in the OpenCatalog method. You may also have to change the user class or add a user class password. Decide which prompt types you need. Comment out or delete AddItem and AppendEx method sets that you don't need. Change the remaining AddItem and AppendEx method sets. For example, change the message, file names and locations, column references, default values.

Drill-Through Report Sample


Purpose
Creates dynamic dialog boxes that filter information in an Impromptu report.

Discussion
You can set up a drill through for any cell in an Impromptu report, so that you can view detail information for the value that you select. The drill through command is available for list reports, crosstab reports, sub-reports, charts and reports using HotFiles or snapshots. When you first run this macro, a dialog box appears with a list of sales representatives and a list of the products. When you select a sales person's name (the first is selected by default), a product report is accessed in the background, and the report contains all the products related to that sales person. Usually, you select the sales person to report on and a product, and click OK. A report appears that contains only the products information related to the selected sales person.

Main Features
This macro shows a dialog box to prompt you The macro reads the data in the salesrep.txt file into an array and uses it to fill the SalesReps box. It then uses the first name in the list in the OpenDrillDownReport Method to query the products.imr report. describes and passes the terms of an OpenDrillDownReport query using predicates A predicate is a string that provides the column names (equivalent to the Data tab of a report query) and values to use as data filters. The columns named in the predicate must exist in both reports for values to be returned. retrieves and adds all products from the products.imr report that belong to the selected sales representative in the SalesRep box When you select a different sales representative, the macro queries the products.imr report again by using a different sales representative name as the selection value or filter. uses a second OpenDrillDownReport method to access the report Product Orders Drill-through 4.imr, after you have selected a product or products that belong to a sales representative

712 IBM(R) Cognos(R) Impromptu(R)

Chapter 57: Sample Macros

Setup
To run this macro, first open the GOSales.cat sample catalog. Run the macro, which is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu, from the Macro option on the Tools menu. The catalog is in the \Samples\Impromptu\Reports subdirectory. The macro uses a file called salesrep.txt, located in the \Samples\Impromptu\Reports\Samples Support subdirectory, and following files from the \Samples\Impromptu\Reports subdirectory: Product Orders Drill-through 4.imr products.imr It also creates the products.txt file and places it in the Samples Support subdirectory. If you installed Impromptu in a location other than the default location, or a message appears that states the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Set the correct location for the file. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Change the messages and data references in the dialog box. Change the location of your reports in the FilePath constant. In the OpenReport subroutine, change the name that follows the ExportText method.

Open Report Sample


Purpose
Opens different reports based on built-in prompt selections.

Discussion
Many Impromptu reports prompt for values when the report opens. However, sometimes you may want to automate the prompting process, such as for reports run on a daily basis. The Open Report macro automates reports using built-in prompt selections. When you run this macro, a dialog box appears that lists several report names and the related prompt values. You can only select the report, not the prompt values. When you select a report, the macro passes one or more predetermined prompt values to the OpenReport method and then the selected report appears.

Main Features
This macro calls a dialog box uses the OpenReport Method uses the value of the group1 dialog box function (in this case, the value ranges from 0 to 5 for the dialog options) in an If/Else statement to select the report to open passes a unique set of prompt values that are hard-coded into the statement to the opened report Some reports appear twice in the dialog box, but none of them have the same set of prompt values.

Setup
To run this macro, first open the GOSales.cat sample catalog. Run the macro, which is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu, from the Macro option on the Tools menu. The catalog is in the \Samples\Impromptu\Reports subdirectory.

Administration Guide 713

Chapter 57: Sample Macros The macro uses the following files in the \Samples\Impromptu\Reports\Samples Support subdirectory: Sales_Volume_by_Country_(prompt).imr Sales_Comparison_by_Product.imr Product_Details_(prompt).imr Actual_Sales_Against_Target_Sales(prompt).imr If you installed Impromptu in a location other than the default location, or a message appears that states the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the name in the ReportPath to the correct subdirectory. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Change the location of your reports in the ReportPath constant. Change the constants for the various reports, such as ReportOne and ReportTwo, to match your file names. Change the label strings in the dialog box. Everywhere the strPromptValues string object appears, change the values to match your prompt values.

Scheduled Job Sample


Purpose
Automates task management in Scheduler.

Discussion
This macro shows a dialog box with all pending and completed tasks in Scheduler. Click the buttons next to the list to show information related to any pending or completed task. You can also use a button to add new tasks to the pending list or delete completed tasks. In this sample, the properties of new tasks are predefined.

Main Features
This macro closes any open catalog and opens the GOSales catalog It then opens Scheduler. gets references to all completed tasks in Scheduler using the SetUpCompletedArray function These tasks will go in the Completed Tasks box. gets references to all pending tasks in Scheduler using the SetUpPendingArray function These references will go in the Pending Tasks box. Then, a dialog box appears that includes the boxes, Scheduler data, and buttons. performs one of several actions, depending on which buttons you selected in the dialog box, with a Select Case statement The PendingInfo button gives details of the selected pending task. The CompletedInfo button gives details of the selected completed task. places the ID for that task into the proper variable with the TaskHandler function, when you select a new task from either box

Setup
To run this macro, start Impromptu but don't open any catalogs. The macro closes an open catalog. Run the macro, which is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu, from the Macro option on the Tools menu.

714 IBM(R) Cognos(R) Impromptu(R)

Chapter 57: Sample Macros The macro retrieves the GOSales.cat catalog and the Annual Product Sales.imr report in the \Samples\Impromptu\Reports subdirectory. If a message appears stating that the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Set the correct subdirectory for the file. You need only the subdirectory information because a function in the macro determines where you installed Impromptu. 3. Save the macro and run the sample macro again.

Custom
You can customize this macro by following these instructions: Change the name of the catalog in the OpenCatalog method. Change the name for Case 1.

Catalog Content Sample


Purpose
Examines the contents of a catalog and records information about the catalog in a text file.

Discussion
This macro is made up of subroutines and functions that examine the catalog for catalog information, database information, columns, tables, folders, joins, and user classes. You can use this macro to create data that you can import into a word processor as part of your system documentation.

Main Features
This macro creates and opens the content.txt file copies catalog properties and database information, and checks to see if the catalog has catalog levels, schema levels, or both If so, the macro calls the function TableInfo, which loops through all columns of each table and copies relevant information to the text file. copies folder information to content.txt using the TraverseFolders procedure The macro passes two parameters to this function, one for a folders collection or folder object, and one for the level. This procedure loops through all folders and items for each level within the folder structure. gets the join information for the tables It uses a For - Next loop to go through all the joins and copies the join type and join expressions to the file. retrieves user class information using the UserClassInfo procedure It first copies the Creator user class information and then all child classes of Creator. If the first child of Creator has its own child, the TraverseUserClass procedure is used to step down to that level. uses the DecodeDataType function to convert column types from numeric to string in several routines The macro calls the GetParentItem function when there are DeniedFolderItems for a user. It retrieves the entire folder location to that item. Also, the Indent procedure adds tabs (spaces) to the text file to ensure a readable format when the text file is read.

Setup
For best results, close Impromptu before you run this macro. See "Run a Macro in Impromptu Using a Command Line Option" (p. 460). The macro is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu. It looks for the sample catalog GOSales under the \Samples\Impromptu\Reports subdirectory.

Administration Guide 715

Chapter 57: Sample Macros When run, a message appears that states the context.txt file will be created and placed in the \Samples\Impromptu\Reports\Samples Support subdirectory. You can cancel the option. If you click OK, the macro closes any open catalog, opens the sample catalog, copies all information to the content.txt file, and closes the sample catalog. If a message appears stating that the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the subdirectory locations in the main routine to match your directory structure. You only need the subdirectory information because a function in the macro determines where you installed Impromptu. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: In the first If statement, change the name and location of the catalog. Repeat this procedure in the first Set statement that follows the If statement. You may also have to change the user class or add a user class password. In the OpenCatalog statement that follows the Set statements, change the name of the text file to be created. In the comments and MsgBox statements, change any reference to the GOSales Sample Catalog to match the new name of your catalog.

Copy Rows To Notepad Sample


Purpose
Copies a group of report rows to a text editor using the Windows Clipboard.

Discussion
This macro copies rows five to ten from the Copy Rows To Notepad report and pastes the rows into the Notepad editor. The macro relies on the Windows Clipboard to pass the copied information, because Notepad doesnt support OLE automation.

Main Features
This macro copies specified report rows to the Windows clipboard uses the Shell command to open Notepad uses the SendKeys command to access the Notepad menu bar and pastes the report rows into Notepad uses the CopySpecialToClipboard Method uses a Timer routine to ensure that the rows are pasted before the next command in the macro is executed

Setup
Run this macro, which is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu, from the Macro option on the Tools menu. The macro opens a catalog. If you have a catalog open when you run this macro, the macro closes it first. After the macro runs, it closes Impromptu. The macro retrieves the catalog, GOSales.cat and the report, Copy Rows To Notepad.imr from the \Samples\Impromptu\Reports directory. If a message appears stating that the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the name in the OpenCatalog and OpenReport methods to the correct subdirectory. You only need the subdirectory information because a function in the macro determines where you installed Impromptu. 716 IBM(R) Cognos(R) Impromptu(R)

Chapter 57: Sample Macros 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Change the name of the catalog in the OpenCatalog method. Change the name of the report in the OpenReport method. Change the CopySpecialToClipboard method to set the second parameter to the first row to copy and the third parameter to the last row. If you omit the second and third parameters, then the entire report will be copied. Ensure that the first parameter is zero to transfer report data.

Create Catalog Sample


Purpose
Copies a catalog and all its columns and tables to a new catalog.

Discussion
This macro creates a mirror image of the GOSales catalog. It shows how an entire folder structure, tables, columns, user profiles, joins, expressions, and other features can be created through OLE automation.

Main Features
This macro creates the sample.cat file If the file already exists, a message prompts you to overwrite it and create a new catalog. If you click OK, then the macro creates the catalog using the CreateCatalog Method. creates an empty catalog, creates all folders (one for each table), and appends or moves all items, expressions, joins, and catalog prompts using Expression automation features (column names in joins are case sensitive) creates the user class structure uses the Const declarations below the Dim statements to set parameter values used when creating catalog prompts with the AddItem and AppendEx methods You should not change the values for use_prompt and token_prompt. The other constants relate to the prompt type created.

Setup
For best results, close Impromptu before you run this macro. See "Run a Macro in Impromptu Using a Command Line Option" (p. 460). If you run this macro from Impromptu, it closes any open catalog first. The macro is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu. When you run the macro, it creates the sample.cat file in the \Samples\Impromptu\Reports\Samples Support subdirectory. If the file already exists, you are prompted to overwrite it. If a message appears stating that the macro cannot find the catalog, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the name in the CreateCatalog method to the correct subdirectory. You only need the subdirectory information because a function in the macro determines where you installed Impromptu. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Change the name of the catalog in the CreateCatalog method.

Administration Guide 717

Chapter 57: Sample Macros Because the catalog used in this sample will differ from any catalog you are likely to use, you will have to change the names of all folders, tables, columns and other data items. You can remove some existing items or add additional items. You will also have to change the values used in filters. Change the text of the MsgBox statements. If your catalog contains prompts, decide which type of prompt or prompts you need. Change the AddItem and AppendEx method sets. Change the message, file names and locations, column references, and default values.

Create Empty Catalog Sample


Purpose
Creates an empty copy of the GOSales catalog by copying only all its definitions.

Discussion
The term empty means that there are no tables or columns included automatically. This macro shows how an entire catalog, tables, folders, joins, prompts, and other features can be created through OLE automation.

Main Features
This macro creates the outdoors.cat file If the file already exists, a message prompts you to overwrite it and create a new catalog. If you click OK, the macro creates an empty catalog using the CreateEmptyCatalog Method. includes tables and columns manually creates all folders (one for each table), and adds items, expressions, joins and catalog prompts using Expression automation features Column names in joins are case sensitive. creates the user class structure uses the Const declarations below the Dim statements to set parameter values used when creating catalog prompts with the AddItem and AppendEx methods You should not change the values for use_prompt and token_prompt. The other constants relate to the prompt type created.

Setup
For best results, close Impromptu before you run this macro. See "Run a Macro in Impromptu Using a Command Line Option" (p. 460). If run from Impromptu, the macro closes any open catalog first. The macro is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu. When you run the macro, it creates the catalog Outdoors.cat in the \Samples\Impromptu\Reports\Samples Support subdirectory. If the file already exists, you are prompted to overwrite it. If a message appears stating that the macro cannot find a file, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the name in the CreateEmptyCatalog method to the correct subdirectory. Only the subdirectory information is needed because a function in the macro determines where you installed Impromptu. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Change the catalog name in the CreateEmptyCatalog method.

718 IBM(R) Cognos(R) Impromptu(R)

Chapter 57: Sample Macros Because the catalog used in this sample will differ from any catalog you are likely to use, you will have to change the names of all folders, tables, columns and other data items wherever they are referenced. You can remove some existing items or add additional items. You will also have to change the values used in filters and calculations. Change the text of the MsgBox statements. If your application contains catalog prompts, decide which type of prompt or prompts you need. Change the AddItem and AppendEx method sets. Change the message, file names and locations, column references, and default values. Because there are no tables or columns included, you need to reference your own database definitions to fill the empty catalog.

Excel Options Upgrade Sample


Purpose
Upgrades a set of existing Impromptu reports.

Discussion
Copies of all .imr and .imt files found in a source directory are upgraded to use new Impromptu Excel features. The macro upgrades the reports and writes them to a specified output directory. Both source and output directories must exist for the macro to complete successfully. Simple process logging is recorded in the "log.txt" file, written to the output directory.

Main Features
This macro: accepts option selection for upgrading images, static charts, text frames, and summary expressions. locates all existing Impromptu reports in the specified source directory. opens each report and sets the specified Microsoft Excel options. saves each upgraded report and copies them to the specified output directory.

Setup
For best results, close Impromptu before you run this macro. See "Run a Macro in Impromptu Using a Command Line Option" (p. 460). If run from Impromptu, the macro closes any open catalog. The macro is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu. If a message appears stating that the macro cannot find a file, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the names of the source or output directory as appropriate. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Change the names of the source and output directories to reflect your installation. Change the value of the Microsoft ExcelVersion variable. Use "0" to specify that the reports you are upgrading are in Microsoft Excel 2000 format, or "1" to specify that the reports are Microsoft Excel 2002 and above. Change the value of the ExcelExportOptions variable to reflect the features you wish to export.

Administration Guide 719

Chapter 57: Sample Macros You specify a single integer value for this variable that tells the macro which of the options you wish to apply. Integer 0 1 2 4 8 Description All export options are disabled. Only images are exported. Only charts are exported. Only text frames are exported. Only summary expressions are exported.

You can specify a combination value for the ExcelExportOptions variable. Integer 3 5 7 9 10 11 12 13 14 15 Description Images and charts are exported. Images and text frames are exported. Images, charts, and text frames are exported. Images and summary expressions are exported. Charts and summary expressions are exported. Images, charts, and summary expressions are exported. Text frames and summary expressions are exported. Images, text frames, and summary expressions are exported. Charts, text frames, and summary expressions are exported. Images, charts, text frames, and summary expressions are exported.

Change the text of the MsgBox statements.

Insert Qualification Levels Sample


Purpose
Adds database qualification levels to a newly created catalog.

Discussion
Use this macro only if you are moving a catalog from one database to another and the qualification levels differ between the databases.

Main Features
This macro uses the InsertQualificationLevel Method tests to see if a catalog is open and, if so, closes it inserts a catalog level with two catalogs, as well as a schema level The two database catalogs each have two schemas. If the catalog filename already exists, a message prompts you to overwrite it or cancel the macro. The names of the catalog and schema levels appear for you to view.

720 IBM(R) Cognos(R) Impromptu(R)

Chapter 57: Sample Macros

Setup
For best results, close Impromptu before you run this macro. See "Run a Macro in Impromptu Using a Command Line Option" (p. 460). If run from Impromptu, it closes any open catalog. The macro is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu. The macro creates the catalog gosample.cat in the \Samples\Impromptu\Reports\Samples Support subdirectory. If the file already exists, you are prompted to overwrite it. If a message appears stating that the macro cannot find a file, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the name of the catalog to the correct subdirectory. You only need the subdirectory information because a function in the macro determines where you installed Impromptu. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Change gosample.cat to your catalog name. In the CreateLevels subroutine, change the database. Change the names used with the Add methods.

Products (Publish as HTML) Sample


Purpose
Outputs the Products report in HTML format.

Discussion
This macro opens an Impromptu report that contains product information and publishes it in HTML format so that it can be viewed in a Web browser. After the macro runs, it closes Impromptu.

Main Features
This macro uses the OpenReport method to open a specific report the PublishHTML Object the Publish Method to create a report object in HTML format and to publish the report object to a file

Setup
Run this macro, which is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu, from the Macro option on the Tools menu. The macro is designed to look for the Products (Publish as HTML).imr file. It is in the \Samples\Impromptu\Reports subdirectory. If a message appears stating that the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the name in the OpenReport method to the correct subdirectory. You only need the subdirectory information because a function in the macro determines where you installed Impromptu. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions:

Administration Guide 721

Chapter 57: Sample Macros Change the name and location of the report. Change the name and location of the report in the Publish method.

Sales By Country (Publish as HTML) Sample


Purpose
Outputs the Sales by Country report in HTML format.

Discussion
This macro opens an Impromptu report that contains sales information and publishes it in HTML format so that it can be viewed in a Web browser. After the macro runs, it closes Impromptu.

Main Features
This macro uses the OpenReport method to open a specific report the PublishHTML Object the TOCByPageNumber Property and several other properties that set publishing options the Publish Method to create a report object in HTML format and to publish the report object to a file

Setup
Run this macro, which is in the \Samples\Impromptu\Macros subdirectory in the directory where you installed Impromptu, from the Macro option on the Tools menu. The macro is designed to look for the Sales by Country (Publish as HTML).imr file. It is in the \Samples\Impromptu\Reports subdirectory. If a message appears stating that the macro cannot find one of these files, then follow these steps: 1. Open the macro in either IBM CognosScript Editor or Notepad. 2. Change the name in the OpenReport method to the correct subdirectory. You only need the subdirectory information because a function in the macro determines where you installed Impromptu. 3. Save the macro and run the macro again.

Custom
You can customize this macro by following these instructions: Change the name and location of the report. Change the TOCByPageNumbers. Change the name and location of the report in the Publish method.

722 IBM(R) Cognos(R) Impromptu(R)

PART 5: Using Expressions with Impromptu

Administration Guide 723

724 IBM(R) Cognos(R) Impromptu(R)

Chapter 58: Expressions


An expression is any combination of operators, constants, functions, and other components that evaluates to a single value. You build expressions to create calculation and filter definitions. A calculation is an expression that you use to create a new value from existing values contained within a data item. A filter is an expression that you use to retrieve a specific subset of records. An expression can include functions, such as Absolute and Months-Between operators, such as + and Starts-With constants, such as numbers and Time other components, such as prompts The components that are available depend on the expression you are building. As you add or type each component in the expression, the syntax is evaluated against mathematical rules. The Tips window of the expression editor provides information about the selected component.

Examples
You want to calculate the profit for the sales year 1998. You create a calculation called Profit 1998 define the following expression:
Sales 98 - Product Cost

You want to retrieve only the sales records for tents sold in United States or Canada. You create a filter called North American Tent Sales and define the following expression:
Product Line = Tents and Country in (United States, Canada)

Building Expressions
Example
You want to build an expression that filters on Order Date. You want to specify that the order date must be greater than or equal to January 1, 1999 and less than todays date. Rather than typing todays date in the expression and having to update it, you want to use the Today function. The expression you want is:
Order Date >= 1999-01-01 and Order Date < today ()

Order Date is a column, >= and < are operators, 1999-01-01 is a date, and today () is a function. You locate each of these components in the appropriate folder in the left pane of the expression editor, and click the arrow button to add each selection to the expression. When you add a date to the expression, you overwrite the default date with the date you want. To quickly build an expression, you can type it in the expression editor without selecting components from the left pane, or you can type the parts of the expression that you know and add components. For example, you are typing an expression but you do not know the name of the required database column. You locate the column in the Databases folder, add it to the expression, then continue typing the expression. The expression editor validates the expression as you build it. If the expression is not mathematically valid, the expression editor highlights the errors in the expression, and error messages appear in the tip box.

Notes
Before typing a function into the expression editor, confirm that it is listed in the left pane. This will ensure that your application supports that function. You cannot use text binary data types in filters. Administration Guide 725

Chapter 58: Expressions For information on functions, see "Functions" (p. 729). For information on applying or working with filters and calculations, see the appropriate product documentation.

Steps
1. 2. 3. 4. From the left pane, locate and select the component you want. Click the arrow button to add the component to the expression. Continue adding components until your expression is complete. Click OK.

Tips
To quickly add components to the expression, double-click the component in the left pane. To move around in the Available Components and Expression boxes you can use the mouse, or: press the space bar to select a component press the up and down arrows to move within the Available Components box press the left and right arrows to move within the Expression box press the Enter key to commit a value within an expression and move the cursor to the right of the value Selecting String inserts two quotation marks and positions the cursor between them. You enter the string between the quotation marks. Selecting Number inserts the number 0. You overwrite it with the number you want included in the expression. Selecting date-time values inserts the current date and/or system time in quotation marks. You can overwrite it with other data values.

The components of an expression can include: Functions, Summaries, Values, Catalog Columns, and Operators.

Functions
The Functions folder in the Available Components box contains functions provided by Impromptu or by your database. These are pre-defined calculations, such as string, numeric, and date calculations, that are designed to operate on various data types.

Summaries
Summaries calculate additional data items by applying a mathematical procedure to selected data items in a report or catalog. Summary results depend on the set of data that is summarized. For example, if a column of data is grouped in your report, then a different result will be created for each of those groups from the single application of a summary.

Values
Values include string, number, date, time, date-time, and interval. They can be entered into the expression in three ways: From the Value folder as a string, numeric or data. Values are typed directly into the expression once the type of value is determined. Remember to press Enter to complete the entry. From the catalog data, by referencing database columns directly. From the report data, by referencing items already in the report. The Expression editor is context-sensitive, so it presents only options that are relevant at each stage of expression building. To apply a catalog filter to a report, select the Filter tab of the Query dialog box, then choose the catalog filter from the catalog data options, then add it to the Expression box.

726 IBM(R) Cognos(R) Impromptu(R)

Chapter 58: Expressions

Operators
Operators specify what happens to the values on either side of the operator. There are four types: logical operators define a relationship between two parts of an expression (for example: and, not, or) arithmetic operators perform arithmetic operations on two parts of an expression (for example: +, -, *, /) string operators concatenate two character strings (+) comparison operators filter data by comparing one or more values that you enter against the values in the database (for example: like, =)

How to Create Prompts


To start a new prompt, you click the New Prompt button to display the Prompt Definition dialog box. In the dialog box, you can name the prompt specify its type (Type In, or one of three varieties of Picklists) enter the prompt message to display specify the data type and default value When you click OK in the Prompt Definition dialog box, the prompt you have defined is displayed in the Folders dialog box. A question mark icon beside it indicates that the object is a prompt. Users can use catalog prompts in reports but cannot change or delete the prompts. When a user includes a catalog prompt in a report, the prompt becomes available in the Prompt Manager.

Administration Guide 727

Chapter 58: Expressions

728 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions


A function is a subroutine that returns a single value. You can use functions to create calculations and conditions to filter data. Functions are similar to operators in that they manipulate data items and return a result. Functions differ from operators in the format in which they appear with their arguments. This format allows them to operate in zero, one, two, or more arguments:
function (argument, argument, )

Functions are of these general types: Function Access Security Functions Date and Time Functions Numeric Functions Summary Functions Text Functions Description Exposes user security information within expressions. Accepts numeric input and returns a value that is a date or a time. Accepts numeric input and returns numeric values. Executes a predefined function and returns a summary value. Accepts character input and can return both character and number values.

Note
IBM Cognos Query does not support expressions that contain user-defined functions and, depending on the context, other components may not support particular functions documented in the Expression Editor help.

Access Security Functions


Access Security functions allow you to add security information to expressions that you create in the Expression Editor. Functions Catalog-User-Profile User-Classes User-Name Description Inserts the user class name as set up in the Impromptu catalog. Returns the names of the user classes to which the currently authenticated user belongs as a list of strings. Returns the name of the currently authenticated user as a string.

Catalog-User-Profile
Description
Inserts the user class name as set up in the Impromptu catalog.

Administration Guide 729

Chapter 59: Functions

Syntax
catalog-user-profile (profile exp)

Example
catalog-user-profile creator

This token is intended for use only in Impromptu. Other IBM Cognos products cannot access Impromptu catalog user profile values.

Note
If you save a report that contains this token as an iqd, the token value is converted to a string literal. In the following example, the catalog user-profile token is replaced with the string literal, Creator
select * from SECURITY_TABLE where SECURITY_TABLE.SECURITY_COLUMN = 'Creator'

User-Classes
Description
Returns the names of the user classes to which the currently authenticated user belongs, as a list of strings. You can use this function in either a Filter, Join, or Calculated Attribute expression. When using this function in a Filter or Join expression, you must place it on the right-hand side of an IN operator. Within an Attribute expression, this function is only permitted as a condition of an If/Then/Else construct.

Syntax
user-classes ()

Examples
Employee.Name IN (Tester, user-classes() ))

Returns the result: A list of employees (when used in a Filter that belong to both the Tester user-class and the currently authenticated user-class.
if (Employee.Name IN (user-classes())) then ("True") else ("False")

Returns the result: Either "True" or "False" (when used in at Attribute) for each employee, depending on whether they belong to the current user class

Note
You can place the user-classes function on either side of a comma in order to append an element or multi-valued prompt to the expression.

User-Name
Description
Returns the name of the currently authenticated user as set up in Access Manager. The name is returned as a string. You can use this function in either a Filter, Join, or Calculated Attribute expression.

Syntax
user-name

Example
user-name

Returns the result: The name of the currently authenticated user.

730 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Date and Time Functions


Date and time functions return a value that is a date or a time. Function Add-Days Add-Months Add-Years Age DateDayDiff Datetime-to-Date Date-to-Datetime Date-to-Days-from-1900 Date-to-String Day Day-of-Ymd-Interval Daysint-to-Ymdint Days-from-1900-to-Datetime Days-to-End-of-Month First-of-Month Hour Description Returns a datetime resulting from adding a number of days to a date. Returns a datetime resulting from adding a number of months to a date. Returns a datetime resulting from adding a number of years to a date. Returns age as a day-month-year interval by subtracting a specified date from today's date. Returns the number of days between two datetimes. Returns a date from a datetime. Returns a datetime from a date. The time portion of the resulting datetime value is set to 00:00. Returns the number of days since Jan 1, 1900 inclusive. The value returned is negative if the date is before 1900. Returns a string (in yyyy-mm-dd format) from a date. Returns a numeric value for the day of the month from 1 to 31, from a date, datetime, or interval. Returns the number of days as a signed integer from 0 to 30, from a year-month-day interval. Returns the year-month-day interval obtained from converting an interval relative to the base date. Converts a number of days from Jan 1, 1900 to a date. Returns the number of days to the last day of the month from a date or datetime. Returns the first day of the month from a date or datetime. Returns the hour from a time, datetime, or interval. The returned hour value is an integer from 0 to 23, where 0 represents midnight and 23 represents 11:00 pm. Returns the last day of the month from a date or datetime. Returns a datetime from three integers representing year, month, and day. The year must be four digits. Returns the minute as an integer from 0 to 59, from a time, datetime, or interval. Returns the month number as an integer from 1 to 12, from a date or datetime. Returns the number of months as a signed integer from 0 to 11, from a year-month-day interval.

Last-of-Month Make-Datetime Minute Month Month-of-Ymd-Interval

Administration Guide 731

Chapter 59: Functions Function Months-Between Description Returns the number of months between two dates. If the first date is later than the second date, then the result is a negative number. Returns the date from an integer. Returns a datetime as an integer in the yyyy-mm-dd format from a numeric datetime value. Returns the date obtained from converting a PowerHouse date. Returns the number of months between two dates. If the first date is later than the second date, then the result is a negative number. Returns the seconds as an integer from 0 to 59, from a time, datetime, or interval. Returns a datetime with the time portion set to zeros, such as 8/31/95 00:00. Returns the current date according to the date set on your computer. Returns the year from the date. Returns the number of years from the year-month-day interval. Returns the number of years from one date to another date. Returns the year-month-day interval from one date to another date. Returns the interval obtained from converting the year-month-day interval relative to a base date.

Number-to-Date Number-to-Datetime Phdate-to-Date Pre50-Months-Between

Second Time-to-Zero Today Year Year-of-Ymd-Interval Years-Between Ymdint-Between Ymdint-to-Daysint

Add-Days
Description
Returns a datetime resulting from adding a number of days to a date.

Syntax
add-days (date_exp | datetime_exp, integer_exp)

Examples
add-days (today(), 10)

Returns the result: 03/30/1998 00:00


add-days (today(), -10)

Returns the result: 03/10/1998 00:00

Note
Assume today's date is 03/20/1998.

732 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Add-Months
Description
Returns a datetime resulting from adding a number of months to a date.

Syntax
add-months (date_exp | datetime_exp, integer_exp)

Examples
add-months (today(), 10)

Returns the result: 01/20/1999 00:00


add-months (today(), -10)

Returns the result: 05/20/1997 00:00

Note
Assume today's date is 03/20/1998.

Add-Years
Description
Returns a datetime resulting from adding a number of years to a date.

Syntax
add-years (date_exp | datetime_exp, integer_exp)

Examples
add-years (today(), 10)

Returns the result: 03/20/2008 00:00


add-years (today(), -10)

Returns the result: 03/20/1988 00:00

Note
Assume today's date is 03/20/1998.

Age
Description
Returns age as a month-day-year interval by subtracting a specified date from today's date.

Syntax
age (date_exp | datetime_exp)

Example
age (1996-08-19)

Returns the result: 02/01/0002 00:00

Note
Assume today's date is 10/20/1998.

Administration Guide 733

Chapter 59: Functions

DateDayDiff
Description
Returns the number of days between two datetimes.

Syntax
datedaydiff (Starting_date, Ending_date)

Example
datedaydiff (1998-05-20 11:26:00.000, 1998-09-30 11:28:00.000)

Returns the result: 133

Datetime-to-Date
Description
Returns a date from a datetime expression.

Syntax
datetime-to-date (datetime_exp)

Example
datetime-to-date (1998-03-20 18:14:00.000)

Returns the result: 03/20/1998

Date-to-Datetime
Description
Returns a datetime from a date. The time portion of the resulting datetime value is set to 00:00.

Syntax
date-to-datetime (date_exp)

Example
date-to-datetime (1998-03-20)

Returns the result: 03/20/1998 00:00

Date-to-Days-from-1900
Description
Returns the number of days since Jan. 1, 1900 inclusive. The value returned is negative if the date is before 1900.

Syntax
date-to-days-from-1900 (date_exp | datetime_exp)

Example
date-to-days-from-1900 (1998-03-20)

Returns the result: 35873

734 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Date-to-String
Description
Returns a string (in yyyy-mm-dd format) from a date or datetime.

Syntax
date-to-string (date_exp | datetime_exp)

Example
date-to-string (1998-03-20 15:29:00.000)

Returns the result: 1998-03-20

Day
Description
Returns a numeric value for the day of the month from 1 to 31, from a date, datetime, or interval.

Syntax
day (date_exp | datetime_exp | interval_exp)

Examples
day (1998-03-20)

Returns the result: 20


day (1998-03-20 18:22:00.000)

Returns the result: 20


day (20 00:00:00.000)

Returns the result: 20

Day-of-Ymd-Interval
Description
Returns the day from a year-month-day interval function.

Syntax
day-of-ymd-interval (ymdinterval_exp)

Example
day-of-ymd-interval (1998-03-20 18:24:00.000)

Returns the result: 20

Note
An interval stores the number of years, months and days. An interval that is a year and a day is 1y 0m 1d. An interval that is a year and 364 days is 1y 11m 30d. An interval that is a year and 365 days is 2 y 0m 0d.

Daysint-to-Ymdint
Description
Returns the year-month-day interval obtained from converting an interval relative to the base date.

Syntax
daysint-to-ymdint (date_exp | datetime_exp, interval_exp)

Administration Guide 735

Chapter 59: Functions

Example
daysint-to-ymdint (1998-03-20, 500 00:00:00.000)

Returns the result: 04/13/0001 00:00

Note
An interval stores the number of years, months, and days. Use this interval value with only the following functions: year-of-ymd-interval, month-of-ymd-interval and day-of-ymd-interval.

Days-from-1900-to-Datetime
Description
Converts number of days since Jan. 1, 1900 to a date.

Syntax
days-from-1900-to-datetime (integer_exp)

Example
days-from-1900-to-datetime (40000)

Returns the result: 07/07/2009 00:00

Note
Days-from-1900-to-datetime (1) returns Jan. 1, 1900.

Days-to-End-of-Month
Description
Returns the number of days to the last day of the month from a date or datetime.

Syntax
days-to-end-of-month (date_exp | datetime_exp)

Example
days-to-end-of-month (1998-03-20)

Returns the result: 11

First-of-Month
Description
Returns the first day of the month from a date or datetime. The datetime value is converted from a date_exp to a date with the same year and month, but the day is set to one.

Syntax
first-of-month (date_exp | datetime_exp)

Example
first-of-month (1998-03-20)

Returns the result: 03/01/1998 00:00

Hour
Description
Returns the hour from a time, datetime, or interval. The returned hour value is an integer from 0 to 23, where 0 represents midnight and 23 represents 11:00 pm. 736 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Syntax
hour (time_exp | datetime_exp | integer_exp)

Examples
hour (09:10:00.000)

Returns the result: 9


hour (1998-03-21 09:11:00.000)

Returns the result: 9


hour (000 09:00:00.000)

Returns the result: 9

Last-of-Month
Description
Returns the last day of the month from a date or datetime.

Syntax
last-of-month (date_exp | datetime_exp)

Example
last-of-month (1998-03-21)

Returns the result: 03/31/1998 00:00

Make-Datetime
Description
Returns a datetime from three integers representing year, month, and day. The year must be four digits.

Syntax
make-datetime (integer_exp1, integer_exp2, integer_exp3)

Example
make-datetime (1998, 03, 21) Returns the result: 03/21/98 00:00

Minute
Description
Returns the minute as an integer from 0 to 59, from a time, datetime, or interval.

Syntax
minute (time_exp | datetime_exp | integer_exp)

Examples
minute (09:17:00.000)

Returns the result:17


minute (1998-03-21 09:18:00.000)

Returns the result: 18


minute (000 00:01:000.00)

Returns the result: 1

Administration Guide 737

Chapter 59: Functions

Month
Description
Returns the month number as an integer from 1 to 12, from a date or datetime.

Syntax
month (date_exp | datetime_exp)

Examples
month (1998-03-21)

Returns the result: 3


month (1998-03-21 09:21:00.000)

Returns the result: 3

Month-of-Ymd-Interval
Description
Returns the months from the results of a year-month-day interval function.

Syntax
month-of-ymd-interval (ymdinterval_exp)

Example
month-of-ymd-interval (1998-03-21 09:21:00.000)

Returns the result: 3

Note
An interval that is a year and 364 days is 1y 11m 30d. An interval that is a year and 365 days is 2 y 0m 0d.

Months-Between
Description
Returns the number of months between two dates. If the first date is later than the second date, then the result is a negative number. The Months-Between-function does not round months; the days and time portions of the difference are ignored.

Syntax
months-between (date_exp_1 | datetime_exp_1, date_exp2 | datetime_exp2)

Examples
months-between (1998-03-21, add-months (1998-03-21, 4))

Returns the result: 4


months-between (1998-01-31, 1998-02-01)

Returns the result: 0


months-between (1998-01-31, 1998-03-21)

Returns the result: 1

Note
This function is processed only on the database. For local processing, use the Pre50-Months-Between function.

738 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Number-to-Date
Description
Returns the date from an integer.

Syntax
number-to-date (integer_exp)

Example
number-to-date (19980930)

Returns the result: 09/30/1998

Number-to-Datetime
Description
Returns the datetime from an integer. The integer should be in YYYYMMDD format.

Syntax
number-to-datetime (integer_exp)

Example
number-to-datetime (19980301)

Returns the result: 03/01/1998 00:00

Phdate-to-Date
Description
Returns the date obtained from converting the PowerHouse date converting the phdate (a two-byte integer in YYMMDD format, where the high-order 7 bits are the year, the middle-order 4 bits the month, and the lower-order 5 bits the day) adding the century specified by the integer A century is an integer value such as 19 (representing 1900).

Syntax
phdate-to-date (integer_exp, phdate column)

Example
phdate-to-date (19, 50317)

Returns the result: 04/13/1998

Pre50-Months-Between
Description
Returns the number of months between two dates. If the first date is later than the second date, then the result is a negative number. The Pre50-Months-Between-function does not round months; the days and time portions of the difference are ignored.

Syntax
pre50-months-between (date_exp_1 | datetime_exp_1, date_exp2 | datetime_exp2)

Examples
pre50-months-between (1998-03-21, add-months (1998-03-21, 4))

Administration Guide 739

Chapter 59: Functions Returns the result: 4


pre50-months-between (1998-01-31, 1998-02-01)

Returns the result: 0


pre50-months-between (1998-01-31, 1998-03-21)

Returns the result: 1

Note
This function is for users who want the processing done locally. For processing on the database, use the Months-Between function.

Second
Description
Returns the seconds as an integer from 0 to 59, from a time, datetime, or interval.

Syntax
second (time_exp)

Example
second (11:35:59.000)

Returns the result: 59

Time-to-Zero
Description
Returns a datetime with the time portion set to zeros, such as 08/31/95 00:00:00.000 To compare only the date portion of two data items in datetime format, use the time-to-zero function to set the time portion of the data items to zeros.

Syntax
time-to-zero (datetime_exp)

Example
time-to-zero (95-08-31 07:49:26.145)

Returns the result: 8/31/95 00:00:00.000

Today
Description
Returns the current date according to the date set on your computer.

Syntax
today ()

Example
today ()

Returns todays date as the result.

Year-of-Ymd-Interval
Description
Returns the years from the results of a year-month-day interval function. 740 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Syntax
year-of-ymd-interval (ymdinterval_exp)

Example
year-of-ymd-interval (1998-03-21 14:42:00.000)

Returns the result: 1998

Note
An interval stores the number of years, months, and days. An interval that is a year and a day is 1y 0m 1d. An interval that is a year and 364 days is 1y 11m 30d. An interval that is a year and 365 days is 2 y 0m 0d.

Year
Description
Returns the year from the date.

Syntax
year (date_exp | datetime_exp)

Example
year (1994-12-10)

Returns the result 1994

Years-Between
Description
Returns the difference between the year values of date_exp1 and date_exp2. If date_exp1 is later than date_exp2 then the result will be a negative number.

Syntax
years-between (date_exp1 | datetime_exp1, date_exp2 | datetime_exp2)

Example
years-between (1996-03-21, 1998-03-21)

Returns the result: 2

Ymdint-Between
Description
Returns the year-month-day interval from one date to another date. If the first date is later than the second date, the result may be a negative interval or some other invalid interval.

Syntax
ymdint-between (date_exp1 | datetime_exp1, date_exp2 | datetime_exp2)

Example
ymdint-between (1996-03-21, 1998-05-05)

Returns the result: 01/14/0002 00:00

Note
An interval stores the number of years, months, and days. Use this interval value with only the following functions: Year-of-Ymd-Interval, Month-of-Ymd-Interval, and Day-of-Ymd-Interval. Administration Guide 741

Chapter 59: Functions

Ymdint-to-Daysint
Description
Returns the interval obtained from converting the ymd interval relative to the base date (date_exp).

Syntax
ymdint-to-daysint (date_exp | datetime_exp, ymdinterval_exp)

Example
ymdint-to-daysint (1996-03-21, 1998-04-09 17:06:38.000)

Returns the result: 729885 17:06:38.000

Numeric Functions
Accepts numeric input and returns numeric values. Function Absolute Ceiling Floor Integer-Divide Mod Number-to-Characters Number-to-String Number-to-String-Padded Power Round-Down Round-Near Round-Up Round-Zero Sqrt Description Converts numbers to their unsigned value. Returns a number rounded to the next highest integer. Returns a number rounded to the next lowest integer. Returns the integer obtained from truncating the result of an integer divided by a second integer. Returns the remainder (modulus) of an integer divided by a second integer. Returns a maximum four character representation of a number. Returns a string from a number. Returns a string from a number that is rounded to the nearest integer and padded with leading zeros if necessary. Returns a number raised to the power of a second number. Returns a number rounded down. Returns a number rounded to the nearest value. Returns a number rounded up. Returns a number rounded toward zero. Returns the square root of a positive number.

Absolute
Description
Converts numbers to their unsigned value. Use when you need positive numbers, or when you need to find the absolute difference between values in a list of positive and negative values. 742 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Syntax
absolute (numeric_exp)

Examples
absolute (-5.3)

Returns the result: 5.3


absolute (2)

Returns the result: 2

Ceiling
Description
Returns a number rounded to the next highest integer.

Syntax
ceiling (numeric_exp)

Examples
ceiling (-1.23)

Returns the result: -1


ceiling (1.23)

Returns the result: 2

Floor
Description
Returns a number rounded to the next lowest integer.

Syntax
floor (numeric_exp)

Examples
floor (-1.23)

Returns the result: -2


floor (3.45)

Returns the result: 3

Integer-Divide
Description
Returns the integer obtained from truncating the result of an integer divided by a second integer.

Syntax
integer-divide (integer_exp1, integer_exp2)

Examples
integer-divide (10, 20)

Returns the result: 0


integer-divide (20, 6)

Returns the result: 3

Administration Guide 743

Chapter 59: Functions

Mod
Description
Returns the remainder (modulus) of an integer divided by a second integer. The second integer should not be zero, or Impromptu issues a divide by zero error.

Syntax
mod (integer_exp1, integer_exp2)

Example
mod (245,3)

Returns the result: 2

Number-to-Characters
Description
Returns a maximum four character ASCII representation of a number.

Syntax
number-to-characters (numeric_exp)

Example
number-to-characters (1852272451)

Returns the result: Cogn

Note
This function is most commonly used within Impromptu in order to join character and integer keys into a composite key.

Number-to-String
Description
Returns a string from a number. If the number is negative, a minus sign (-) precedes the string. If the number is a real number, only the truncated integer part of the number is converted to a string.

Syntax
number-to-string (numeric_exp)

Examples
number-to-string (12345)

Returns the result: 12345


number-to-string (12345.678)

Returns the result: 12345

Number-to-String-Padded
Description
Returns a string from a number that is rounded to the nearest integer and padded with leading zeros if necessary. The integer.exp specifies the minimum size string that is returned.

Syntax
number-to-string-padded (numeric_exp, integer_exp)

744 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Examples
number-to-string-padded (12345, 8)

Returns the result: 00012345


number-to-string-padded (12345, 5)

Returns the result: 12345


number-to-string-padded (-12345, 7)

Returns the result: -012345

Notes
If the number is negative, the minus sign (-) counts as a placeholder in the integer. Integer_exp cannot be larger than 31.

Power
Description
Returns a number raised to the power of a second number. If the first number is negative, then the second number results in an integer value.

Syntax
power (numeric_exp1, numeric_exp2)

Examples
power (5, 2)

Returns the result: 25


power (4, 0.5)

Returns the result: 2


power (16, -0.5)

Returns the result: 0.25

Round-Down
Description
Returns a number rounded down. The integer value determines the position that is rounded. A positive integer acts on the digits to the right of the decimal point. A negative integer acts on the digits to the left of the decimal point. A zero rounds the number and removes the decimal places.

Syntax
round-down (numeric_exp, integer_exp

Examples
round-down (-113.6667, 0)

Returns the result: -114


round-down (-113.6667, 1)

Returns the result: -113.7


round-down (-113.6667, -1)

Returns the result: -120


round-down (-113.6667, -2)

Returns the result: -200


round-down (366.2162, 0)

Returns the result: 366 Administration Guide 745

Chapter 59: Functions


round-down (366.2162, 1)

Returns the result: 366.2


round-down (366.2162, -1)

Returns the result: 360


round-down (366.2162, -2)

Returns the result: 300

Round-Near
Description
Returns a number rounded to the nearest value. The integer value determines the position that is rounded. A positive integer acts on the digits to the right of the decimal point. A negative integer acts on the digits to the left of the decimal point. A zero rounds the number and removes the decimal places.

Syntax
round-near (numeric_exp, integer_exp)

Examples
round-near (-113.6667, 0)

Returns the result: -114


round-near (-113.6667, 1)

Returns the result: -113.7


round-near (-113.6667, -1)

Returns the result: -110


round-near (-113.6667, -2)

Returns the result: -100


round-near (366.2162, 0)

Returns the result: 366


round-near (366.2162, 1)

Returns the result: 366.2


round-near (366.2162, -1)

Returns the result: 370


round-near (366.2162, -2)

Returns the result: 400

Round-Up
Description
Returns a number rounded up. The integer value determines the position that is rounded. A positive integer acts on the digits to the right of the decimal point. A negative integer acts on the digits to the left of the decimal point. A zero rounds the number and removes the decimal places.

Syntax
round-up (numeric_exp, integer_exp)

Examples
round-up (-113.6667, 0)

Returns the result: -113

746 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions


round-up (-113.6667, 1)

Returns the result: -113.6


round-up (-113.6667, -1)

Returns the result: -110


round-up (-113.6667, -2)

Returns the result: -100


round-up (366.2162, 0)

Returns the result: 367


round-up (366.2162, 1)

Returns the result: 366.3


round-up (366.2162, -1)

Returns the result: 370


round-up (366.2162, -2)

Returns the result: 400

Round-Zero
Description
Returns a number rounded toward zero. The integer value determines the position that is rounded. A positive integer acts on the digits to the right of the decimal point. A negative integer acts on the digits to the left of the decimal point. A zero rounds the number and removes the decimal places.

Syntax
round-zero (numeric_exp, integer_exp)

Examples
round-zero (-113.6667, 0)

Returns the result: -113


round-zero (-113.6667, 1)

Returns the result: -113.6


round-zero (-113.6667, -1)

Returns the result: -110


round-zero (-113.6667, -2)

Returns the result: -100


round-zero (366.2162, 0)

Returns the result: 366


round-zero (366.2162, 1)

Returns the result: 366.2


round-zero (366.2162, -1)

Returns the result: 360


round-zero (366.2162, -2)

Returns the result: 300

Sqrt
Description
Returns the square root of a positive number.

Administration Guide 747

Chapter 59: Functions

Syntax
sqrt (numeric_exp)

Examples
sqrt (2)

Returns the result: 1.4142135623731


sqrt (64)

Returns the result: 8

Text Functions
Text functions accept character input and can return both character and numeric values. Function Char_Length Characters-to-Integer Decrypt Encrypt First-Word Left Lower Match-Pattern Octet_Length Pack Position Reverse Right Sound-of Spread String-to-Integer String-to-Number Substitute Description Returns the number of characters in a string. Returns an integer representation of no more than four sequential characters from a string. Returns a decrypted string by applying a decryption key. Returns an encrypted string by applying an encryption key. Returns the first word in a string. Returns a specific number of characters, starting at the left of the string. Converts uppercase characters to lowercase. Returns true if a string matches the pattern specified by a second string. Returns the number of bytes in a string. Returns a string with leading spaces removed, and all spaces between words reduced to a single space. Returns the starting position of a string in a second string. Reverses the characters in a string. Returns a specific number of characters, starting at the right of the string. Returns a four-character string code using phonetics to systematically abbreviate words and names in a string Returns a string with a space added between each of the original characters. Returns an integer from a string. Converts a string to a number. Replaces a caret (^) in your first string expression with a value from the column identified in your second string expression.

748 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions Function Substring Trim-Leading Trim-Trailing Upper Description Returns a substring from a string. Returns a string with leading spaces removed. Returns a string with trailing spaces removed. Converts lowercase characters to uppercase.

Char_Length
Description
Returns the number of characters in a string.

Syntax
char_length (string_exp)

Examples
char_length ('ABCDEFG')

Returns the result: 7


char_length ('')

Returns the result: 0


char_length (' ')

Returns the result: 1

Characters-to-Integer
Description
Returns an integer representation of no more than four sequential characters from a string, starting at position integer_exp1. The first character in the string is at position one.

Syntax
characters-to-integer (string_exp, integer_exp1, integer_exp2)

string_exp is the string from which you want to extract the characters integer_exp1 is the position of the first character in the substring integer_exp2 is the desired length of the substring to a maximum of four characters

Example
characters-to-integer ('Cognos', 1, 4)

Retrieves the result: 1852272451

Decrypt
Description
Returns a string decrypted from the encrypted string_exp1 using string_exp2 as the decryption key.

Syntax
decrypt (string_exp1, string_exp2)

Example
decrypt ('HP R1L', 'A cypher'

Administration Guide 749

Chapter 59: Functions Returns the result: This is plain text

Encrypt
Description
Returns a string encrypted from string_exp1 using string_exp2 as the encryption key.

Syntax
encrypt (string_exp1, string_exp2)

Example
encrypt ('This is plain text', 'A cypher')

Returns the result: HP R1L

First-Word
Description
Returns the first word in a string.

Syntax
first-word (string_exp)

Example
first-word ('Cat sat on the mat')

Returns the result: Cat

Left
Description
Returns a specific number of characters, starting at the left of the string.

Syntax
left (string_exp, integer_exp)

Example
left ('ABCDEFG', 2)

Returns the result: AB

Lower
Description
Converts uppercase characters to lowercase.

Syntax
lower (string_exp)

Example
lower ('ABCDEFG')

Returns the result: abcdefg

750 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Match-Pattern
Description
Returns true if a string matches the pattern specified by a second string. Returns false otherwise.

Syntax
match-pattern (string_exp1, string_exp2)

Exact-Match Characters
Match only themselves. There is a literal match between each exact-match character and its corresponding digit or character of the item value. For example, if the pattern is "a2b," then only the value "a2b" matches the pattern. All alphabetic and numeric characters used in pattern matching are exact-match characters: Characters A-Z a-z 0-9 a blank (or a space) Result Uppercase characters match uppercase characters. Lowercase characters match lowercase characters. A digit matches itself. Matches itself.

Pattern-Match Characters
Describes a class of characters or pattern features, rather than simply matching itself. Default Pattern Character asterisk ( * ) Result Matches zero or more occurrences of the immediately preceding characters (or pattern string in parentheses). For example, the pattern "a*" accepts an empty string or any number of "a"s. Matches zero or more characters (alphabetic, numeric, or special). For example, the pattern "th@" matches any value beginning with "th". The pattern "@th" matches any value ending with "th". Matches any single uppercase or lowercase alphabetic character. For example, the pattern "^^??" matches values such as "aa22", "ab23", and "AB23". Signifies to interpret the character immediately following the exclamation as a regular character rather than as a pattern character. For example, the pattern "^^^^!?" looks for a question mark as the fifth character. Matches zero or more occurrences of the immediately preceding character (or pattern string in parentheses). For example, the pattern "a<" accepts the null value, or an "a". Matches the character (or characters enclosed in parentheses) on either side of this pattern character. Use this pattern character to specify alternatives. Impromptu accepts a value that matches any one alternative. Indicates the precedence to interpret the characters in the pattern. Matches any single numeric digit. For example, the pattern "??##" matches values such as "aa22" and "ab23".

at-sign ( @ )

Caret ( ^ )

Exclamation ( ! )

left angle bracket ( < )

or-bar ( | )

Parentheses ( () ) Pound ( # )

Administration Guide 751

Chapter 59: Functions Default Pattern Character Question mark ( ? ) Result Matches any single character (alphabetic, numeric, or special). For example, the pattern "a?b" could match the values "aAb", "aab", "a2b", "a$b". Matches one or more occurrences of the immediately preceding character (or pattern string in parentheses). For example, the pattern "a>" accepts any number of "a"s. Disallows the immediately following character. For example, the pattern "###\0" accepts any three-digit number followed by any digit other than zero.

right angle bracket ( > )

slash ( \ )

Octet_Length
Description
Returns the number of bytes in a string. For single-byte characters, this function is equivalent to the char_length function.

Syntax
octet_length (string_exp)

Examples
octet_length ('ABCDEFG')

Returns the result: 7


octet_length ('')

Returns the result: 0

Pack
Description
Returns a string with leading spaces removed, and all spaces between words reduced to a single space. It also removes leading and trailing commas and semicolons, and leading spaces from words beginning with a comma, period, colon, or semicolon. The resulting string is padded with spaces on the right to maintain its original size.

Syntax
pack (string_exp)

Example
pack ('ABC DEF GHI JKL')

Returns the result: ABC DEF GHI JKL

Position
Description
Returns the starting position of string_exp1 in string_exp2. The first character in a string is at position one.

Syntax
position (string_exp1, string_exp2)

752 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Examples
position ('DEF', 'ABCDEF')

Returns the result: 4


position ('Z', 'ABCDEFGH'

Returns the result: 0

Reverse
Description
Reverses the characters in a string.

Syntax
reverse (string_exp)

Example
reverse ('ABCDEF')

Returns the result: FEDCBA

Right
Description
Returns a specific number of characters, starting at the right of the string.

Syntax
right (string_exp, integer_exp)

Example
right ('ABCDEFG', 3)

Returns the result: EFG

Sound-of
Description
Returns a four-character string code obtained by systematically abbreviating word and names in string_exp according to phonetics. This function can be used to determine if two strings sound the same.

Syntax
sound-of (string_exp)

Example
sound-of (Name) = sound-of (?TYPE-IN?)

Returns all values in the Name data item that are close phonetic matches to what the user types in at the prompt, regardless of spelling.

Spread
Description
Returns a string with a space added between each of the original characters.

Syntax
spread (string_exp)

Administration Guide 753

Chapter 59: Functions

Example
spread ('ABC')

Returns the result: A B C

String-to-Integer
Description
Returns the integer representation of string_exp.

Syntax
string-to-integer (string_exp)

Example
string-to-integer (' 101 tents')

Returns the result: 101

String-to-Number
Description
Converts a string to a number. The string may contain leading spaces, a sign, the digits 0-9, a decimal point, and trailing spaces. At least one digit must be specified in the string. Floating point values may also include an exponent of the form "Esd" where "s" is an optional sign and "d" is the exponent. If the string is not a valid number, Impromptu issues an error message.

Syntax
string-to-number (string_exp)

Example
string-to-number (' 0050.5 x $8.00')

Returns the result: 50.5

Substitute
Description
Replaces a caret (^) in your first string expression with a value from the column identified in your second string expression.

Syntax
substitute (string_exp1, string_exp2)

Example
substitute ('Dear Mr. ^:', Name)

Returns the result: If the value for Name is "Smith", the result is Dear Mr. Smith:

Substring
Description
Returns a substring from a string. The first character in the string is at position one.

754 IBM(R) Cognos(R) Impromptu(R)

Chapter 59: Functions

Syntax
substring (string_exp, integer_exp1, integer_exp2)

string_exp is the string from which you want to extract a substring integer_exp1 is the position of the first character in the substring integer_exp2 is the desired length of the substring

Example
substring ('abdefg', 3, 2)

Returns the result: de

Trim-Leading
Description
Returns a string with leading spaces removed. For example, if you merge two data items with leading spaces, use trim-leading to eliminate the spaces between them.

Syntax
trim-leading (string_exp)

Example
trim-leading ( ABC)

Returns the result: ABC

Trim-Trailing
Description
Returns a string with trailing spaces removed. For example, if you merge two data items in an expression and the data items have trailing spaces, the spaces between the data items can be eliminated using the trim-trailing function.

Syntax
trim-trailing (string_exp)

Example
trim-trailing (XYZ )

Returns the result: XYZ

Upper
Description
Converts lowercase characters to uppercase.

Syntax
upper (string_exp)

Examples
upper (Auriga)

Returns the result: AURIGA


upper (DeEr

Returns the result: DEER

Administration Guide 755

Chapter 59: Functions

756 IBM(R) Cognos(R) Impromptu(R)

Chapter 60: Summary Functions


Executes a predefined function and returns a summary value. Summary Average Count Maximum Minimum Moving-Average Moving-Total Percentage Percentile Quantile Description Returns the average value. Returns the number of selected data items excluding NULL values. Returns the maximum value of selected data items. Returns the minimum value of selected data items. Returns a moving average by row for a specified set of values of over a specified number of rows. Returns a moving total by row for a specified set of values over a specified number of rows. Returns the percent of the total value for selected data items. Returns the percentile value of selected data items. Returns the rank of a value in terms of a range that you specify. It returns integers to represent any range of ranks, such as 1 (highest) to 100 (lowest). Returns the rank of a value compared to the other values in the data item. Returns the rank value of selected data items. Returns the running average value of selected data items. Returns the running count of selected data items. Returns a running difference by row (including the current row) for a set of values. Returns the running maximum of selected data items. Returns the running minimum of selected data items. Returns the running total of selected data items. Returns the standard deviation of selected data items. Returns the rank of a value as High, Middle, or Low relative to a group of values. Returns the total value of selected data items. Returns the variance of selected data items.

Quartile Rank Running-Average Running-Count Running-Difference Running-Maximum Running-Minimum Running-Total Standard-Deviation Tertile Total Variance

Administration Guide 757

Chapter 60: Summary Functions

Average
Description
Returns the average value of selected data items.

Syntax
average (<numeric_exp)

Example
average (Sales)

Returns the result: The average of all Sales values.

Note
IBM Cognos Query supports the Average function with numeric data; the only parameters accepted are the numeric expressions and the auto component.

Count
Description
Returns the number of selected data items excluding NULL values.

Syntax
count (numeric_exp)

Example
count (Sales)

Returns the result: The total number of entries under Sales.

Note
IBM Cognos Query supports the Count function with numeric, character, and date data; the only parameters accepted are the expressions and the auto component.

Maximum
Description
Returns the maximum value of selected data items.

Syntax
maximum (numeric_exp)

Example
maximum (Sales)

Returns the maximum value of all Sales values.

Notes
IBM Cognos Query supports the Maximum function with numeric and character data; the only parameters accepted are the expressions and the auto component. Transformer does not support the Maximum function. The equivalent function in Transformer is max.

758 IBM(R) Cognos(R) Impromptu(R)

Chapter 60: Summary Functions

Minimum
Description
Returns the minimum value of selected data items.

Syntax
minimum (numeric_exp)

Example
minimum (Sales)

Returns the minimum value of all Sales values.

Notes
IBM Cognos Query supports the Minimum function with numeric and character data; the only parameters accepted are the expressions and the auto component. Transformer does not support the Minimum function. The equivalent function in Transformer is min.

Moving-Average
Description
Returns a moving average by row for a specified set of values of over a specified number of rows.

Syntax
moving-average (numeric_exp, integer_exp)

Example
moving-average (Qty,3)

Returns the quantity and a moving average of the current row and the preceding 2 rows. Qty 200 700 400 200 200 500 600 400 Moving-Average (Qty, 3) NULL NULL 433.3333 433.3333 266.6667 300.0000 433.3333 500.0000

Note
IBM Cognos Query and Transformer do not support this function.

Moving-Total
Description
Returns a moving total by row for a specified set of values over a specified number of rows.

Administration Guide 759

Chapter 60: Summary Functions

Syntax
moving-total (numeric_exp, integer_exp)

Example
moving-total (Qty,3)

Returns quantity and a moving total of the current row and the preceding 2 rows. Qty 200 700 400 200 200 500 600 400 Moving-Total (Qty, 3) NULL NULL 1300 1300 800 900 1300 1500

Note
IBM Cognos Query and Transformer do not support this function.

Percentage
Description
Returns the percent of the total value for the selected data items.

Syntax
percentage (numeric_exp)

Example
percentage (sales 98)

Returns the percentage of the total sales for 1998 that is attributed to each sales representative. Sales Rep Bill Gibbons Bjorn Flertjan Chris Cornel Conrad Bergsteige Sales 98 60646 62523 22396 13500 Percentage 7.11% 7.35% 2.63% 1.59%

Notes
Users can format the percentage data so that it reads as a ratio instead (for example: .25 vs. 25%). IBM Cognos Query does not support this function.

760 IBM(R) Cognos(R) Impromptu(R)

Chapter 60: Summary Functions

Percentile
Description
Returns a value, on a scale of one hundred, that indicates the percent of a distribution that is equal to or below the selected data items.

Syntax
percentile ([Distinct Component] numeric_exp [For Component (expr) [, (expr)] | Auto Component])

Example
percentile (Sales 98)

Returns the results: Sales Rep Bill Gibbons Bjorn Flertjan Chris Cornel Conrad Bergsteige Sales 98 60646 62523 22396 13500 Percentile 96.67% 100.00% 46.67% 26.67%

Note
IBM Cognos Query does not support this function.

Quantile
Description
Returns the rank of a value in terms of a range that you specify. It returns integers to represent any range of ranks, such as 1 (highest) to 100 (lowest).

Syntax
quantile (numeric_exp, integer_exp)

Example
quantile (Qty)

Returns the quantity, the rank of the quantity value, and the quantity values broken down into 4 quantile groups (quartiles). Qty 800 700 600 500 400 400 200 200 Rank (Qty) 1 2 3 4 5 5 7 7 Quantile (Qty, 4) 1 1 2 2 3 3 4 4 Administration Guide 761

Chapter 60: Summary Functions

Qty 200

Rank (Qty) 7

Quantile (Qty, 4) 4

Note
IBM Cognos Query does not support this function.

Quartile
Description
Returns the rank of a value, represented as integers from 1 (highest) to 4 (lowest), relative to a group of values.

Syntax
quartile ([Distinct Component] numeric_exp [For Component (expr) [, (expr)] | Auto Component])

Example
quartile (Qty)

Returns the quantity and the quartile of the quantity value. Qty 450 400 350 300 250 200 150 100 Quartile (Qty) 1 1 2 2 3 3 4 4

Note
IBM Cognos Query does not support this function.

Rank
Description
Returns the rank value of selected data items.

Syntax
rank (numeric_exp)

Example
rank (Sales 98)

762 IBM(R) Cognos(R) Impromptu(R)

Chapter 60: Summary Functions Returns the results: Sales Rep Bill Gibbons Bjorn Flertjan Chris Cornel Conrad Bergsteige Sales 98 60646 62523 22396 13500 Rank 2 1 17 23

Note
IBM Cognos Query does not support this function.

Running-Average
Description
Returns a running average of selected data items. You can use this summary to evaluate trends and significant values within groups of data items.

Syntax
running-average (numeric_exp)

Example
running-average (Qty)

Returns the comparison between average versus running average. Average (Qty) for Lastname 5 5 5 5 4 4 4 Running-average (Qty) for Lastname 7 5 5.33 5 3 4 4

Lastname Smith Smith Smith Smith Wong Wong Wong

Qty 7 3 6 4 3 5 4

Note
IBM Cognos Query and Transformer do not support this function.

Running-Count
Description
Returns a running-count of selected data items. You can use this summary to count data items within groups.

Syntax
running-count (numeric_exp)

Administration Guide 763

Chapter 60: Summary Functions

Example
running-count (Qty)

Returns the comparison between count versus running count. Count (Qty) for Lastname 4 4 4 4 3 3 3 Running-count (Qty) for Lastname 1 2 3 4 1 2 3

Lastname Smith Smith Smith Smith Wong Wong Wong

Qty 7 3 6 4 3 5 4

Note
IBM Cognos Query and Transformer do not support this function.

Running-Difference
Description
Returns a running difference by row, calculated as the difference between the value for the current row and the preceding row, (including the current row) for a set of values.

Syntax
running-difference (numeric_exp)

Example
running-difference (Qty)

Returns a running difference for Quantity. Running-difference (Qty) for Lastname NULL (no preceding row) -4 3 -2 -1 2 -1

Lastname Smith Smith Smith Smith Wong Wong Wong

Qty 7 3 6 4 3 5 4

Note
IBM Cognos Query and Transformer do not support this function.

764 IBM(R) Cognos(R) Impromptu(R)

Chapter 60: Summary Functions

Running-Maximum
Description
Returns the running-maximum of selected data items. You can use this summary to evaluate when a specific maximum value is reached in a group.

Syntax
running-maximum (numeric_exp)

Example
running-maximum (Qty)

Returns a comparison between maximum versus running maximum. Maximum (Qty) for Lastname 7 7 7 7 5 5 5 Running-maximum (Qty) for Lastname 2 3 6 7 3 5 5

Lastname Smith Smith Smith Smith Wong Wong Wong

Qty 2 3 6 7 3 5 4

Note
IBM Cognos Query and Transformer do not support this function.

Running-Minimum
Description
Returns a running minimum by row (including the current row) for a set of values. You can use this summary to evaluate when a specific minimum value is reached in a group.

Syntax
running-minimum (numeric_exp)

Example
running-minimum (Qty)

Returns a comparison between minimum versus running minimum. Minimum (Qty) for Lastname 2 2 2 2 3 Running-minimum (Qty) for Lastname 7 3 3 2 4 Administration Guide 765

Lastname Smith Smith Smith Smith Wong

Qty 7 3 6 2 4

Chapter 60: Summary Functions Minimum (Qty) for Lastname 3 3 Running-minimum (Qty) for Lastname 4 3

Lastname Wong Wong

Qty 5 3

Note
IBM Cognos Query and Transformer do not support this function.

Running-Total
Description
Returns a running total by row (including the current row) for a set of values. You can use this summary to evaluate when a specific total value is reached in a group.

Syntax
running-total (numeric_exp)

Example
running-total (Qty)

Returns a comparison between total versus running total.

Lastname Smith Smith Smith Smith Wong Wong Wong

Qty 2 3 6 7 3 5 4

Total (Qty) for Lastname 18 18 18 18 12 12 12

Running-total (Qty) for Lastname 2 5 11 18 3 8 12

Note
IBM Cognos Query and Transformer do not support this function.

Standard-Deviation
Description
Returns the standard deviation of selected data items. You can use standard deviation to measure the deviation or dispersal of values from the mean. A low standard deviation indicates that most values are distributed close to the mean, and a high standard deviation indicates that values are more spread out from the mean.

766 IBM(R) Cognos(R) Impromptu(R)

Chapter 60: Summary Functions

Example
If the average mark for an exam is 63, approximately sixty-eight percent of the scores fall within the one standard deviation and approximately ninety-five percent of scores fall within two standard deviations of the average value. So if the standard deviation is 5, approximately sixty-eight percent of the group scored between 58 (63-5) and 68 (63+5). Approximately ninety-five percent of the group scored between 53 [63-(2*5)] and 73 [63-(2*5)]. The following formula represents the standard deviation for a sample: [(- 2] ( ())

Syntax
standard-deviation (numeric_exp)

Example
standard-deviation (Product Cost) Returns the result: A value indicating the deviation between product costs and the average product cost.

Note
IBM Cognos Query does not support this function.

Tertile
Description
Returns the rank of a value as High, Middle, or Low relative to a group of values.

Syntax
tertile (numeric_exp)

Example
tertile (Qty)

Returns quantity, the quantile of the quantity value as broken down into tertiles, and the quantity values broken down into tertiles. Qty 800 700 600 500 400 400 200 200 200 Quantile (Qty, 3) 1 1 1 2 2 2 3 3 3 Tertile (Qty) H H H M M M L L L

Note
IBM Cognos Query does not support this function.

Administration Guide 767

Chapter 60: Summary Functions

Total
Description
Returns the total value of selected data items.

Syntax
total (numeric_exp)

Example
total (Sales)

Returns the total value of all Sales values.

Note
IBM Cognos Query supports the Total function with numeric data; the only parameters accepted are the numeric expressions and the auto component.

Variance
Description
Returns the variance of selected data items. Variance is the square of the Standard-Deviation. You can use variance to measure the accuracy of the standard-deviation.

Syntax
variance (numeric_exp

Example
variance (Product Cost)

Returns a value indicating how widely product costs vary from the average product cost.

Note
IBM Cognos Query does not support this function.

768 IBM(R) Cognos(R) Impromptu(R)

Chapter 61: Constants and Operators


A constant is a fixed value that you can use in an expression. You can create a data item based on an expression that contains a constant. Constant Date Date-Time False Interval Number String Time True YMD Interval Description Inserts the current system date and positions the cursor on the first number of the date. Inserts the current system date and time and positions the cursor on the first number of the date-time. Inserts a value as False. Represents a count of days, hours, minutes and seconds between two date or date-time values. Inserts the number zero, which you can replace with a new numeric value. Inserts two quotation marks and positions the cursor between them. Inserts the current system time and positions the cursor on the first number of the time. Inserts a value as True. Returns the year-month-date interval as a signed integer.

An operator specifies what happens to the values on either side of the operator. There are four types of operators: Operators Arithmetic Operators (+, -, *, /, Div, -(x) ) And Logical Operator String Operator (+) Comparison Operator Symbols Description Perform arithmetic operations. Define relationships between two parts of the expression. Concatenate two strings together. Compares two values and produces the logical value TRUE or FALSE.

Arithmetic, Logical, and String Operators


Logical, arithmetic, and string operators specify what happens to the values on either side of the operator. Operators Arithmetic Operators (+, -, *, /, Div, -(x) ) Description Perform arithmetic operations.

Administration Guide 769

Chapter 61: Constants and Operators

Operators And Logical Operator Or Logical Operator Not Logical Operator String Operator (+)

Description Returns true if the conditions on both sides are true. Returns true if either of the two conditions on both sides is true. Returns true if the condition is false, otherwise returns false. Concatenate two strings together.

Arithmetic Operators (+, -, *, /, Div, -(x) )


Description
Performs arithmetic operations. The precedence for processing arithmetic operators is as follows: multiplication (*) and division (/) addition (+) and subtraction (-) Evaluates arithmetic operators that are at the same level of precedence from left to right. You can use parentheses to override this order of precedence.

And Logical Operator


Description
Returns true if the conditions on both sides are true.

Example
Salary < 60000 and Dept = 'Sales'

Impromptu retrieves the data where salary is less than $60,000 in the Sales department. Precedence is given to logical operators.

Or Logical Operator
Description
Returns true if either of the two conditions on both sides is true.

Example
Name = 'Smith' or Name = 'Wong'

Impromptu retrieves the data for the names Smith and Wong.

Not Logical Operator


Description
Returns true if the condition is false, otherwise returns false.

Example
Salary not between 40000 and 50000

Impromptu retrieves all the salaries except those that fall between $40,000 and $50,000.

770 IBM(R) Cognos(R) Impromptu(R)

Chapter 61: Constants and Operators

String Operator (+)


Description
Concatenates two strings together.

Syntax
Char1 + Char2

Example
FirstName + LastName

Combines FirstName and LastName without spaces between.

Comparison Operators
Compares two values and produces the logical value TRUE or FALSE. Operators Between Description Determines if a value falls in a given range.

Comparison Operator Symbols Compares two values. Contains Exists In Is Missing Is Not Missing Like Starts With Determines if a value contains another value. Checks if the dataset contains data. Determines if a value exists in a given list of data items or a dataset. Determines if a value is undefined in the data. Determines if a value is defined in the data. Determines if a value matches the pattern of another value. Determines if a value starts with a given value.

Between
Description
Determines if a value falls in a given range. Comparisons must be defined with a low and high value.

Example
Salary between 40000 and 50000

If Salary is between $40,000 and $50,000, evaluates to True and retrieves only those rows.

Comparison Operator Symbols


Description
Compares two values.

Syntax
Value1 [=,<,>,<=,>=] Value2

Administration Guide 771

Chapter 61: Constants and Operators

Example
Qty < 100

If the quantity is less than 100, evaluates to True and retrieves only those rows.
Price > 1000 or Qty <= 3

If the price is greater than 1000 or the quantity is less than or equal to 3, evaluates to True and retrieves only those rows.

Contains
Description
Determines if a string contains another string.

Example
City contains 'New'

If there are any cities which contain the characters "New", evaluates to True and retrieves only those rows.

Exists
Description
Checks if the dataset contains data. Use to include a message in a report when the query results do not contain data.

Syntax
exists [DATASET]

Example
France EXISTS QueryItem[Sales.Georgraphy.Count.CountryName]

If the Query "Sales" does not contain a row with the value "France", evaluates to False and retrieves no rows.

In
Description
Determines if a value exists in a given list of values.

Example
Dept in ('Sales', 'Mkting', 'Dev')

Retrieves data for only the Sales, Marketing, and Development departments.

Note
List values must be separated by commas and enclosed in parentheses.

Is Missing
Description
Determines if a value is undefined in the data.

Syntax
abc is missing

772 IBM(R) Cognos(R) Impromptu(R)

Chapter 61: Constants and Operators

Example
Telephone Number is missing

If there are no telephone numbers, evaluated to TRUE. Retrieves only the rows missing telephone numbers.

Is Not Missing
Description
Determines if a non-null value is defined in the data.

Syntax
abc is not missing

Example
Telephone Number is not missing

If there are no telephone numbers, evaluates to FALSE and retrieves no rows. If True, retrieves only the rows with telephone numbers.

Like
Description
Determines if a string matches the pattern of another string. Evaluates to TRUE if no match is found.

Tip
Use the percent sign (%) as a wild card character that equates to any number of characters.

Example
Product Line like '%k%en%'

If there are any Product Line data containing "k" and "en" in that order with any number of characters before "k," after "k," and after "en," evaluates to True and retrieves only those rows. For example, "Cooking Equipment."

Starts With
Description
Determines if a string value starts with a given string.

Example
City starts with 'New'

If there are any cities the start with the characters 'New', evaluates to True and retrieves only those rows.

Administration Guide 773

Chapter 61: Constants and Operators

774 IBM(R) Cognos(R) Impromptu(R)

Chapter 62: Components


Executes a predefined function. Component All Description Compares a column's value to all elements in a dataset. Use this function to report only values greater than the highest value or less than the lowest value in a particular dataset. Any Compares a column's value to any element in a dataset. Use this function to report only values greater than any one value in a particular dataset. Auto Dataset Default Descending Distinct For If / Then / Else Lookup Null Prefilter Prompt Replace With (->) Report Sort-by Automatically modifies the expression depending on the values at the grouping or level it is used. A report containing values used to filter your present query. Inserts a default value when the conditions are not met. Changes the sort order to descending for only the summary Includes only distinct occurrences within a data item in a calculation. Determines the group to which the preceding data item is linked. Enables you to create a conditional expression that evaluates data before it shows in the report. Finds and replaces data with a value you specify. Inserts a null value if the expression conditions are not met. Performs a summary calculation before applying the summary filter. Inserts a prompt that appears when the report is run. Finds and replaces data with a value that you specify. Sets the scope of summary calculations to the contents of the whole report or query Specifies the data item on which the data is sorted.

All
Description
Compares a column's value to all elements in a dataset. Use this function to report only values greater than the highest value or less than the lowest value in a particular dataset.

Example
Sales95 > all [DATASET]

Administration Guide 775

Chapter 62: Components Returns values greater than all values in the specified column in the dataset. If the dataset contains the values 20, 30, and 40 for Sales95, values greater than 40 are retrieved.

Any
Description
Compares a column's value to any element in a dataset. Use this function to report only values greater than any one value in a particular dataset.

Example
Sales95 > any [DATASET]

Returns values greater than any value in the specified column in the dataset. If the dataset contains the values 20, 30, and 40 for Sales95, all values greater than 20 are retrieved.

Auto
Description
Automatically modifies the expression depending on the values at the grouping or level it is used. This component is used by IBM Cognos Query.

Example
total([order details.quantity] for [orders.order_no])

and
total([order details.quantity] auto)

return the same result when this expression is applied at the [orders.order_no] level.

Notes
The Auto component is used by default in Expression Editor versions 6.2 or later. Previous versions of Expression Editor used the Report component functionality by default. After you exit the Expression Editor, the Auto component will no longer be visible within the expression. Therefore you will be unable to discern whether the Auto component was explicitly specified, or whether it was a default value.

Dataset
Description
A report containing values used to filter your present query.

Example
A dataset can have the Country codes of "CAN," "USA," and "MEX" for North American countries.

Note
If you select a crosstab report as a dataset, you may receive unexpected results. Crosstab reports use a second query to filter information, but Impromptu only uses the first query to create the dataset.

Default
Description
Inserts a default value when the conditions are not met.

776 IBM(R) Cognos(R) Impromptu(R)

Chapter 62: Components

Example
lookup (State) in (NY -> 'New York', 'NJ' -> 'New Jersey') default (State)

Replaces all instances of NY and NJ in the State data item with New York and New Jersey respectively. All other states are unaltered. In this example, default (State) is the Default Component.

Descending
Description
Changes the sort order to descending for only the summary.

Example
running-total (Sale Amount) for Customer sort-by descending

Distinct
Description
Includes only distinct occurrences within a data item in a calculation.

Example
count (Product) for Customer Name 6 6 6 6 6 6 count (distinct Product) for Customer Name 5 5 5 5 5 5

Product GO Sport Bag Pocket U.V. Alert RiverKind Shampoo Star Gazer-3 Star Gazer-3 StarDome

Customer Name Vacation Central 4 Vacation Central 4 Vacation Central 4 Vacation Central 4 Vacation Central 4 Vacation Central 4

For
Description
Determines the group to which the preceding data item is linked.

Example
total (Qty for Branch)

Returns the total quantities for each branch.

If / Then / Else
Description
Enables you to create a conditional expression that evaluates data before it shows in the report.

Example
The following calculation converts Canadian prices to American, and leaves American prices alone:
if (Country = 'Canada') then (List Price * 0.60) else (List Price)

Administration Guide 777

Chapter 62: Components The following calculation converts students marks into letter grades:
if (Student Mark > 90) then ('A') else if (Student Mark > 75) then ('B') else if (Student Mark > 60) then ('C') else ('Fail')

The following calculation enables you to divide Salary by Bonus, even if some of the bonus values are missing or are zero:
if (Bonus is missing or Bonus = 0) then (0) else (Salary/Bonus)

Lookup
Description
Finds and replaces data with a value you specify.

Example
lookup (State) in (NY -> 'New York', 'NJ' -> 'New Jersey') default (State)

Replaces all instances of NY and NJ in the State data item with New York and New Jersey respectively. All other states are unaltered. In this example, lookup (State) is the Lookup Component.

Null
Description
Inserts a null value if the expression conditions are not met.

Example
if (Country = 'Canada') then (List Price * 0.60) else NULL

Converts Canadian prices to 60% of list price. If the country is other than Canada, inserts a null value.

Prefilter
Description
Performs a summary calculation before applying the summary filter.

Example
count (Salespersons) prefilter

Returns a count of the number of salespersons before applying a summary filter, such as sales greater than $100,000 to the report.

Prompt
Description
Inserts a prompt that appears when the report is run. A prompt can require you to either type a value or select from a list of values. The value that you type or select is used in the expression.

Replace With (->)


Description
Finds and replaces data with a value that you specify. Use this component with the Lookup.

778 IBM(R) Cognos(R) Impromptu(R)

Chapter 62: Components

Example
lookup (State) in (NY -> 'New York', 'NJ' -> 'New Jersey') default (State)

Replaces all instances of NY and NJ in the State data item with New York and New Jersey respectively. All other states are unaltered. In this example, (NY -> 'New York', 'NJ' -> 'New Jersey') is the -> Component.

Report
Description
Can be used to create calculated attributes for IBM Cognos Query. The Report component sets the scope of summary calculations to the contents of the whole report or query. Typically, this component is used in conjunction with the For component.

Example
total([OrderDetail.Quantity] For Compon report)

Returns the total quantity for all rows in the query or report.

Note
Previous to version 6.2 of the Expression Editor, this functionality occurred by default. Because the Auto component is now the default in Expression Editor versions 6.2 or later, you must explicitly add the Report component to the expression.

Sort-by
Description
Specifies the data item on which the data is sorted. This feature is included only for compatibility with previous versions of Impromptu and should be used only under the direct guidance of Cognos Support.

Example
running-total (Sale Amount) for Customer sort-by Sale Amount

Sorts the data on the size of the sales by ascending order (Sale Amount) rather than on the item in the FOR clause (Customer).

Administration Guide 779

Chapter 62: Components

780 IBM(R) Cognos(R) Impromptu(R)

Glossary
aggregate
A calculation involving a summary component and a FOR clause indicating for what group the aggregate is calculated. An aggregate is calculated independently of its position in a report and of its association with a group. You can perform the following aggregates: total, minimum, maximum, average, count, rank, percentile, percentage, running-total, running minimum, running maximum, running average, running count, and standard deviation. Also called a summary.

alias
An alternative label for a table. Create an alias to relate values in a single table by creating a self-join between the table and its alias. For example, you can determine the name of each employees manager if an employee table contains the employee name, employee number, and manager number. You can also use a filter expression on the alias to create a view of part of the data from the original table; for example, all those employees who report to a particular manager.

annotations
Descriptive information about the contents of your catalogs. You can develop an application that shows the annotations when your users want context-sensitive help about your catalog folders, columns, prompts, filters, and calculations.

Architect model
The information required to author a set of IBM Cognos applications, contained in a single file (.rep). The Architect model describes an enterprise reporting and querying environment that uses one or more metadata sources.

associated data item


A data item linked to the group data item. Associated data items suppress duplicate data values, but do not generate a control break. For example, if Customer Number is the grouped data item, you can repress Customer Name by declaring it as an associated data item. When Customer Number appears in the report, it appears only once for the group. Marking a data item as associated can affect how Impromptu calculates summary values.

auditing
The process of recording performance information and using it to find out how changes to your reporting environment affect performance times. To audit performance in Impromptu use the Audit Configuration and Audit File Processor applications.

automatic association
The group association of a newly created summary. The location of the group where you create the summary determines its automatic association. If you create a summary using the Calculate button in the Data tab (Query dialog box), the summary appears at the bottom of the Group Order box until you run the query. After you run the query, the summary appears under the lowest group in the Group Order box. If you move a summary with automatic association to a new location in the report, it appears under the group representing the new location. See also summary.

automation
See OLE automation.

Administration Guide 781

bitmap
An image that consists of pixels on the screen and, stored as a collection of bits. Windows bitmaps have the extension .bmp.

BLOB
A Binary Large Object, or large unstructured object stored in the database. A BLOB can be free text, images, digitized images, or audio streams.

boundary line
A line that indicates the extent of a frame as well as names of each report object. You show or hide boundary lines by using the Boundary Line command (View menu).

bulk fetch
Retrieval of more than one row of data from your database in a single fetch call. Bulk fetch can improve processing time for large queries.

cache query
A temporary cache on your personal computer that Impromptu uses to store report results. You set the cache query by clicking Query from the Report menu, and then clicking the Access tab.

calculated data item


A data item that shows the result of an expression that uses stored data. The value recalculates each time a value in the expression changes. For example, you can use the string operator (+) to combine a data item called Firstname with a data item called Lastname to form a calculated data item called Fullname.

cascading prompt
A prompt that uses information from a previous prompt to determine which options to display in a picklist.

catalog
A file (with the extension .cat) that contains all the information necessary for Impromptu to access and retrieve information from a relational database. A catalog does not store data, but it does provide Impromptu with a business view of the data. A catalog also contains information about what database to access, where the database is stored, and how the tables in the catalog are joined. See also personal catalog, shared catalog, and secured catalog.

catalog condition
An expression that can be used anywhere you need a true-false value. A catalog condition is stored in the catalog. You can use conditions in filters, in conditional formatting, and in calculations. For example, you can use a condition to see data for only your sales region.

catalog prompt
A prompt you store in the catalog that you can re-use in different reports.

category axis
The axis that contains category information, for example, product, customer, cost center, or country. For most charts, this axis is considered to be the horizontal, or x-axis, of the chart and appears below the chart. In some charts, the category axis can be relocated so that it appears above, to the left, or to the right of the chart (for example, a horizontal bar chart). In some charts, there may be more than one category axis, such as the x-axis and the y-axis, or the x-axis and the z-axis. This occurs, for example, when a measure, such as revenue, is charted for products per country (say on the x- and y-axis), over time (say on the z-axis).

782 IBM(R) Cognos(R) Impromptu(R)

cell
The intersection of a column and row that contains a single value.

chart frame
A type of frame that provides a visual image of numeric report data. Charts can be formatted in a number of ways, including bar charts, area charts, pie charts, bubble charts, and many other popular formats. See also child frame, parent frame, primary frame, and report object.

child frame
A frame or report object that is subordinate to a parent frame. See also primary frame and report object.

IBM CognosScript
A language similar to VISUAL BASIC, that is included with IBM Cognos applications. You can use IBM CognosScript to write macros.

Color Dialog Box


Displays a color palette. Use to apply color to report objects, such as fonts, charts, lines, borders and grids. The display settings on your computer determine the colors available.

column
One kind of information in a list frame, it is a vertical list of data that shares the same definition.

column spacer
Enables you to create an empty space between list frame columns.

comma delimited ASCII file


A text file where each column of data is separated from the next by a comma. All data must use ASCII standard characters.

command line
The characters used to start an application. For example, you enter command line parameters when you start Impromptu by clicking Run from the Start menu and typing a command.

complex join
A complex join uses an expression to join two tables. You must click the Expression option button to create a complex join.

compound join
A compound join is a join containing several columns joining two tables. A compound join can be an equi-join, non-equi-join, outer join, self-join, or complex join.

condition
An expression that can be used anywhere you need a true-false value. A condition can be stored in the catalog. You can use conditions in filters, in conditional formatting, and in calculations. For example, you can use a condition to see only data for your sales region. See also filter.

conditional format
An instruction to Impromptu to look through data in the selected report objects and format the data that meets predefined conditions. Use this format to identify exceptional data in your report. For example, retail outlets with quarterly revenues greater than $500,000 could be highlighted in green, while retail outlets with quarterly revenues less than $250,000 could be highlighted in red.

Administration Guide 783

control break
The start of a new group of data, which allows operations such as subtotaling.

Creator
The user class who creates a catalog and usually administers it. By default, the creator has no restrictions on using the catalog.

cross-product query
A report that retrieves data from tables that do not have table joins defined for them.

crosstab
Shows summary information from a list report in a compact table of rows and columns. A crosstab shows the value for the combination of each row and column, enabling you to gain a different perspective on the data and see more without the need to scroll. For example, you can change a list report that has three columns (Product Type, Sales Channel, Total Sale Amount) into a crosstab that has each Product Type as a row, each Sales Channel as a column, and the Total Sale Amount for each combination of Product Type and Sales Channel in the cells.

crosstab detail filter


Use to filter on the detail columns generated in a crosstab report. For example, if you add the Product Type data item to the rows, you can apply a crosstab detail filter to Environmental Line, GO Sport Line, or Outdoor Products. See also detail filter and crosstab summary filter.

crosstab summary filter


Use to filter on the summary columns generated in a crosstab report. For example, you can filter on the row totals in a crosstab to show only data items with a total product cost that is over 300. See also summary filter and crosstab detail filter.

custom condition
An expression that has a true-false value that you use when conditionally formatting report data. For example, you can define a condition that highlights sales margins less than 50%. You create a custom condition in a report.

data item
A column from a database, HotFile table, or a snapshot of a report.

data source
Where Impromptu retrieves information for your query. The data source can be a database, HotFile, snapshot, or thumbnail.

data type
One of six data types in Impromptu: character, date, date-time, numeric, time, and interval.

database
A collection of data related to a particular purpose and organized for ease of reference. Depending on the type of database you are using, a database can contain tables, views, synonyms, and stored procedures.

dataset
An Impromptu report that stores data values you can use when applying a filter. A dataset is dynamic, meaning that when you use a dataset in a filter, the report that stores that dataset is re-run.

784 IBM(R) Cognos(R) Impromptu(R)

date_exp
A date constant, a date data item, or any expression resulting in a date value.

datetime_exp
A date constant, a date data item, or any expression resulting in a datetime value.

detail filter
Limits the data retrieved in a report. A detail filter eliminates data from a report by restricting the data. For example, you could create a detail filter to specify that only sales over $1000 be included in the report. It is the only filter choice if you have not created a summary calculation for a report. See also summary filter.

Device Independent Bitmap (DIB)


A bitmap that contains a color table describing how the pixel values correspond to RGB color values.

directory server
Specialized databases that store user attributes, object classes and other schema-type information in a hierarchical format.

distributed catalog
A catalog intended for a workgroup or company where several users need to create and edit reports change the catalog contents For example, users can move and rename folders. work offline with Impromptu For example, users can take their copy of the catalog along on a business trip. When users open a distributed catalog, Impromptu makes a personal distributed catalog on the user's personal computer. However, Impromptu maintains a link with the master distributed catalog so that if any changes are made to the original, each user's copy is updated automatically.

drill through
An action that enables Impromptu, PowerPlay, and Scenario users to view transaction-level details in an Impromptu report. You can set up a drill through for any cell in Impromptu, any value in PowerPlay, or any node in Scenarios tree view.

dynamo
Formats the result of an SQL query against an ODBC data source. You use a dynamo to generate HTML controls that are placed on a page of a PowerPrompts application. For example, you can create a dynamo that retrieves countries from a data source. The same dynamo may contain different countries, depending on what is contained in the data source or as the data source is updated.

embed
Inserts information created in one application into another application. Once embedded the information, called an object, becomes part of the document in which it is embedded. When you double-click an embedded object, you open the application in which the object was created where you can edit the object. You can embed objects in an Impromptu report or you can embed Impromptu report into another application. See also link and OLE (Object Linking and Embedding).

equi-join
A type of join that retrieves all the rows from one table that have matching rows in another table. Administration Guide 785

See also non-equi-join, outer join, and self-join.

expression
Any combination of operators, constants, functions, data items, and other components that evaluates to a single value.

expression editor
A dialog box or tab where you can create or edit an expression, including the following: Calculation Definition dialog box (Data tab Query dialog box) Data Definition dialog box (Data tab Query dialog box) Edit Calculation dialog box (Folders dialog box) Edit Condition dialog box (Folders dialog box) Filter tab (Query dialog box) New Calculation dialog box (Folders command Catalog menu) New Condition dialog box (Folders command Catalog menu) User Filter Profile dialog box (Filter tab User Profiles dialog box)

extension
Three characters that follow a file name. The following extensions are used by Impromptu: .bmp Windows bitmaps .cat Impromptu Catalogs .cq IBM Cognos Query file .csv Comma delimited ASCII files .dat data file used to source PowerPlay reports .dbf dBASE files .dib Device Independent Bitmaps .htm Hypertext Markup Language files .icr Impromptu Catalog content reports .imr Impromptu Reports .ims Impromptu HotFiles .imt Impromptu Report Templates .iqd Impromptu Query Definition files .mac IBM Cognos Macros .mcx Compiled Cognos macros .pdf Adobe Portable Document Format .sql Structured Query Language (SQL) files .tmp Temporary files .txt Text files .wmf Windows metafile graphic .xls Microsoft Excel files .xml Extensible Markup Language files

filter
A set of criteria used to retrieve a specific subset of records for your report. You can use a filter in reports to filter out unnecessary data and highlight the most important information in your report. For example, you can use a filter that shows only the data for your sales region. If you are using Impromptu Administrator Version, you can create a filter for a user class that is automatically applied when the user class accesses the table or column specified in the filter. For example, you can create a filter on the Salary table so that only the Human Resources department can view that table. All other user classes will not see the Salary table. See also detail filter, summary filter, and condition. 786 IBM(R) Cognos(R) Impromptu(R)

fixed association
A group association entered into the definition of a summary data item. Unlike an automatic association, the fixed association remains the same when you move it to a new location. See also associated data item.

footer
A free-format area that appears at the bottom of a list frame or below a specific portion of a list frame. See also header.

form frame
A type of frame that serves as a free-format container for other frames and report objects, Forms are useful when creating reports that require custom placement of data, text, tables, and other report objects. A form frame shows one row, or record, at a time. See also child frame, parent frame, primary frame, and report object.

format symbol
Tells Impromptu how to show the data value. For example, the numeric format # symbol shows a single digit.

Format Toolbar

A bar with buttons and options you can use to format selected report objects. See also toolbar and Toolbar button.

frame
A report object that acts as a container for other report objects. Frames are the basic building block with which you create Impromptu reports. See also chart frame, child frame, form frame, list frame, parent frame, picture frame, primary frame, and text frame.

function
A function is a predefined calculation that takes one or more values, performs an operation, and returns a value. There are three kinds of functions in Impromptu: Impromptu functions, Database functions, and User-Defined Functions.

General format
A standard format based on the users locale setting that displays data as follows when the locale setting is en-us. Data Numbers Alphabetical/Alphanumeric data Format Display with no symbols. Displays the string as retrieved from the database. To display data with an initial capital letter, use the "Aa*" format. M/d/yyyy If cerlocale.xml uses a 12-hour clock, hh:mm am/pm If cerlocale.xml uses a 24-hour clock, hh:mm Date-Time M/d/yyyy hh:mm am/pm

Dates Times

Administration Guide 787

Data Intervals

Format d hh:mm:ss.sss

group data item


A control data item that is used to group data in a report. See also associated data item.

header
A free-format area that appears at the top of a list frame or above a specific portion of a list frame. See also footer.

HotFile
A separate local data table that can be added to your catalog or used in a report as if it were a regular database table. Once you create a HotFile, any report or catalog can use it. You can use a HotFile to link to any database. For example, you can use HotFiles to compare this months data with last months data.

HTML
Hypertext Markup Language. HTML is the language used to create documents for the World Wide Web.

integer_exp
An integer constant, an integer data item, or any expression (including a numeric_exp) resulting in an integer value.

intranet
A computer network found within an organization that provides services similar to those found on the Internet but on a smaller scale.

interval_exp
An interval constant, an interval data item, or any expression resulting in an interval value.

join
Defines the relational links between tables in the physical database. These joins enable you to relate the data in one table to the data in another table in the same database so that you can retrieve data from more than one table at a time. You join tables using columns in tables. For example, the Customer table and the Sales table can be joined using the Cust column. See also equi-join, non-equi-join, outer join, and self-join.

key
Keys are used to uniquely identify each record in a table. Keys are also used to make joins between tables. For example, Cust-id is the key of the Customer table because there can only be one customer ID for each customer.

Layout Toolbar
A bar with buttons and options you can use to work with report objects. See also toolbar and Toolbar button.

LDAP (Lightweight Directory Access Protocol)


A product-independent protocol that is used to locate organizations, individuals, files, and other resources on the Internet or a corporate Intranet.

788 IBM(R) Cognos(R) Impromptu(R)

link
The connection between a linked object and the application in which it was created. When the information changes in the source file, the changes are reflected in the destination file. You can choose to update linked information manually or automatically. See also embed and OLE (Object Linking and Embedding).

list frame
A type of frame that is designed to report tabular data in rows and columns. Each column in a list frame shows all the values for a data item in the database or a calculation based on data items in the database. See also child frame, parent frame, primary frame, and report object.

locked catalog
A locked catalog restricts access to the catalog Creator user class. When a member of the catalog Creator user class attempts to open a locked catalog, they must provide password authentication to unlock the catalog before opening it. A catalog lock is specified by the administrator and exists in addition to the common logon authentication required by IBM Cognos products and the catalog logon authentication. If a user, who is not a member of the catalog Creator user class, attempts to open a locked catalog, they are prompted for the usual catalog logon credentials only.

macro
A customized sequence of instructions ("macro commands") that IBM Cognos applications can carry out.

marked for insertion


A data item that appears in the report. This icon appears beside the data in the Data tab item (Query dialog box). Data items can be included in the query and not be marked for insertion in the report.

master distributed catalog


Intended for a workgroup or company where several users need to create and edit reports by using a common source of information. Only the Creator class can modify or change the master distributed catalog. When users first open a master distributed catalog, Impromptu makes a copy of the master distributed catalog on the users personal computer. This local copy is called a personal distributed catalog, and allows users to move and rename folders, and work off-line with Impromptu. Impromptu maintains links between master distributed catalogs and personal distributed catalogs, and automatically updates these personal distributed catalogs whenever changes are made to the master distributed catalog. See also catalog, personal catalog, shared catalog, secured catalog, and source catalog.

measure
In PowerPlay, the numbers by which you gauge the performance of your organization. For example, measures can be Revenue, Revenue/Employee, and Profit Margin %.

metacharacter
A character used in pattern matching, such as asterisk (*), at-sign (@), caret (^), exclamation (!), left angle bracket (<), or-bar (|), parentheses ( () ), pound (#), question mark (?), right angle bracket (>), or slash (\).

metadata
Information about the catalogs, schemas, tables, and columns in the database.

Administration Guide 789

metafile
An image that is generated by the calculation of position on the screen. It can produce more intricate images than a bitmap. Windows metafiles have the extension .wmf.

namespace
A source of authentication data used by Access Manager that exists as a directory on a directory server, or as an entry in a local authentication export (.lae) file, depending on the default security server configured in the system registry. The security data stored in each namespace, such as signon information for users, user classes, application servers and data sources, distinguishes each entry from all other namespaces in the repository.

nested crosstab
A crosstab report that contains more than one data item in the rows or columns. For example, you can nest Product Type and Product Line beside each other in the rows.

non-equi-join
A type of join that retrieves all the rows from one table that meet the criteria in another table. For example, for each product, you can list the active accounts that have not purchased a product using the not equal to (<>) operator. See also equi-join, outer join, and self-join.

numeric_exp
A numeric constant, a numeric data item, or any expression resulting in a numeric value.

object
Any piece of information that you create and edit, often with an application other than Impromptu, and then insert and store in an Impromptu report.

ODBC (Open Database Connectivity)


A Microsoft vendor neutral interface between database management systems (DBMS) from multiple vendors. It is based on existing standards from the SQL Access Group (SAG), X\Open, and ANSI.

ODBC driver
A dynamic-link library (DLL) that an ODBC-enabled application, such as Impromptu, can use to gain access to a particular data source. Each database management system (DBMS), such as dBASE, requires a different driver.

OLE (Object Linking and Embedding)


A Microsoft Windows facility that enables applications to share data. When you use OLE, two applications can share data through a connection that you establish. See also link and embed.

OLE automation
An industry standard that allows applications to expose OLE objects to development tools, macro languages, and other applications that support the standard. With OLE automation, you can work in one application from within another application.

ownership collection
A collection whose elements (objects) are dependent on the collection's parent. For example, the Column objects in the Columns collection are dependent on the parent Table object. If the Table object is deleted, the Column objects in the Columns collection are also deleted. See also reference collection.

790 IBM(R) Cognos(R) Impromptu(R)

operator
Specifies what happens to the values on either side of the operator. There are four types of operators: Logical: defines relationships between two parts of the expression. Arithmetic: performs arithmetic operations on two parts of an expression. String: concatenates two character strings. Comparison: compares one or more values that you enter against the values in the database.

outer join
A type of join that retrieves rows from one table even if the rows in another table do not match. You can use the following kinds of outer joins: A left outer join includes all rows from Table A, matched or not, plus the matching values from Table B. A right outer join includes all rows from Table B, matched or not, plus the matching values from Table A. A full outer join includes all rows from both tables, merged where matches were found. See also equi-join, non-equi-join, and self-join.

parent filter
A filter created for the parent user class of the selected user class. For example, a user class called Employees is based on the user class called Managers. In this case, the Managers user class is the parent user class. If you create a filter for Managers, it is automatically applied to Employees. The filter for Managers is a parent filter for Employees.

parent frame
A frame that contains one or more subordinate frames or report objects. See also child frame, primary frame, and report object.

percentile
The value on a scale of one hundred that indicates the percent of a distribution that is equal to or below it.

personal catalog
Intended for the small business owner who wants to maintain data such as personal information, customer lists, and product pricing. Use a personal catalog if you are the only person using the catalog and you are using the Administrator Version of Impromptu. See also catalog, distributed catalog, shared catalog, and secured catalog.

personal distributed catalog


Personal distributed catalogs exist on the user's personal computer, and are copies of the master distributed catalog. They are created the first time the user attempts to use a master distributed catalog. Users can work off-line with their personal distributed catalogs. They can also modify their personal distributed catalogs by moving and renaming folders. However, they cannot change the tables, columns, or joins that are defined for the distributed catalog. Impromptu maintains links between the master distributed catalogs and personal distributed catalogs, and automatically updates the personal distributed catalogs whenever changes are made to the master distributed catalog. See also catalog, personal catalog, shared catalog, secured catalog, and source catalog.

picture
Any Windows bitmap file (.bmp) or Device Independent Bitmap (DIB) file that is stored in a location your computer can access.

Administration Guide 791

picture frame
A frame that you can use to show a bitmap (.bmp) or Device Independent Bitmap (DIB). You can enhance the appearance of your reports by adding images such as a company logo. In addition, you can show pictures, such as your companys products or employees, that change based on the content for the items. See also child frame, parent frame, primary frame, and report object.

pivot
A quick way to change a list report into a crosstab report. Pivot by dragging and dropping one or more columns into the row titles area.

placeholder
A representation of what data should appear in place of the placeholder. Placeholders determine where and how the data and calculations will be positioned and shown in reports that use the template. Placeholders can be defined as optional or required. Placeholders can also be defined to accept one column or many columns. For example, you can add placeholders to a template that represent the customers address in a report. This helps other users understand how to complete the report.

PowerCube
A file that contains data that is structured to provide for fast retrieval and exploration in PowerPlay.

PowerPrompts
A series of HTML forms that Impromptu Web Reports consumers use to customize a report before they run it. The Impromptu report author creates a PowerPrompts application using the PowerPrompts Developer Studio, then delivers the application along with the report to the Impromptu Web Reports administrator.

prompt
A dialog box that asks the user to enter information when a report is opened. A report can contain several prompts which it uses to filter so you only get the data you want. Prompts can require the user to type in information, or select items from a picklist. A picklist can include data items from the catalog, data items from another report, or data from a file in delimited ASCII format. See also Prompt Manager.

Prompt Manager
The dialog box you use to create, edit, delete, and store prompts for the currently active report.

prompt references
Prompt references are expressions such as detail filters, summary filters, calculations, and conditional format expressions that reference a prompt.

primary frame
A frame that serves as the default object into which Impromptu inserts report objects such as placeholders and data. The first form frame or list frame that is created in a report or template is automatically designated as the primary frame. See also chart frame, child frame, form frame, list frame, parent frame, picture frame, report object, and text frame.

property
A named attribute of an object.

792 IBM(R) Cognos(R) Impromptu(R)

query
A question to the database, snapshot, or HotFile that defines what data you want to retrieve from the data source.

record
Composed of one data value from each column in the dataset. Also known as a row.

reference collection
A collection whose elements (objects) are not dependent on the collection's parent, they are only referenced from a collection that the objects are depended on. For example, the Table objects in the FilteredTables collection are not dependent on the parent UserClass object. If the UserClass object is deleted, the Table objects in the FilteredTables do not cease to exist because the collection that the Table objects depend on still exists. An object cannot only belong to a reference collection, although it can belong to more than one reference collection. It must also belong to an ownership collection. See also ownership collection.

relational database
A collection of information that is organized into tables.

report
A view of the current data in your company database that is organized and formatted the way you want it. The data you see in your report depends on the data you can access from your catalog. A report can be based on a template. See also template.

report author
An Impromptu user who creates complex reports and has an in-depth knowledge of the powerful features in Impromptu. The Mastering Impromptu Reports online help file is intended for report authors.

report creator
An Impromptu user who creates basic reports using the Report Wizard or a template, and applies essential skills, such as sorting, grouping, formatting, and basic filtering. Report creators can find the information they need in the Impromptu online Help.

report definition
A definition of the data in the report and how the data is shown and formatted. The report definition is static; it does not change when the report data changes. The database provides you with access to the most current data in the database. Therefore, when you save a report, you are not saving the actual data in your report, only the report itself. To save the report data, create a snapshot, create a HotFile, or use the Save As command to move the data to an external file in a specified format (for example, Microsoft Excel). You can also print the report using the Print command to save a copy of its current data.

Report Navigator
An optional control in a HyperText Markup Language (HTML) and PDF report that enables you to jump to a grouped column value. In an HTML report you can also jump to a specific page number.

report object
An object in a report. Report objects include text, pictures, frames, data items, report variables such as Date and Page Number, and so on. You can format report objects using the Format menu commands.

Administration Guide 793

report variable
A value that is supplied by your computer or by Impromptu. Report variables are inserted into reports using the More Objects command from the Insert menu.

report viewer
An Impromptu user who views reports, prints reports, or exports information found in existing reports. Report viewers can find the information they need in the Impromptu online Help and the Discovering PowerPlay book.

result set
A copy of the data retrieved by a report. A result set can be stored locally on a personal computer, or remotely on a server.

row
Composed of one data value from each column in the database. Also known as a record.

running-average
A summary that displays a new average for each additional value in a selected data item.

running-count
A summary that counts each value in a selected data item one by one.

running-maximum
A summary that displays a new maximum for each additional value in a selected data item.

running-minimum
A summary that displays a new minimum for each additional value in a selected data item.

running-total
A summary that displays a new total for each additional value in a selected data item.

scope of data
A property of form frames that determines what data they can show. A form frame can show a single row of data, all rows associated with the grouped data item, or all data the form frame can access.

secured catalog
Intended for users who do not need or want to create or edit their own reports. The users cannot change the catalog in any way. They can run, export, and print reports that the administrator has created. This type of catalog is useful for users who are not familiar with Impromptu and just want to analyze the data in the pre-defined reports. See also catalog, distributed catalog, personal catalog, and shared catalog.

self-join
A type of join that enables you to add two copies of the same table to a catalog so that you can relate values within a single table. See also equi-join, outer join, and non-equi-join.

shared catalog
Intended for a workgroup or company where several users need to create and edit their own reports. A shared catalog is ideal in a LAN environment where the catalog can be stored in a shared drive and directory that everyone can access. See also catalog, personal catalog, distributed catalog, and secured catalog.

794 IBM(R) Cognos(R) Impromptu(R)

signon
A User ID and password that is used to identify individual users and govern their access to resources.

snapshot
A permanent local copy of the report and the data retrieved by a report. The data on your personal computer can be shown and even manipulated at a later date without having to connect it to the original database.

source catalog
A distributed catalog on the LAN that is maintained by the administrator. When users open a distributed catalog, Impromptu makes a copy of the catalog on the users personal computer. Impromptu maintains a link with the original source catalog so that if any changes are made to the original, each users copy is updated automatically. Also called a master distributed catalog.

SQL (Structured Query Language)


The structured query language for accessing relational database information. You do not need to know SQL to use Impromptu; Impromptu automatically generates the SQL needed to retrieve the data for your report.

standard deviation
A measure of how much the data varies from the mean, expressed in the same units as the data (for example, inches, seconds, days). The square root of the variance is standard deviation.

Standard Toolbar
A bar with buttons and options you can use to create new reports, open existing reports, cut, paste, and copy report objects, and perform many other routine commands while you work with Impromptu reports. See also toolbar and Toolbar button.

status line
A bar that appears at the bottom of the report window. The status line is a source of context-sensitive help. The status line is continually updated to provide you with information as you are working. It tells you what is happening, where you are, and what your options are. If your pointer is over a Toolbar button or if you have highlighted a command, the status line tells you what the command does. The status line is divided into three sections: the catalog section shows which catalog is currently active. the report section shows report information such as progress indicators during saving, retrieving, and printing. It also shows coordinates during drag and drop operations. the general section provides information about memory, keyboard toggles, and product toggles (such as auto-retrieve).

stored procedure
A procedure defined and stored in a host database (such as Oracle or Sybase) that performs actions on the database.

string
A character string enclosed in quotation marks. For example: "Cognos."

string_exp
A string constant, a string data item, or any expression resulting in a string value.

Administration Guide 795

style
A defined group of formatting options that you can apply to selected report objects.

sub-report
A sub-report is a sub-query that is usually associated with a main query. You can include several sub-reports in one report. With sub-reports, you can deliver information in one report that would otherwise be available only with two or more reports.

summary
A summary component combined with a data item that has either fixed or automatic association. The association of a summary determines the group for which it is calculated. For example, if Total (Sales) is located in the Branch footer, then you will see the total sales for each branch. A summary can have either automatic association or fixed association with its location. A summary with automatic association changes depending on its location. For example, if you move Total (Sales) from the Branch footer to the Country footer, then you will see the total sales for each country. If a summary is explicitly associated, its value will reflect the group to which it is associated, regardless of where you put it in the report. For example, if the summary Total (Sales) is associated with the Country group and you place it in the City footer, then the summary will still reflect the total sales for each country.

summary filter
Limits the data retrieved in a report and can include summary components. A summary filter eliminates data from a report based on summary data items. For example, you could create a summary filter that eliminates all distributors with sales totaling less than $100,000. Data item summary values are calculated after the summary filter is applied. See also detail filter.

summary component
An operation that enables you to extract summary information from your data in the following ways: total, minimum, maximum, average, count, rank, percentile, percentage, running-total, running-minimum, running-maximum, running-average and running-count.

swap
Exchanges the positions of rows and columns in a crosstab report.

synonym
An alternative name for a table, view, alias, or another synonym. A synonym can be used in SQL statements wherever a table or view is used. Use a synonym to substitute the value of the synonym within the SQL.

syntax
Specific grammatical rules.

table
A portion of the database or HotFile that contains one kind of information organized into rows and columns. In Impromptu, a table is a label for the item that points to the database table. A catalog identifies the tables from the database that you want to access in Impromptu.

template
A template is a pattern you can use to build reports. By using templates, you can save time and effort when you create new reports. If you create the same type of report frequently, the template can be your guide.

796 IBM(R) Cognos(R) Impromptu(R)

A template can contain placeholders and store formatting information. You can specify information about margin settings, page orientation, font choices for different report objects, and so on.

text frame
A type of frame that contains text or data. Text frames are useful when creating blocks of static text (as in form letters) or dynamic text based on data. All text in Impromptu reports is contained in text frames. For example, whenever you see a data cell in a list frame, or a label in a summary calculation, you are seeing a text frame. See also child frame, parent frame, report object, and primary frame.

text object
An object that includes text.

thumbnail
A mode of operation you can set in Impromptu to create a temporary data file with a restricted number of rows.

time_exp
A time constant, a time data item, or any expression resulting in a time value.

toolbar
A bar with buttons that perform commands. See also Standard Toolbar, Format Toolbar, and Layout Toolbar.

Toolbar button
A button that you click to perform an action. Buttons that perform related actions are grouped on a toolbar.

type library
A collection of all exposed Impromptu objects, properties, and methods. The type library makes it easier for programmers to use Impromptu automation components in their code.

user class
A group of users (or a single user) who need access to the same data in the catalog and who have the same access privileges. For example, European salespeople all need data on their customers who are in Europe, while North American salespeople need data on their customers who are in North America.

user profile
All the information about a user class, such as the name of the user class, password, data access privileges, and whether the user class can create reports. See also user class.

variable
A value that is supplied by your computer or by Impromptu. Variables are inserted into reports using the More Objects command from the Insert menu.

Administration Guide 797

variance
The amount the individual data points differ from the average. This is calculated as the sum of the square of the deviations from the mean, divided by one less than the number of observations. For example, variance = e 1+ e 2+ e 3 2

view
A definition stored in a databases metadata that defines a virtual table that does not exist until referenced in an SQL statement, such as a select statement.

Windows Common Logon Server


A server that records information about the users of a Windows-based application so that they can log on once and access multiple data sources.

ymdinterval_exp
A year-month-day interval expression.

798 IBM(R) Cognos(R) Impromptu(R)

Index
Symbols
.csv files, exporting, 196 .csv files, saving reports as, 193 .dat files, saving reports as, 193 .dbf files, saving reports as, 193 .htm files, saving reports as, 193 .ims files, saving reports as, 193 .ini files, 452 .iqd files, saving reports as, 193 .mnu files, 449, 452 .pdf files, saving reports as, 193 .sql files, saving reports as, 193 .txt files, saving reports as, 193 .wk1 files, saving reports as, 193 .xls files, saving reports as, 193 .xml files, saving reports as, 193 Add Databases Method (Impromptu), 515 Add DeniedCatalogs Method (Impromptu), 517 Add DeniedColumns Method (Impromptu), 517 Add DeniedSchemas Method (Impromptu), 517 Add DeniedSelectedValues Method (Impromptu), 517 Add DeniedTables Method (Impromptu), 517 Add Method (Impromptu), 511 Add SchemaLevels Method (Impromptu), 511 Add Tables Method (Impromptu), 512 Add UserClasses Method (Impromptu), 511 AddDeniedFolders Method (Impromptu), 517 AddExternalHotfile Method (Impromptu), 518 AddFolder Method (Impromptu), 519 adding a grouped column to the report navigator, 603 adding all tables, 543 borders, 263 catalog prompts, 711 chart titles, 124 colors, 263 columns to a catalog, 31 columns to a table, 513 currency symbols, 260 data to reports, 211 databases, 515 dynamic picture frames, 380 existing objects, 511, 513, 515, 516, 517 existing tables, 512 expressions, 520 external data to report, 518 folders, 519 headers and footers, 248, 272 Hotfiles, 518 information to report navigator in HTML, 693 item, 522 items, 520 joins, 516 left table, 516 meta tags to report headers, 639 object, 511, 513, 515, 516, 517 patterns, 263 pictures, 236 qualifiers, 34 report navigation, 405 Report Navigator, 195 right table, 516 same table twice to a catalog, 32 summaries, 230 Table object to Tables collection, 512 table to a catalog, 523 tables to a catalog, 31 text, 235 totals to a list report, 232

A
Access Manager, 67 access permissions controlling, 63 access restrictions DeniedCatalogs Collection, 492 DeniedColumns Collection, 493 DeniedFolderItems Collection, 494 DeniedSchemas Collection, 495 DeniedSelectValues Collection, 496 DeniedTables Collection, 497 access security functions, 729 Access tab, viewing, 421 accessibility reporting solution overview, 174, 208 accessible reports creating, 174 design considerations, 175 accessing active documents, 612 Impromptu Application, 614 multiple databases, 555 stored procedures, 481 accessing databases, 419 Activate Method (Impromptu), 510 activating Application Object, 510 report navigator, 697 ReportDocument object, 510 active catalog, 464 ActiveCatalog Property (Impromptu), 611 ActiveDocument Property (Impromptu), 612 ActiveUserClass Property (Impromptu), 612 Add CatalogLevels Method (Impromptu), 511 Add Columns Method (Impromptu), 513

Administration Guide 799

Index
adding (cont'd) user class filters, 498, 643 user classes, 433, 617 values to expressions, 524 worksheet names for Excel, 412 AddItem Method (Impromptu), 520, 522 add-months function, 733 AddTable Method (Impromptu), 523 AddTables Method (Impromptu), 512 add-years function, 733 adjusting margins, 249 age function, 733 aggregates, 229 alias tables creating, 542 identifying master table, 666 identifying master table name, 665 aliases for tables, 32 naming, 32 aligning parts of a report, 249 report objects, 406, 411 text, 258 all component, 779 AllSelectedFrames Property (Impromptu), 613 analyzing data access requirements, 63 joins, 47 user privileges, 63 and logical operator, 770 annotation server creating using Visual Basic, 177 any component, 776 AppendEx, 524, 711, 717, 718 AppendEx Method (Impromptu) AddToken, 524 appending, 524 application, 510 Application automation, 462 Application Automation Methods Activate, 510 ChangeUserClass, 534 CloseCatalog, 536 ConnectDatabase, 539 CreateCatalog, 543 CreateEmptyCatalog, 544 FileSetPrinter, 558 GenerateReport, 559 GetAppVersionInfo, 560 GetErrorNumber, 562 GetNextQueryNumber, 569 Interactive, 578 OpenCatalog, 579 OpenDrillDownReport, 583 OpenReport, 584 OpenReportNoExecute, 586 Quit, 592 UpdateCatalog, 604 Visible, 605 Application Automation Properties, 614 CatalogName, 620 Application Automation Properties (cont'd) CatalogOpened, 620 ConnectedDatabase, 627 DatabaseDefinitions, 629 ErrorDocument, 639 FullName, 656 UseQueryWarnings, 701 Application Object activating, 510 Application Object (Impromptu), 462 application objects creating, 462 Application Property (Impromptu), 614 application version information getting, 560 apply conditional formatting, 355 applying styles, 265 templates, 533 ApplyTemplate Method (Impromptu), 533 Architect creating catalogs with, 167 importing catalogs into, 168 area charts description, 119 arithmetic operators, 769, 770 ASC files, 196 ASCII reports exporting, 551 assigning, 656 full name, 656 associating data, 215 data with grouped item, 219 association automatic, 338 changing, 341 fixed, 339 attaching databases, 539 auditing Impromptu performance, 85 auto component, 776 auto-grouping, 318 automatic association, changing, 342 catalog updating, 428 creation of HotFiles, 423 data retrieval, 420 grouping, 318 automatically connecting to databases, 118 creating joins, 45, 46 disconnecting from databases, 118 upgrade a report or a catalog, 203 automating tasks, 103 averages summaries, 758 axis scale settings changing, 126 axis titles formatting, 125

800 IBM(R) Cognos(R) Impromptu(R)

Index

B
bar charts description, 120 between comparison operator, 771 Binary Large Objects (BLOBs), 379 blank template, 205 blanks, removing, 323 BLOBS retrieving, 77 blobs searching, 324 bookmarks adding in reports, 195 borders, 263 bubble charts description, 120 bulk fetch rows limit, 302 burst reports creating for IWR, 285 buttons customizing, 450, 451

C
calculated columns, 388 calculated data items adding to catalogs, 344 complex, 344 creating, 344 description, 344 overview, 344 simple, 344 storing in catalogs, 431 using prompts, 334 calculated placeholders, creating, 367 calculation average of two dates, 349 average totals for groups, 347 creating characters items from numbers, 351 creating dates, 349 date intervals, 346 extracting years, months, days, 348 if/then, 351 if/then/else, 350, 443 lookup, 443 number of days remaining in period, 350 percentile, 346 rank, 346 summary, 321 summary before applying a filter, 321 using, 346 using the current date, 349 calculation methods, 520 calculations and inheritance, 104 overview, 51 using stored, 54 CanAddOrModifyFolders Property (Impromptu), 616 CanAddOrModifyUserClasses Property (Impromptu), 617 canceling data retrieval, 209 CanCreateNewReports Property (Impromptu), 617 CanDirectEnterSQL Property (Impromptu), 618

Cannot access the datasource error message, 311 Cannot find the file<path><report>.imr error message, 313 cascading prompts, creating, 332 case sensitivity, type-in prompts, 325 catalog, 623 attributes, 425 changing, 317, 428 closing, 536 creating, 543 creating and storing prompts in, 432 folders, copying, 430 folders, creating, 429 folders, moving, 430 lock, 30, 73 locked, 426 locking, 426 making active, 611 open and unlock, 427 opening, 427 permissions, 425 personal distributed, 426 personal distributed, changing, 428 prompts, 328 purpose, 419 shared, 425 storing calculated data items in, 431 storing filters in, 430 storing summaries, 431 storing summaries in, 431 types, 425 unlock, 73 updating, 427 updating automatically, 428 using, 419, 425 Catalog Automation Collections, 498 CatalogLevels, 488 Columns, 489 DatabaseConnections, 490 DatabaseDefinitions, 491 Databases, 490 DeniedCatalogs, 492 DeniedColumns, 493 DeniedFolderItems, 494 DeniedSchemas, 495 DeniedSelectValues, 496 DeniedTables, 497 FilteredColumns, 498 FilteredTables, 498 Folders, 499 SchemaLevels, 501 SelectedFrames, 502 TableLinks, 504 Tables, 503 UserClasses, 505 Catalog Automation Methods, 511, 512, 513, 517, 523, 579 Add Databases, 515 Add ExternalHotFIle, 518 Add TableLinks, 516 AddFolder, 519 AddItem (Column parameter), 522 AddItem (Use parameter), 520 Close, 536

Administration Guide 801

Index
Catalog Automation Methods (cont'd) CopyTo, 541 CreateAlias, 542 CreateFilterFor, 545 DistributedUpdate, 549 GetFilterFor, 569 Remove, 593 RemoveFilterFor, 594 Save, 598 Catalog Automation Objects Catalog, 464 CatalogLevel, 465 Column, 466 Database, 467 DatabaseConnection, 469 DatabaseDefinition, 469 FolderItem, 471 PublishHTML, 473 PublishPDF, 474 SchemaLevel, 479 Table, 482 TableLink, 483 UserClass, 484 Catalog Automation Properties, 683 ActiveCatalog, 611 ActiveUserClass, 612 Application, 614 CanAddOrModifyFolders, 616 CanAddOrModifyUserClasses, 617 CanCreateNewReports, 617 CanDirectEnterSQL, 618 CatalogLevels, 619 Columns, 621 Condition, 622 Count, 623 CreatorUserClass, 624 CrossProductPermission, 625 DatabaseConnections, 630 DBObject, 631 Definition, 632 DeniedCatalogs, 632 DeniedColumns, 633 DeniedFolderItems, 634 DeniedSchemas, 635 DeniedSelectValues, 635 DeniedTables, 636 Description, 637 EncryptedPassword, 638 Filename, 641 FilteredColumns, 642 FilteredTables, 643 Folders, 646 HasTextBlobLimit, 656 IsDistributed, 657 IsExternal, 658 IsKey, 659 IsLocked, 660 IsSynonym, 661 Item, 662 Items, 663 LeftTable, 663 MasterCatalogFilename, 664 Catalog Automation Properties (cont'd) MasterName, 665 MasterTable, 666 MaxQueryExecutionTime, 667 MaxRowsRetrieved, 668 MaxTablesPerReport, 669 MaxTextBlobCharacters, 670 MinimizeConnectTime, 673 NonIndexSortingPermission, 677 OuterJoinPermission, 678 Parent, 678 PlainTextPassword, 680 QueryExecutionTimeWarnAfter, 684 QueryProcessing, 686 ReadIsolationLevel, 687 RightTable, 688 RowsRetrievedWarnAfter, 689 SchemaLevels, 690 SelectDistinctPermission, 691 TableLinks, 694 Tables, 695 TablesPerReportWarnAfter, 696 Type, 698 UniqueID, 700 UserClasses, 702 Username, 703 Value, 703 Weight, 705 catalog connection, 469 catalog has no user class error message, 312 catalog levels, 488 Catalog Object, 490 Catalog object Folder collection, 499 Catalog Object (Impromptu), 464 catalog prompts creating, 57 modifying, 59 using in a report, 59 catalog security controlling number of rows retrieved, 78 controlling the ability to create cross-product reports, 80 controlling the ability to create outer joins, 79 controlling the ability to display duplicate data, 79 creating user classes, 65 editing user classes, 66 restricting the time user classes are connected to the database, 81 sorting on non-indexed columns, 79 catalog security,controlling, 77 catalog types expression editing permissions, 52 CatalogLevel Object (Impromptu), 465 CatalogLevels Collection (Impromptu), 488 CatalogLevels Property (Impromptu), 619 CatalogName Property (Impromptu), 620 CatalogOpened Property (Impromptu), 620 Catalogs empty, 544 new, 543 catalogs, 25, 73 adding columns, 31

802 IBM(R) Cognos(R) Impromptu(R)

Index
catalogs (cont'd) adding tables, 31, 523 changing conditions, 55 changing types, 28 closing, 536 conditions, 224 content overview reports, 34 creating, 27 creating a new folder, 37 creating from HotFiles only, 91 creating joins automatically, 45, 46 default reports, 35 descriptions, 637 determining if locked, 660 displaying names, 620 displaying the contents of a folder, 37 editing personal distributed, 298 filename, 641 identifying open, 620 identifying top level items, 646 opening, 202, 579 opening a distributed catalog, 30 permissions, 632 removing columns, 33 removing tables, 33 saving, 598 saving changes, 536 selecting a HotFile, 91 selecting different databases, 118 setting unique id, 700 sorting folders, 39 sorting tables, 32 storing Summaries, 53 synchronize to reports, 40 updating, 604 updating a distributed catalog, 549 upgrade, 203 verifying and updating tables, 33 working with folders, 37 catalog-user-profile token, 729 category axis, 782 ceiling function, 743 century setting, 302 Cer.ini locations, 294 cerlocale.xml, 174, 262, 359 cern, 456 ChangeUserClass Method (Impromptu), 534 changing a crosstab to a list report, 390 amount of large text items retrieved, 77 borders, 263 chart labels, 129 chart scale settings, 126 chart type, 123 colors, 263 column titles, 270 column width, 270 conditions stored in the catalog, 55 databases, 118 default printer, 558 fonts, 264 changing (cont'd) grids settings in charts, 128 height, 273 HotFiles, 90 joins, 49 margins, 249 number of instances of Impromptu, 210 number of rows retrieved, 78 order of currency symbols, 260 page breaks, 274 page layout, 183 patterns, 263 printer for reports, 558 queries, 99 report orientation, 187 row height, 271 summary association, 341 text formatting, 264 user classes, 534 views, 183 width, 270, 273 worksheet order for Excel, 412 char_length function, 749 character formats, 255 character items, creating from a number, 351 characters-to-integer function, 749 chart area formatting, 126 chart controls Grids and Scales dialog box, 142 Properties dialog box, 148 Titles dialog box, 155 Trendlines dialog box, 155 chart frames adding data, 378 changing data, 378 description, 369 formatting, 123, 379 chart labels changing, 129 chart legend adding, 129 chart legends formatting, 129 chart properties formatting, 123 chart titles adding, 124 formatting, 125 chart type changing, 123 chart types choosing, 119 pie, 121 charts adding trendlines, 131 changing scale settings, 126 choosing type, 119 correlation, 132 creating, 121 creating correlation, 132 formatting, 132

Administration Guide 803

Index
charts (cont'd) formatting chart, plot, legend area, 126 formatting data items individually, 128 showing data labels, 129 child frame, description, 370 Clear Method (Impromptu), 535 clearing expressions, 535 ClearTOCColumns Method (Impromptu), 536 client/server balancing overview, 436 tune for efficiency, 437 clipboard copying, 542 Close Method (Impromptu), 536 CloseCatalog Method (Impromptu), 536 CloseReport Method (Impromptu), 537 closing, 536 catalog, 536 catalogs, 536 reports, 537 Cognos .ini file entries, 469 Cognos.ini, 294 collections, 488, 548, 623 Columns, 489 counting objects in, 623 DatabaseConnections, 490 DatabaseDefinitions, 491 Databases, 490 deleting an object, 548 DeniedCatalogs, 492 DeniedColumns, 493 DeniedFolderItems, 494 DeniedSchemas, 495 DeniedSelectValues, 496 DeniedTables, 497 determining members, 662 FilteredColumns, 498 Folders, 499 identifying parent, 678 QueryItems, 501 SelectedFrames, 502 table joins, 694 TableLinks, 504 tables, 503, 695 Color dialog box, 783 colors adding, 263 Column Object (Impromptu), 466 column titles exporting to Excel, 413 linking to query, 369 column type, 513 Columns, 466, 633 filters, 642 identifying data types, 698 permissions, 633 setting as key, 659 columns changing conditions, 55 changing titles, 270 creating joins, 45, 46 hiding, 242 columns (cont'd) hiding and showing, 241 moving, 269 printing repeat, 190 removing, 33 removing links, 49 selecting, 268 specifying exact widths, 270 used in expressions, 52 using conditions, 55 Columns Collection (Impromptu), 489 Columns Property (Impromptu), 621 comma separated value files, 196 command line startup switches macro-filename, 291 overview, 291 report-name, 291 commas as decimal points, 109 Commit Method (Impromptu), 538 comparison functions, 771 comparison operators , 771 <, 771 <=, 771 <>, 771 >, 771 >=, 771 between, 771 contains, 772 in, 772 is missing, 772 is not missing, 773 like, 773 starts with, 773 complex joins creating manually, 44 components all, 779 and, 770 any, 776 auto, 776 dataset, 776 default, 776 descending, 777 distinct, 777 else, 777 exists, 772 for, 777 if, 777 lookup, 778 not, 770 null, 778 or, 770 prefilter, 778 prompt, 778 replace with(->), 778 report, 779 sort-by, 779 then, 777 compound joins, 41 creating manually, 44 condition methods, 520

804 IBM(R) Cognos(R) Impromptu(R)

Index
Condition Property (Impromptu), 622 conditional formatting stored in conditions, 55 conditionally format data, 355 conditions, 224 applying, 355 applying styles to, 355 changing, 55 changing the order, 356 creating, 354, 355 including pre-defined conditions, 355 overview, 51 predefined, 351 storing in the catalog in conditional formatting, 55 use to format data, 354 using stored conditions as a filter, 55 using to hide/show report objects, 356 configuring data formats, 174, 262, 359 Oracle bulk fetch, 114 ConnectDatabase Method (Impromptu), 539 connected databases identifying, 547, 627 connecting databases, 539 to databases, 118 to Personal Oracle, 114 connection string, 469 ConnectionString Property (Impromptu), 623 contains comparison operator, 772 Contains operator with filters, 324 content overview reports generating, 34 controlling creating cross-product reports, 80 number of rows retrieved, 78 retrieval of large text items, 77 sorting on non-indexed columns, 79 user privileges, 63 copy special linking, 540 copying catalog folders, 430 clipboard, 542 copying picture frames, 542 copying report objects, 542 data to other applications, 403 database definitions, 117 folder, 541 folder items, 541 folders, 38 report images to the clipboard, 540 reports to the clipboard, 540 special, 540 summaries, 342 text, 542 copyright, 2 CopySpecialToClipboard, 716 CopySpecialToClipboard Method (Impromptu), 540 CopyTo Method (Impromptu), 541 CopyToClipboard Method (Impromptu), 542 correlation chart, 132 formatting, 132 Count Property (Impromptu), 623 count summary, 758 counting, 623 CreateAlias Method (Impromptu), 542 CreateCatalog Method (Impromptu), 543 CreateEmptyCatalog Method (Impromptu), 544 CreateFilterFor Method (Impromptu), 545 CreateObject function, 476 CreateSnapShot Method (Impromptu), 546 CreateStoredProcedure Method (Impromptu), 547 creating, 544 a character item from a number, 350 a copy of a table, 542 a date from a number, 349 a distributed catalog, 427 a local copy of report data, 278 alias tables, 542 annotation server, 177 application objects, 462 burst reports, 285 calculated columns, 388 cascading prompts, 332 catalog, 543 catalogs, 27 charts, 121 conditions, 355 crosstab reports, 204 database definitions, 109 database definitions for DB2, 109 database definitions for HotFiles, 111 database definitions for Informix, 111 database definitions for MS SQL Server, 112 database definitions for ODBC, 112 database definitions for Oracle, 114 database definitions for Sybase Adaptaive Server Enterprise, 114 empty catalog, 544 filter, 545 filters, 319 format symbols, 253 HotFiles, 90 HTML report output, 405 HTML reports, 473 joins, 41, 42, 43, 44, 45, 46 list reports, 203 Microsoft Excel reports, 472 new crosstab reports, 384 new folders, 37 new reports from a catalog table, 559 outer joins, 79 PDFs, 474 prompts, 329 queries, 99 reports with sub-reports, 392 reports with templates, 205 snapshots, 278, 421, 546 stored procedure reports, 96 stored procedures, 547 styles, 352 summaries, 230, 342

Administration Guide 805

Index
creating (cont'd) summaries from detailed data, 343 thumbnails, 421 user classes, 65 creator user class locking catalogs, 73 restricting access to catalogs, 73 CreatorUserClass Property (Impromptu), 624 cropping picture frames, 381 CrossProductPermission Property (Impromptu), 625 crosstab reports, 274 adding summaries, 386 changing into a list report, 390 creating calculated columns, 388 creating new, 384 editing SQL, 383 filter data, 389 nested, 384 pivoting list reports, 384 setting default column format, 276 summaries for cells, 386 summaries for columns and footers, 387 swapping data, 390 using calculated columns, 388 using more than one summary, 387 crosstabs creating, 204 creating as sub-reports, 208 filtering, 225 repeating row area, 190 CSV files, 196 CSVExportOptions Property (Impromptu), 626 CTLib and Sybase, 114 cubes creating in PowerPlay, 172 currency formatting data, 259 currency data formatting, 262 currency symbol list using, 259 currency symbols using with numeric data, 259 customizing buttons, 450 data formats, 253 launch buttons, 450, 451 launch menu commands, 450 menus, 449 toolbar buttons, 450, 451 toolbars, 450 cut and paste folders, 579 data (cont'd) finding, 226 formatting, 253 formatting currency, 262 formatting numeric, 262 grouping, 215, 217 hiding, 242 in headers and footers, 248 inserting into frames, 371, 375 interrupting retrieval, 578 labels, 129 removing, 211, 212 retrieving, 209 retrieving all, 597 sorting, 109, 215, 218 sources and performance, 444 data attributes (Impromptu.ini), 302 data display enhance, 259 data formats, 174, 262, 359 and locale settings, 174 configuring, 174, 262, 359 data items calculated, 344 changing, 343 combining, 350 copying to other applications, 403 formatting in charts, 128 formatting using prompts, 335 grouping, 318 data labels formatting, 125 data requirements analyzing, 63 data retrieval automatic, 420 limiting, 421 using thumbnails, 421 data scoping enhancing Excel output with, 414 data types expression results, 687 returning, 698 data value, 561 database, 467, 547, 627, 629, 630 Database Automation Methods, 467, 547, 629, 630 InsertQulaificationLevel, 577 RemoveQualificationLevel, 595 database connection, 469 identifying user name, 703 database connections, 490, 547, 627, 629, 630 database object, 631 identifying by user class, 630 read-transaction levels, 687 database definition, 491 database definitions copying, 117 creating, 109 DB2, 109 HotFiles, 111 identifying, 629 Informix, 111

D
data adding, 211 adding to chart frames, 378 associating, 215 associating with grouped item, 219 creating a local copy, 277

806 IBM(R) Cognos(R) Impromptu(R)

Index
database definitions (cont'd) MS SQL Server via OLE DB, 112 ODBC, 112 Oracle, 114 removing, 117 Sybase Adaptive Server Enterprise, 114 database location setting, 109 database name copying, 117 creating, 109 database object, 547, 627, 629, 630 Database Object (Impromptu), 467 database settings, 490 database signons differences between IWR and Impromptu, 169 database type, 698 setting, 109 database, accessing via the catalog, 419 DatabaseConnected Method (Impromptu), 547 DatabaseConnected Property (Impromptu), 627 DatabaseConnection Object (Impromptu), 469 DatabaseConnections Collection (Impromptu), 490 DatabaseConnections Property (Impromptu), 630 DatabaseDefinition Object (Impromptu), 469 DatabaseDefinitions Collection (Impromptu), 491 DatabaseDefinitions Property (Impromptu), 629 DatabaseItem Property (Impromptu), 629 databases, 81 attaching, 539 connecting, 539 connecting to, 118 disconnecting, 548 disconnecting from, 118, 277 HotFiles, 89 overview, 109, 117 selecting different for catalogs, 118 supported versions, 109 Databases Collection (Impromptu), 490 Databases Property (Impromptu), 630 dataset component, 776 date and time functions, 731 date formats, 255 exporting, 194 datedaydiff function, 734 dates inserting, 239 sorting, 218 dates, creating from a number, 349 date-time formats, 257 datetime-to-date function, 734 date-to-datetime function, 734 date-to-days-from-1900 function, 734 date-to-string function, 735 day function, 735 day-of-ymd-interval function, 735 days-from-1900-to-datetime function, 736 daysint-to-ymdint function, 735 days-to-end-of-month function, 736 DB2 accessing natively, 109 accessing via ODBC, 112 DB2 (cont'd) create database definitions, 109 troubleshooting database connection, 314 Universal Database, 109 varchar function, 109 dBASE files, 193, 194 Dbase reports exporting, 553 DBObject Property (Impromptu), 631 decrypt function, 749 default column format, 276 default component, 776 default reports generating, 35 defaults directories, 297 defining databases, 109 defining databases, 491 defining stored procedures, 600 Definition Property (Impromptu), 632 Delete Method (Impromptu), 548 deleting, 33, 548 an object from a collection, 548 delimited ASCII files, 193, 194 delimited ASCII text files, 196 DeniedCatalogs Property (Impromptu), 632 DeniedColumns Collection (Impromptu), 633 DeniedColumns Property (Impromptu), 633 DeniedFolderItems Collection (Impromptu), 634 DeniedFolderItems Property (Impromptu), 634 DeniedSchemas Collection (Impromptu), 635 DeniedSchemas Property (Impromptu), 635 DeniedSelectValues Property (Impromptu), 635 DeniedTables Collection (Impromptu), 497, 636 DeniedTables Property (Impromptu), 636 descending component, 777 Description Property (Impromptu), 637 descriptions catalogs, 637 designing accessible reports, 175 detailed data items, changing, 343 determining, 683 qualification levels, 683 directory defaults, 297 disabling automatic catalog updating, 428 automatic data retrieval, 420 read-only report warning, 298 DisconnectDatabase Method (Impromptu), 548 disconnecting databases, 548 from databases, 118 from the database, 277 displaying catalog names, 620 displaying values in prompts, 329 distinct component, 777 distributed catalog and standard reports, 103 updating, 549

Administration Guide 807

Index
distributed catalogs about, 25, 27 changing types, 28 Description property, 637 determining, 657 opening, 30 updating, 604 distributed folder items determining, 657 distributed sorting, 109 DistributedUpdate Method (Impromptu), 549 distributing custom menus, 452 custom toolbars, 452 HTML report output, 410 reports using styles, 352 DMS-E-DBACCESS error message, 311 documents, 612 printing, 587 drill down, 583 drill through, 182, 281, 282 from PowerPlay, 171 to IBM Cognos Query, 169 drill-through reports setting up, 394, 395 testing, 397 using, 394 duplicate data displaying, 79 duplicate tables, 542 error 24584, 562 error 24585, 562 error 24587, 562 error 24588, 562 error 24589, 562 error 24590, 562 error 24591, 562 error 24592, 562 error 24593, 562 Error 53 dms-e-yv_systemerr error message, 313 error documents identifying, 639 error messages cannot access the datasource, 311 catalog has no user class, 312 DMS-E-DBACCESS, 311 Error 53 dms-e-yv_systemerr, 313 the catalogs available user classes do not correspond, 312 unable to connect to the database, 314 unexpected windows error (1157), 313 ErrorDocument Property (Impromptu), 639 errors critical, 569 runtime, 569 warnings, 569 evaluating prompt requirements, 329 example creating correlation chart, 132 formatting correlation chart, 132 examples standard reports and templates, 104 updating and maintaining your environment, 105 Excel exporting reports, 194 Excel files, 193, 194 Excel format adding worksheet names, 412 aligning objects for, 411 avoiding multiple worksheets, 411 changing worksheet order, 412 controlling page breaks, 411, 413 data scoping, 414 eliminating overlapping objects, 412 exporting reports to, 410 grouping objects for, 413 rendering headers and footers, 413 rendering image in report header or footer, 413 reports with list frames, 411 retain leading zeroes in text, 414 row and column titles, 413 using data scoping, 414 using summaries, 414 Excel report output specifying version, 196 Execute Method (Impromptu), 549 executing, 549 stored procedures, 481, 547 existing object, 512 adding, 511, 513, 515, 516, 517 exists component, 772 exiting Impromptu, 592

E
editing embedded objects, 402 main queries, 392 personal distributed catalogs, 298 predefined conditions, 431 user classes, 66 else component, 777 email, 196 embedding compared to linking, 398 report objects, 401 report objects in other applications, 403 empty catalog creating, 544 encrypt function, 750 encrypted passwords, 638 EncryptedPassword Property (Impromptu), 638 enhanced file searching, 290 equi-joins, 41 creating, 42 er, 562 error, 639 error 24577, 562 error 24578, 562 error 24579, 562 error 24580, 562 error 24581, 562 error 24582, 562 error 24583, 562

808 IBM(R) Cognos(R) Impromptu(R)

Index
expense reports, 103 exponenetial trendline, 131 Export Method (Impromptu), 550 ExportASCII Method (Impromptu), 551 ExportData Method (Impromptu), 552 ExportDBase Method (Impromptu), 553 ExportExcelWithFormat Method (Impromptu), 554 ExportHotFile Method (Impromptu), 555 exporting as ASCII reports, 551 as DBase reports, 553 as HotFiles, 555 as Microsoft Excel reports, 554 as SQL files, 555 as Text files, 556 as Transformer files, 557 PowerPlay data files, 552 reports, 193, 194, 550 reports to Excel, 410 ExportMetaTags Property (Impromptu), 639 ExportOptions Property (Impromptu), 640 ExportSQL Method (Impromptu), 555 ExportText Method (Impromptu), 556 ExportTransformer Method (Impromptu), 557 Expression Automation Prompt Syntax, 529 Token Table, 526 Expression Automation Methods Clear, 535 ClearTOCCColumns, 536 Commit, 538 Expression Automation Objects Expression Object, 470 Expression Automation Properties Formula, 647 FormulaEx, 647 ResultType, 687 expression editor, 227 Expression Object (Impromptu), 470 Expressions getting values, 703 result data type, 687 expressions adding, 520 adding values, 517, 520, 522 building, 51, 725 catalog column components, 52 clearing, 535 editing permissions by catalog type, 52 Expression object, 470 formulaEx, 647 FormulaExB, 652 function components, 51 operator components, 52 returning, 622 saving, 538 summary components, 51 value components, 52 expressions, using in filters, 319 external data, 518 extracting years, months, days from a date, 348

F
fetch operations and Sybase, 114 file format csv, 196 file picklist prompts, changing the prompt separator, 327 file searching, 290 Filename Property (Impromptu), 641 files different formats, 193, 194 exporting, 193, 194 exporting delimited ASCII, 196 ini, 293 most recently used, 307 MRU, 307 opening, 181 recent file list in .ini file, 307 files, in HTML report output, 408 FileSetPrinter Method (Impromptu), 558 filter, 569 changing, performance issues, 442 creating, 319, 545 creating detail filters, 319 data in a crosstab, 389 drill-through, 395 If/Then/Else, 443 performance issues, 442 removing, 325, 594 rolling time period, 322 storing in catalogs, 430 tips, 325 types, 389 using, 319, 321 using database summaries, 442 filter expressions applying after summaries, 320 containing prompts, 331 overview, 319 prefilter component, 320 tips, 325 FilteredColumns Collection (Impromptu), 498 FilteredColumns Property (Impromptu), 642 FilteredTables Collection (Impromptu), 498 FilteredTables Property (Impromptu), 643 filtering columns, 545 columns collection, 498 get filter for, 569 tables, 545 using a catalog condition, 224 using crosstab titles, 225 using the Filter Drop-Down button, 223 using the toolbar button, 222 filters accessing from stored conditions, 55 columns, 642 stored, 224 suspending, 224 tables, 643 using Like, Contains, Starts With operators, 324 using stored conditions as, 55

Administration Guide 809

Index
finding data, 226 first-of-month function, 736 first-word function, 750 fit to page, 189 fixed association, 339 floor function, 743 folder items copying, 541 expressions, 703 moving, 579 permissions, 634 setting unique id, 700 FolderItem Object expression, 471 folder, 471 FolderItem Object (Impromptu), 471 FolderItem Property (Impromptu), 644 FolderPath Property (Impromptu), 645 folders accessing and inheritance, 104 adding, 519 copying, 38 copying items, 38 creating, 37 displaying contents, 37 moving, 38 pasting, 38 removing, 39 renaming, 39 sorting, 39 sorting items, 39 working with, 37 Folders Collection (Impromptu), 499 Folders Property (Impromptu), 646 fonts, 264 footers, 248 adding, 272 height and width, 273 hiding and showing, 241 keeping with details, 273 putting summaries in, 437 rendering in Excel, 413 rendering with image for Excel, 413 form frames description, 369 inserting data, 375 inserting report objects, 376 overview, 375 repeating, 377 scoping data, 376 formats data, 174, 262, 359 exporting to Excel, 410 ini files, 293 formatting, 238, 254, 255, 256, 257, 258, 274, 533 3-Dimensional, 353 axis titles, 125 chart area, 126 chart legends, 129 chart properties, 123 chart titles, 125 charts, 123, 379 formatting (cont'd) data, 253, 259 data items individually, 128 data labels, 125 data using conditions, 354 HTML output, 687 HTML report output, 408 legend area, 126 legend text, 125 linked or embedded objects, 403 overview, 247 plot area, 126 retaining in Excel, 410 using conditions, 354 Formula, 647 FormulaEx Property (Impromptu), 647 FormulaExB Property (Impromptu), 652 frame, 480 frames, 629 and sub-reports, 392 designating the primary frame, 371 form, 375 inserting, 371 inserting data into, 371 naming, 373 parent/child relationship, 370 picture, 380 properties, 370 selecting, 373 text, 379 types, 369 viewing frame types, 372, 374 full name, 656 assigning, 656 full outer join, example, 447 FullName Property (Impromptu), 656 function absolute, 742 add-days, 732 functions, 726 access security, 729 add-months, 733 add-years, 733 age, 733 ceiling, 743 char_length, 749 characters-to-integer, 749 comparison, 771 CreateObject, 476 date and time, 731 datedaydiff, 734 datetime-to-date, 734 date-to-datetime, 734 date-to-days-from-1900, 734 date-to-string, 735 day, 735 day-of-ymd-interval, 735 days-from-1900-to-datetime, 736 daysint-to-ymdint, 735 days-to-end-of-month, 736 decrypt, 749 encrypt, 750

810 IBM(R) Cognos(R) Impromptu(R)

Index
functions (cont'd) filtering, 443 first-of-month, 736 first-word, 750 floor, 743 GetObject, 476 hour, 736 integer-divide, 743 last-day-of-month, 737 left, 750 lower, 750 make-datetime, 737 match-pattern, 751 minute, 737 mod, 744 month, 738 month-of-ymd-interval, 738 months-between, 738 number-to-character, 744 number-to-date, 739 number-to-datetime, 739 number-to-string, 744 number-to-string-padded, 744 numeric, 742 octet_length, 752 overview, 729 pack, 752 performance issues, 443 phdate-to-date, 739 position, 752 power, 745 pre50-months-between, 739 reverse, 753 right, 753 round-down, 745 round-near, 746 round-up, 746 round-zero, 747 second, 740 sound-of, 753 spread, 753 sqlTables, 112 sqrt, 747 string-to-integer, 754 string-to-number, 754 substitute, 754 substring, 754 time-to-zero, 740 today, 740 trim-leading, 755 trim-trailing, 755 uppercase, 755 used in expressions, 51 user-classes, 730 user-name, 730 year, 741 year-of-ymd-interval, 740 years-between, 741 ymdint-between, 741 ymdint-to-daysint, 742

G
gantt charts description, 120 GenerateReport Method (Impromptu), 559 generating content overview reports, 34 default reports, 35 folders from reports, 40 new reports from a catalog table, 559 GetAppVersionInfo Method (Impromptu), 560 GetDataValue Method (Impromptu), 561 GetErrorNumber Method (Impromptu), 562 GetFilterFor Method (Impromptu), 569 GetNextQueryError Method (Impromptu), 569 GetObject function, 476 GetParameter Method (Impromptu), 576 GetSelectedText Method (Impromptu), 576 getting Application version information, 560 data value, 561 error numbers, 562 filter expressions by user class, 569 next query error, 569 parameters, 576 selected text, 576 global variables using rendition ID, 456 glossary, 781 graphics, 236 grid, 250 grid lines, 267 grids settings changing, 128 grouping automatically, 318 data, 215, 217 parts of a report, 243 report objects, 376 report objects for Excel, 413

H
HasTextBlobLimit Property (Impromptu), 656 headers, 248 adding, 272 height and width, 273 hiding and showing, 241 keeping with details, 273 rendering in Excel, 413 rendering with image for Excel, 413 height, 271, 273 help information, 309 hidden parts of a report, 242 hiding, 242 columns, 241 data labels in charts, 129 grid lines, 267 headers and footers, 241 part of a report, 241 prompts for stored procedure values, 97 report objects, 356 toolbars, 450

Administration Guide 811

Index
highlowcloseopen charts description, 120 highlowopen charts description, 120 HotFiles, 277, 285 as data sources, 422 changing, 90 creating, 90 creating a catalog, 91 creating automatically, 423 database definitions, 111 databases, 89 exporting, 555 identifying, 658 modifying, 90 overview, 89 performance issues, 445 saving as, 90 selecting, 91 sharing, 422 updating, 90, 421 using, 91 using in reports, 422 using instead of snapshots, 421 working with, 89, 91 hour function, 736 how to create an interval, 346 filter using a rolling time period, 322 find the average of totals for groups, 347 find the rank and percentile of calculated values, 346 insert a calculated data item, 345 HTML, 185 publishing, 473 suppressing table of contents, 693 HTML files, 408 HTML report output avoiding multiple scrollbars, 408 creating, 405 designing, 405 distributing, 410 files created, 408 formatting, 408 improving performance, 408 HTML reports including report navigator, 697 setting rendering format, 687 setting the first page, 655 setting the last page, 698 identifying (cont'd) open catalogs, 620 right table, 688 user classes, 702 if component, 777 if then else construct, 777 if/then calculation, 351 images, 236 adding to Excel report output, 196 in header or footer for Excel, 413 importing catalogs into Architect, 167 importing queries, 207 Impromptu accessing, 614 architecture, 435 exiting, 592 introduction to OLE automation, 455 quitting, 592 running macros, 460 running multiple instances, 209, 210 SQL, 419 Impromptu Data Directory, 294 Impromptu Web Reports notifying the report administrator, 286 preparing reports for, 283 using locked catalogs, 284 Impromptu.ini, 295 improved ODBC metadata response, 112 improving performance, 79, 80 in comparison operator, 772 including report navigator, 697 information about help, 309 Informix 9.2, 111 database definitions, 111 inheritance and maintaining Impromptu, 104 INI files Cer.ini, 294 ini files Cognos.ini, 294 format, 293 Impromptu.ini, 295 overview, 293 initialization strings and Sybase IQ, 114 inserting data into frames, 371 frames, 371 page breaks, 274 page numbers, 238 parameters, 96 pictures, 235, 236 placeholders, 368 qualification level, 577 report variables, 235, 239 text, 235 InsertQualificationLevel Method (Impromptu), 577 integer-divide function, 743

I
IBM Cognos Query, 207, 281, 282 import queries from, 170 IBM Cognos Scheduler, 105 identifying connected databases, 547, 627 database definitions, 629 error documents, 639 HotFiles, 658 left table, 663 modified reports, 674

812 IBM(R) Cognos(R) Impromptu(R)

Index
integrating Impromptu with other IBM Cognos products, 167 security for Impromptu Web Reports, 169 Interactive Method (Impromptu), 578 interrupting data retrieval, 578 interval formats, 258 intervals calculating between two dates, 346 finding the average, 349 introduction to Impromptu OLE automation, 455 invoices, 103 is missing comparison operator, 772 is not missing comparison operator, 773 IsDistributed Property (Impromptu), 657 IsExternal Property (Impromptu), 658 IsKey Property (Impromptu), 659 IsLocked Property (Impromptu), 660 IsSynonym Property (Impromptu), 661 Item Property (Impromptu), 662 items adding, 520, 522 moving, 38 removing, 39, 593 Items Property (Impromptu), 663 IWR notifying the report administrator, 286 preparing reports for, 283 joins (cont'd) when not to use, 446 justify data, 258

K
keys creating joins, 45, 46 setting, 659

L
labels changing in charts, 129 last-day-of-month function, 737 launch buttons setting up, 451 launch menu commands setting up, 450 layout, 258 LDAP, 67 left function, 750 left outer join, example, 447 left table, 483, 516 left-justified alignment, 258 LeftTable Property (Impromptu), 663 legend area formatting, 126 legend text formatting, 125 legends adding to charts, 129 like comparison operator, 773 Like operator with filters, 324 limiting amount of large text items retrieved, 77 number of rows retrieved, 78 line charts description, 120 linking column titles to query, 369 compared to embedding, 398 from another application, 399 special copy, 540 links breaking, 400 converting linked objects, 399, 400 editing, 400 removing, 49 updating, 400 list frames, 267, 269 description, 369 exporting to Excel, 411 inserting data, 374 inserting report objects, 374 list reports adding totals, 232 changing a crosstab into, 390 creating, 203 pivoting data, 384 printing repeat columns, 190 printing wide reports, 189

J
joining tables using columns from other tables, 41 tables using more than one column, 41 joins, 41, 483 analyzing, 47 changing, 49 complex joins, 41, 44 compound joins, 41, 44 creating automatically, 45, 46 cross-product queries, 625 described, 446 effects on report, 445 equi-joins, 41, 42 full outer join, example, 447 identifying left tables, 663 identifying right tables, 688 identifying type, 698 left outer join, example, 447 manual complex joins, 44 manual compound joins, 44 manual outer joins, 43 manual self-joins, 44 non-equi-joins, 41, 42 outer joins, 43 overriding, 446 removing, 49 returning expressions, 622 right outer join, example, 447 self-joins, 41, 44 TableLinks collection, 504 using table weights, 705

Administration Guide 813

Index
listing selected frames, 613 lists, 268 local snapshots, description, 421 locale settings, 174, 262, 359 locale settings and data formats, 174 configuring, 174, 262, 359 location, 109 locations Cer.ini, 294 lock catalog, 73 locked catalog, 426 locked catalogs determining, 660 in Impromptu Web Reports, 284 locked report warning, 298 locking catalog, 426 catalogs, 30 logarithmic trendline, 131 logging performance data in audit files, 85 logical database name, 469, 515 logical operators, 769, 770 and, 770 not, 770 or, 770 lookup component, 778 Lotus 1-2-3 files, 193, 194 lower function, 750 MasterTable Property (Impromptu), 666 match-pattern function, 751 maximized, 706 maximum summary, 758 MaxQueryExecutionTime Property (Impromptu), 667 MaxRowsRetrieved Property (Impromptu), 668 MaxTablesPerReport Property (Impromptu), 669 MaxTextBlobCharacters Property (Impromptu), 670 measures associating with Impromptu reports, 171 menu commands enabled during query processing, 114 menus adding commands, 449 creating, 449 customizing, 449 distributing, 452 resetting, 449 MetaDataItem Property (Impromptu), 670 MetaDataPath Property (Impromptu), 672 methods, 515, 550 Activate, 510 Add, 511 Add Columns, 513 Add DeniedCatalogs, 517 Add DeniedColumns, 517 Add DeniedFolderItems, 517 Add DeniedSchemas, 517 Add DeniedSelectedValues, 517 Add DeniedTables, 517 Add TableLinks, 516 Add Tables, 512 AddExternalHotfile, 518 AddFolder, 519 AddItem (Column parameter), 522 AddItem (Use parameter), 520 AddTable, 523 Append, 524 ApplyTemplate, 533 ChangeUserClass, 534 Clear, 535 ClearTOCColumns, 536 Close, 536 CloseCatalog, 536 CloseReport, 537 Commit, 538 ConnectDatabase, 539 CopySpecialToClipboard, 540 CopyTo, 541 CopyToClipboard, 542 CreateAlias, 542 CreateCatalog, 543 CreateEmptyCatalog, 544 CreateFilterFor, 545 CreateSnapShot, 546 CreateStoredProcedure, 547 Delete, 548 DistributedUpdate, 549 Execute, 549 ExportAscII, 551 ExportData, 552 ExportdBase, 553

M
macro utilities, 105 macro-filename command line startup switch, 291 macros at startup (Impromptu), 459 before opening a report (Impromptu), 460 running (Impromptu), 459, 460 using a command (Impromptu), 459 using a command line option (Impromptu), 460 using a menu command, 450 using a menu command (Impromptu), 459 using a toolbar button, 451 using a toolbar button (Impromptu), 459 using with catalog prompts, 328 mailing labels, 103 make-datetime function, 737 manually updating catalogs, 428 margins, 249 marking data items for a report, 211 master catalogs identifying, 664 master tables identifying master table, 666 identifying master table name, 665 MasterCatalogFilename Property (Impromptu), 664 Mastering Impromptu Reports, 309 MasterName Property (Impromptu), 665

814 IBM(R) Cognos(R) Impromptu(R)

Index
methods (cont'd) ExportExcelWithFormat, 554 ExportHotFile, 555 ExportSQL, 555 ExportText, 556 ExportTransformer, 557 FileSetPrinter, 558 GenerateReport, 559 GetAppVersionInfo, 560 GetDataValue, 561 GetErrorNumber, 562 GetFilterFor, 569 GetNextQueryNumber, 569 GetParameter, 576 GetSelectedText, 576 InsertQualificationLevel, 577 Interactive, 578 MoveTo, 579 OpenCatalog, 579 OpenDrillDownReport, 583 OpenReport, 584 OpenReportNoExecute, 586 Print, 587 PrintOut, 587 Publish, 588 PublishXML, 589 QueryDialog, 590 QueryItems, 591 Quit, 592 ReExecute, 592 Remove, 593 RemoveFilterFor, 594 RemoveQualificationLevel, 595 Reset, 596 RetrieveAll, 597 RetrieveRows, 597 Save, 598 SaveAs, 599 SetProcedure, 600 Title, 602 TOCAddColumn, 603 UpdateCatalog, 604 UseDatabase, 604 Visible, 605 Microsoft Excel publishing, 472 Microsoft Excel reports exporting, 554 MinimizeConnectTime Property (Impromptu), 673 minimized, 706 minimum free disk space, 302 minimum summary, 759 minute function, 737 missing values exporting to Microsoft Excel, 626 retrieving, 321 missing values, retrieving, 321 mod function, 744 Modified Property (Impromptu), 674 modified reports identifying, 674 modifying catalogs, 428 HotFiles, 90 placeholders, 367 report titles, 602 user classes, 617 modifying user classes, 617 month function, 738 month-of-ymd-interval function, 738 months-between function, 738 MoveTo Method (Impromptu), 579 moving columns, 269 folder, 579 folder items, 579 summaries, 233 moving average trendline linear trendline, 131 moving catalog folders, 430 moving-average summary, 759 moving-total summary, 759 MRU files, 307 MS SQL Server database definitions, 112 multi-column placeholders alignment, 367 placement, 367 multiple instances of Impromptu, 209 multiple queries, what you can do, 391 multiple values in type-in prompts, 332 multiple versions of Impromptu, 209 multiple worksheets avoiding in Excel, 411

N
name of database creating, 109 Name Property (Impromptu), 675 NameSpace Property (Impromptu), 676 namespaces, 67 namespaces for Impromptu catalogs, 676 naming aliases, 32 navigation adding in reports, 195 nested crosstab reports, 384 next query error, 569 non-equi-joins creating, 42 non-indexed columns sorting, 79, 443 NonIndexSortingPermission Property (Impromptu), 677 not logical operator, 770 not operator, 770 null component, 778 null values description, 321 exporting to Microsoft Excel, 626 in filters, 321 numbering pages, 238

Administration Guide 815

Index
number-to-character function, 744 number-to-date function, 739 number-to-datetime function, 739 number-to-string function, 744 number-to-string-padded function, 744 numeric data formatting, 262 numeric formats, 254 numeric functions, 742 operators, 727 and, 770 arithmetic, 770 between, 771 contains, 772 in, 772 is missing, 772 is not missing, 773 like, 773 logical, 770 not, 770 or, 770 starts with, 773 string, 771 used in expressions, 52 optimize for n rows, 112 options query, 302 startup, 298 or logical operator, 770 or operator, 770 Oracle bulk fetch, 114 database definitions, 114 organizing catalogs, 38, 39, 40 outer joins, 41 controlling the creation of, 79 creating manually, 43 described, 446 effect on reports, 445 examples, 446 full outer join, example, 447 left outer join, example, 447 overriding, 446 right outer join example, 447 when not to use, 446 OuterJoinPermission Property (Impromptu), 678 overlapping objects eliminating for Excel, 407 eliminating in Excel reports, 412

O
object adding, 511, 513, 515, 516, 517 object attributes (Impromptu.ini), 304 objects Application, 462 Catalog, 464 CatalogLevel, 465 Column, 466 Database, 467 Database Connection, 469 Database Definition, 469 eliminating overlapped in Excel, 407 Expression, 470 FolderItem, 471 grouping for Excel, 413 PublishExcel, 472 PublishHTML, 473 PublishPDF, 474 QueryItem, 475 ReportDocument, 476 retrieving names, 675 SchemaLevel, 479 SelectedFrame, 480 StoredProcedure, 481 Table, 482 TableLink, 483 UserClass, 484 octet_length function, 752 ODBC accessing DB2, 112 create database definitions, 112 metadata response, 112 OLE automation Impromptu, 455 OLE frame, description, 369 OLE registration ID, 675 online help information, 309 OpenCatalog Method (Impromptu), 579 OpenDrillDownReport Method (Impromptu), 583 opening catalogs, 202, 579, 620 distributed catalogs, 30 reports, 181, 476, 584, 586 reports with prompts, 584 reports without executing, 586 opening, catalogs, 427 OpenReport, 713 OpenReport Method (Impromptu), 584 OpenReportNoExecute Method (Impromptu), 586

P
pack function, 752 packaging HotFiles for UNIX, 285 HotFiles for Windows and UNIX, 285 page breaks controlling for Excel, 411, 413 inserting, 274 removing, 274 page numbers, 238, 239, 274 page setup, 187 page view, templates, 363 parameters stored procedures, 576 parent retrieving, 678 parent folders, 519 parent frame, description, 370 Parent Property (Impromptu), 678

816 IBM(R) Cognos(R) Impromptu(R)

Index
parent/child relationship, 370 passwords encrypted, 638 plain text, 680 pasting folders, 38 Path Property (Impromptu), 680 patterns, 263 PDF publishing, 474 PDF bookmarks, 195 percentage summary, 760 percentile, 346 percentile summary, 761 performance auditing, 85 improving, 79, 80 improving in HTML report output, 408 performance issues associating, 438 client/server balancing, 436 data, 444 filtering, 442 functions, 443 HotFiles, 445 printing reports, 444 sizing frames, 444 snapshots, 444 sorting, 438, 443 summaries, 437 thumbnails, 444 using cascading prompts, 332 using if/then/else, 443 using lookup, 443 permissions adding folders, 616 adding user classes, 617 catalogs, 632 columns, 633 creating new reports, 617 cross-product queries, 625 denied schemas, 635 entering SQL statements, 618 expression editing, 52 folder items, 634 modifying folders, 616 outer joins, 678 select values, 635 tables, 636 permissions for catalogs, 425 persistent object, 511 personal catalogs about, 25, 27 changing types, 28 personal distributed catalogs changing, 428 overview, 426 updating, 426, 427 updating manually, 428 Personal Oracle, 114 phdate-to-date function, 739 picklist prompts adding select all option, 327 changing prompt separator, 327 creating for multiple selections, 327 creating in Prompt Manager, 329 picklists limit, 298 picture frames description, 369 dynamic, 380 scaling and cropping, 381 using, 380 pictures, 235, 236 pie charts, 121 description, 121 pivoting data in list reports, 384 placeholders alignment, 367 creating, 365 creating calculated, 367 description, 361 inserting, 368 modifying, 367 multi-column, 367 placement, 367 plain text passwords, 680 PlainTextPassword Property (Impromptu), 680 plot area formatting, 126 polynomial trendline, 131 position function, 752 positioning part of a report, 250 power function, 745 PowerCubes creating, 172 PowerPlay data files exporting, 552 PowerPlay files, 193, 194 PowerPrompts, 287 pre50-months-between function, 739 predefined calculations, 336 predefined conditions editing, 431 renaming, 431 using, 355 prefilter component, 778 preparing reports for IWR, 283 preventing sorting on non-indexed columns, 79 preview image, customizing, 362 previewing reports, 188 primary frames, 371 Print Method (Impromptu), 587 printer files setting, 558 printer setup, 188 printing documents, 587 repeat columns, 190 reports, 187, 587 wide list reports, 189 printing reports, performance issues, 444

Administration Guide 817

Index
PrintOut Method (Impromptu), 587 prompt component, 778 Prompt Definition dialog box, 727 prompt manager, 325, 329 prompt methods, 520 prompt separator, changing, 327 Prompt Syntax, 529 prompts case sensitivity, 325 catalog, 328 changing prompt separator, 327 creating, 59, 329 creating and storing in catalogs, 432 creating cascading, 332 creating catalog prompts, 57 creating for a single selection, 330 creating picklists for multiple selections, 327 displaying values in, 329 formatting data with, 335 hiding from users, 97 in calculated data items, 334 in filter expressions, 331 managing, 329 modifying, 60 modifying catalog prompts, 59 multiple values for type-in, 332 overview, 51, 57 picklist, 326 re-ordering, 325 requirements, 329 select all option, 327 type-in, 325 types, 325 unreferenced, 329 using catalog prompts in a report, 59 using to filter reports, 333-334 using values in, 329 with multiple selections, 331 properties, 550 ActiveCatalog, 611 ActiveDocument, 612 ActiveUserClass, 612 AllSelectedFrames, 613 Application, 614 CanAddOrModifyFolders, 616 CanAddOrModifyUserClasses, 617 CanCreateNewReports, 617 CanDirectEnterSQL, 618 Catalog Automation Properties, 642, 643 CatalogLevels, 619 CatalogName, 620 CatalogOpened, 620 Columns, 621 Condition, 622 ConnectedDatabase, 627 Count, 623 CreatorUserClass, 624 CrossProductPermission, 625 CSVExportOptions, 626 DatabaseConnections, 630 DatabaseDefinitions, 629 DatabaseItem, 629 properties (cont'd) DBObject, 631 Definition, 632 DeniedCatalogs, 632 DeniedColumns, 633 DeniedFolderItems, 634 DeniedSelectValues, 635 DeniedTables, 636 Description, 637 EncryptedPassword, 638 ErrorDocument, 639 ExportMetaTags, 639 ExportOptions, 640 Filename, 641 FolderItem, 644 FolderPath, 645 Folders, 646 Formula, 647 FormulaEx, 647 FormulaExB, 652 FromPage, 655 FullName, 656 HasTextBlobLimit, 656 IsDistributed, 657 IsExternal, 658 IsKey, 659 IsLocked, 660 IsSynonym, 661 Item, 662 Items, 663 LeftTable, 663 MasterCatalogFilename, 664 MasterName, 665 MasterTable, 666 MaxQueryExecutionTime, 667 MaxRowsRetrieved, 668 MaxTablesPerReport, 669 MaxTextBlobCharacters, 670 MetaDataItem, 670 MetaDataPath, 672 MinimizeConnectTime, 673 Modified, 674 NonIndexSortingPermission, 677 OuterJoinPermission, 678 Parent, 678 Path, 680 PlainTextPassword, 680 PublishHTML, 681 PublishPDF, 682 QualificationLevel, 683 QueryExecutionTimeWarnAfter, 684 QueryItem, 685 QueryProcessing, 686 ReadIsolationLevel, 687 RenderingFormat, 687 ResultType, 687 RightTable, 688 RowsRetrievedWarnAfter, 689 SchemaLevels, 690 SelectDistinctPermission, 691 SelectedFrames, 692 SQL, 693

818 IBM(R) Cognos(R) Impromptu(R)

Index
properties (cont'd) SuppressTOCDuplicates, 693 TableLinks, 694 Tables, 695 TablesPerReportWarnAfter, 696 TOC, 697 TOCByPageNumber, 697 ToPage, 698 Type, 698 UniqueID, 700 UseQueryWarnings, 701 UserClasses, 702 Username, 703 Value, 703 Version, 704 Weight, 705 WindowState, 706 properties, of frames, 370 Publish Method (Impromptu), 588 publish reports to Upfront, 172 PublishExcel Object (Impromptu), 472 PublishHTML, 721 PublishHTML Automation Properties ExportMetaTags, 639 FromPage, 655 RenderingFormat, 687 Suppress TOCDuplicates, 693 TOCByPageNumber, 697 ToPage, 698 PublishHTML Object (Impromptu), 473 clearing columns from Report Navigator, 536 PublishHTML Property (Impromptu), 681 publishing reports to Upfront, 405 PublishPDF Object (Impromptu), 474 PublishPDF Property (Impromptu), 682 PublishXML Method (Impromptu), 589 queries (cont'd) compared to reports, 435 creating by writing your own SQL, 99 editing, 392 identifying column names for frames, 685 importing, 207 linking column titles to, 369 outer join permissions, 678 processing, 686 query execution time warning, 684 query processing, 686 re-executing, 592 removing data, 212 rows retrieved warning, 689 setting maximum execution time, 667 setting maximum rows retrieved, 668 setting maximum tables per report retrieved, 669 setting maximum text-blob characters retrieved, 670 sorting on non-index columns, 677 SQL, 435 statistics, 306 tables per report warning, 696 versus reports, 435 what you can do with, 391 what you cannot do with, 392 Query Dialog Box, 590 Query Error 100, 572 Query Error 101, 572 Query Error 102, 572 Query Error 103, 572 Query Error 104, 572 Query Error 105, 572 Query Error 106, 572 Query Error 107, 572 Query Error 108, 573 Query Error 109, 573 Query Error 110, 573 Query Error 111, 573 Query Error 112, 573 Query Error 113, 573 Query Error 300, 573 Query Error 301, 574 Query Error 302, 574 Query Error 303, 574 Query Error 304, 574 Query Error 305, 574 Query Error 306, 574 Query Error 307, 574 Query Error 308, 575 Query Error 309, 575 Query Error 310, 575 Query Error 311, 575 Query Error 500, 575 Query Error 501, 575 Query Error 502, 575 query options (Impromptu.ini), 302 query results column order, 445 query warnings using, 701 QueryDialog Method (Impromptu), 590 QueryExecutionTimeWarnAfter Property (Impromptu), 684

Q
qualification levels, 489, 501, 503, 683 CatalogLevel object, 465 CatalogLevels Collection, 488 Database Object, 467 Databases Collection, 490 identifying CatalogLevel objects, 619 identifying SchemaLevels objects, 690 inserting, 577 removing, 595 SchemaLevel Object, 479 SchemaLevels Collection, 501 QualificationLevel Property (Impromptu), 683 qualifiers adding, 34 removing, 34 qualifying tables, 34 quantile summary, 761 quartile summary, 762 queries, 592, 669, 678, 691 changing by writing your own SQL, 99

Administration Guide 819

Index
QueryItem Object (Impromptu), 475 QueryItem Property (Impromptu), 685 QueryItems Collection (Impromptu), 501 QueryItems Method (Impromptu), 591 QueryProcessing Property (Impromptu), 686 Quit Method (Impromptu), 592 quitting Impromptu, 592 Report Automation Methods Activate, 510 ApplyTemplate, 533 CloseReport, 537 CopySpecialToClipboard, 540 CopyToClipboard, 542 CreateSnapShot, 546 Export, 550 ExportAscII, 551 ExportdBase, 553 ExportExcelWithFormat, 554 ExportHotfile, 555 ExportSQL, 555 ExportText, 556 ExportTransformer, 557 GetDataValue, 561 GetSelectedText, 576 Print, 587 PrintOut, 587 PublishXML, 589 QueryDialog, 590 QueryItems, 591 ReExecute, 592 RetrieveAll, 597 RetrieveRows, 597 Save, 598, 599 Title, 602 UseDatabase, 604 Visible, 605 Report Automation methods ExportData, 552 Report Automation Properties AllSelectedFrames, 613 DatabaseItem, 629 FolderItem, 644 FolderPath, 645 FullName, 656 MetaDataItem, 670 MetaDataPath, 672 Modified, 674 Path, 680 PublishHTML, 681 PublishPDF, 682 QueryItem, 685 SelectedFrames, 692 SQL, 693 WindowState, 706 report component, 779 Report Defrag Threshold setting, 107, 448 report formatting, 533 report frame, 480 report headers adding meta tags, 639 report navigation adding, 195, 405 Report Navigator adding, 195 adding to reports, 405 report navigator, 536, 603 clearing columns, 536 including page numbers, 697

R
radar charts description, 121 rank summary, 762 ranking calculated data items, 346 ReadIsolationLevel Property (Impromptu), 687 read-only report warning, 298 ReExecute Method (Impromptu), 592 re-executing queries, 592 reference collections removing items, 593 refreshing snapshots, 279 registry keys, 457 remote database connection, 469 Remove Method (Impromptu), 593 RemoveFilterFor Method (Impromptu), 594 RemoveQualificationLevel Method (Impromptu), 595 removing an object from a collection, 548 borders, 263 columns from Report Navigator, 536 currency symbols from currency symbol list, 260 data, 211, 212 database definitions, 117 duplicate rows, 325 filter, 594 filters, 222 grouped data, 217 headers and footers, 248 item, 593 items from reference collections, 593 joins, 49 links, 49 page breaks, 274 qualification level, 595 qualifiers, 34 snapshots, 280, 604 sorting, 218 styles from conditions, 355 tables and columns, 33 renaming folders, 39 items in folders, 39 rendering header or footer with image for Excel, 413 headers and footers in Excel, 413 report in Excel format, 196 RenderingFormat Property (Impromptu), 687 rendition ID, 456 repeating form frames, 377 replace with (->) component, 778 report administrator, 286

820 IBM(R) Cognos(R) Impromptu(R)

Index
Report objects SelectedFrames collections, 502 report objects aligning for Excel output, 411 aligning for HTML output, 406 hiding, 242 positioning, 250 stacking, 244 report size managing, 107, 448 report titles modifying, 602 specifying, 602 report variables, 235 calculation, 239 catalog description, 239 catalog file name, 239 chart frame, 239 column spacer, 239 column titles, 239 data item, 239 database name, 239 database user ID, 239 form frame, 239 list frame, 239 OLE object, 239 page number, 239 picture frame, 239 prompt variable, 239 rectangle, 239 report description, 239 report file name, 239 row numbers, 239 running page totals, 239 snapshot timestamp, 239 system date, 239 system time, 239 text frame, 239 total pages, 239 user class, 239 Report Wizard creating crosstabs, 204 creating list reports, 203 report wizard, 201 ReportDocument Object, 473 activating, 510 focus, 510 QueryItem, 475 SelectedFrame Object, 480 ReportDocument Object (Impromptu), 476 report-name command line startup switch, 291 reports accessibility, 174, 208 active, 612 adding data, 211 aligning objects for Excel, 411 aligning parts of, 249 aligning text, 258 applying templates, 247 associating with PowerPlay measures, 171 avoiding multiple worksheets in Excel, 411 changing catalogs, 317 reports (cont'd) closing, 537 compared to queries, 435 controlling page breaks for Excel, 411 controlling size, 107, 448 converting linked objects, 399, 400 create accessible, 447 creating, 201, 203, 204, 205, 617 creating accessible, 174 creating stored procedure, 96 data scoping for Excel, 414 default, 35 designing HTML, 405 drill down, 583 editing embedding objects, 402 editing object links, 400 eliminating overlapped objects in Excel, 407 email, 196 embedding in other applications, 403 embedding objects, 401 entering SQL statements, 618 exporting, 550 exporting Hotfiles, 555 exporting to Excel, 410 filtering using stored filters, 224 formatting, 247, 249, 253, 263, 264, 265 formatting linked or embedded objects, 403 full name, 656 generating, 559 generating efficient SQL, 100 generating folders, 40 grouping objects, 376 grouping objects for Excel, 413 grouping parts of, 243 identifying modified reports, 674 identifying query errors, 639 identifying query items, 644, 645, 670, 672 incorporating in other applications, 404 inserting objects into frames, 376 inserting objects into list frames, 374 linking from another application, 399 linking objects, 399 linking versus embedding objects, 398 list frames in Excel, 411 location, 680 multiple list frames for Excel, 411 opening, 476, 584, 586 outer joins, 445 preparing for IWR, 283 previewing, 188 printing, 187, 587 publish to Upfront, 172 publishing as HTML, 681 publishing as PDF, 588, 682 publishing as XML, 589 publishing to HTML, 588 publishing to Microsoft Excel, 588 publishing to Upfront, 405 Query Dialog Box, 590 query items, 591 rendering headers and footers for Excel, 413 rendering in Excel format, 196

Administration Guide 821

Index
reports (cont'd) resizing parts of, 244 retrieving rows, 597 reusing, 207 row and column titles, 413 saving, 598 saving as HTML, 408 saving as new name, 599 saving as templates, 364 saving in different file formats, 193 See also accessible reports, 174, 208 See alsoaccessible reports, 175 selected frame objects, 692 specifications, 289 stored procedure, 95 synchronize to changed catalog, 40 unhiding parts of, 242 updating object links, 400 upgrade, 203 using drill-through, 394 using HotFiles, 422 using summaries for Excel, 414 versus queries, 435 viewing, 181, 182, 183 Request Server and Sybase, 114 requirements, prompt, 329 Reset, 596 Reset Method (Impromptu), 596 resetting, 596 menus, 449 PublishHTML objects, 596 toolbars, 450 resetting page numbers, 274 resizing parts of a report, 244 resolving loop join structures, 542 restricting time user classes are connected to the database, 81 restricting access to creator user class, 73 ResultType Property (Impromptu), 687 RetrieveAll Method (Impromptu), 597 RetrieveRows Method (Impromptu), 597 retrieving all rows, 597 object names, 675 OLE registration ID, 675 parent, 678 rows, 597 selected text, 576 SQL strings, 693 retrieving data, 209 containing missing values, 321 in text blobs, 324 that matches a pattern, 323-324 that starts with or contains a specific value, 322 using a snapshot, 322 using another report, 322 using Like, Contains, Starts With operators, 324 returning, 623 an object in a collection, 662 connection string, 632 to database, 604 reusing reports, 207 reverse function, 753 right function, 753 right outer join, example, 447 right table, 483, 516 right-justified alignment, 258 RightTable Property (Impromptu), 688 rolling time period, 322 round-down function, 745 round-near function, 746 round-up function, 746 round-zero function, 747 row height, 271 row titles exporting to Excel, 413 rows hiding, 242 limiting number of retrieved rows, 78 retrieving, 597 retrieving all, 597 selecting in a list, 268 RowsRetrievedWarnAfter Property (Impromptu), 689 running macros, 459 Impromptu, 459, 460 running totals, 337 running-average summary, 763 running-count summary, 763 running-difference summary, 764 running-maximum summary, 765 running-minimum summary, 765 running-total summary, 766

S
sales reports, 103 Save Catalog Method (Impromptu), 598 Save Method (Impromptu), 598 SaveAs Method (Impromptu), 599 saving, 536, 598 as new name, 599 catalogs, 598 changes to catalogs, 536 expressions, 538 reports, 598 reports as snapshots, 598 reports in DAT format, 552 reports in dBase format, 553 reports in different file formats, 550 reports in Microsoft Excel format, 554 reports in PowerPlay Transformer format, 557 reports in SQL format, 555 reports in text format, 551, 556 saving as, 193, 194 scale settings, 126 changing in charts, 126 scaling picture frames, 381 scatter charts description, 121 SchemaLevel Object (Impromptu), 479 SchemaLevels Collection (Impromptu), 501 SchemaLevels Property (Impromptu), 690

822 IBM(R) Cognos(R) Impromptu(R)

Index
schemas permissions, 635 scoping data, 376 scrollbars avoiding multiple in HTML report output, 408 searching for files, 290 second function, 740 secured catalog and standard reports, 103 secured catalogs about, 25, 27 changing types, 28 security, 67 differences between IWR and Impromptu, 169 integrating, 169 select all option picklist prompts, 327 select values, 223, 691 permissions, 635 SelectDistinctPermission Property (Impromptu), 691 selected frames listing, 613 selected text getting, 576 retrieving, 576 SelectedFrame Object (Impromptu), 480 SelectedFrames, 709 SelectedFrames Collection (Impromptu), 502 SelectedFrames Property (Impromptu), 692 selecting, 480, 692 a different database for catalogs, 118 frames, 480, 692 HotFiles to include in catalogs, 91 parts of a crosstab report, 274 parts of a list report, 268 selecting frames, 373 self-joins, 41 creating manually, 44 SetProcedure Method (Impromptu), 600 setting active catalog, 611 chart spacing, 126 column width, 270 encrypted passwords, 638 focus, 510 maximum rows retrieved, 668 maximum text-blob characters retrieved, 670 outer join permissions, 678 page breaks, 274 plain text passwords, 680 printer files, 558 query execution time warning, 684 query execution times, 667 query processing, 686 read-transaction levels, 687 row height, 271 rows retrieved warning, 689 select distinct permissions, 691 sorting on non-index columns, 677 stored procedures, 600 tables per report retrieved, 669 tables per report warning, 696 setting (cont'd) up drill through to IBM Cognos Query, 282 up the printer, 188 visibility, 605 setting default templates, 362 setting up launch buttons, 451 launch menu commands, 450 settings locale, 174, 262, 359 shared catalog changing, 428 overview, 425 shared catalogs about, 25, 27 changing types, 28 connected users limit, 25 showing columns, 241 data labels in charts, 129 grid lines, 267 headers and footers, 241 part of a report, 241, 242 report objects, 356 toolbars, 450 snap to column width, 244 grid, 250 parent size, 244 snapshots compared to HotFiles, 277 creating, 278, 546 generating with a macro, 105 local, 421 overview, 277 performance issues, 444 refreshing, 279 removing, 280, 604 retrieving data using, 322 saving, 278, 598 using instead of HotFiles, 421 sort-by component, 779 sorting data, 215, 218 folders, 39 non-indexed columns, 79 performance issues, 438, 443 removing, 218 tables in a catalog, 32 sorting data, 109 sound-of function, 753 specifications reports, 289 specifying, 693 report titles, 602 spread function, 753 SQL, 193, 194 generating for summary level reports, 100 overview, 99 writing your own queries, 99 SQL files exporting, 555

Administration Guide 823

Index
SQL Property (Impromptu), 693 SQL strings, 693 sqlTables function, 112 sqrt function, 747 stacking parts of a report, 244 standard reports an example, 104 creating, 103 defined, 103 standard-deviation summary, 766 starts with comparison operator, 773 Starts With operator with filters, 324 startup options (Impromptu.ini), 298 static charts adding to Excel report output, 196 statistics query, 306 Stored Procedure Automation Methods CreateStoredProcedure, 547 GetParameter, 576 SetProcedure, 600 Stored Procedure Automation methods Execute, 549 stored procedure reports creating, 96 inserting parameters, 96 overview, 95 Sybase, 114 stored procedures, 95 accessing, 481 creating, 547 executing, 481 parameters, 576 setting, 600 StoredProcedure Object (Impromptu), 481 string functions, 109 string operator, 769, 771 string-to-integer function, 754 string-to-number function, 754 Structured Query Language, 419 styles, 304 applying, 265 applying 3D formatting, 353 applying to a condition, 355 creating, 352 distributing reports using, 352 removing from conditions, 355 using conditions, 354 sub-folders, 519 sub-reports and frames, 392 converting an empty frame into, 392 creating, 392 creating crosstab, 208 frames, description, 369 queries, 392 types, 393 what you can do, 391 what you cannot do, 392 substitute function, 754 substring function, 754 Summaries storing in the catalog, 53 summaries, 230, 726 adding to crosstab reports, 386 applying more than one to crosstabs, 387 association, 229 automatic association, 338, 342 average, 758 complex, 337 copying, 342 count, 758 creating, 230, 342 creating from detailed data, 343 creating versus copying, 342 database, 438 description, 336 fixed association, 339 for crosstab columns and footers, 387 for groups, 337 in a crosstab, 386 maximum, 758 minimum, 759 moving, 233 moving-average, 759 moving-total, 759 overview, 229 percentage, 760 percentile, 761 performance issues, 437, 438 quantile, 761 quartile, 762 rank, 762 row, 337 running totals, 337 running-average, 763 running-count, 763 running-difference, 764 running-maximum, 765 running-minimum, 765 running-total, 766 standard-deviation, 766 storing in catalogs, 431 tertile, 767 total, 232, 768 used in expressions, 51 using in Excel output, 414 variance, 768 summary association automatic, 338 changing, 341 fixed, 339 performance issues, 438 summary expressions adding to Excel report output, 196 summary filters applying before filters, 320 when to use, 318 supported databases, 109 SuppressTOCDuplicates Property (Impromptu), 693 suspending macros, 590 swapping data in a crosstab report, 390

824 IBM(R) Cognos(R) Impromptu(R)

Index
Sybase (CT-Lib) database definitions, 114 and client libraries, 114 and fetch operations, 114 and Request Server, 114 DirectConnect for DB2, 112 IQ, 114 OmniConnect, 114 query processing, 114 SQL Server (CT-Lib), 114 stored procedures, 114 Sybase Adaptive Server Enterprise troubleshooting database connection, 314 symbols character, 255 currency, 259 dates, 255 date-time, 257 interval, 258 numeric, 254 time, 256 synonym tables determining, 661 templates (cont'd) customizing preview image, 362 defined, 103 limitations, 361 page view, 363 placeholders, 361 saving reports as, 364 setting default, 362 setting the view, 363 Teradata troubleshooting database connection, 314 tertile summary, 767 testing automation scripts, 510 testing drill-through reports, 397 text copying, 542 files, 193, 194 formatting, 264 frames, 235 get selected, 576 inserting, 235 items, 77 justification, 258 wrapping, 258 text blobs searching, 324 text fields retaining leading zeroes for Excel, 414 Text files exporting, 556 text frames adding to Excel report output, 196 and binary large objects, 379 combining, 380 description, 369 formatting, 379 using, 379 text functions, 748 the catalogs available user classes do not correspond error message, 312 then component, 777 thumbnails creating, 421 description, 421 performance issues, 444 time formats, 256 time-to-zero function, 740 tips for filters, 325 Title Method (Impromptu), 602 titles adding to charts, 124 exporting row and column to Excel, 413 formatting in charts, 125 TOCAddColumn Method (Impromptu), 603 TOCByPageNumber Property (Impromptu), 697 today function, 740 Token Table, 526 tokens catalog-user-profile, 729 toolbar buttons customizing, 450

T
table joins creating, 41 table links, 663, 688 table names using qualified, 34 Table Object (Impromptu), 482 TableLink Object (Impromptu), 483 TableLinks Collection (Impromptu), 504 TableLinks Property (Impromptu), 694 tables, 683 adding, 512, 523 aliases, 32 changing conditions, 55 determining if synonym, 661 filters, 643 multiple copies, 32 permissions, 636 qualifying, 34 removing, 33 removing joins, 49 sorting, 32 unique id, 700 using conditions, 55 verifying and updating, 33 weights, 705 Tables Collection (Impromptu), 503 Tables Property (Impromptu), 695 TablesPerReportWarnAfter Property (Impromptu), 696 templates an example, 104 applying, 533 applying to reports, 247 benefits, 361 blank, 205 changing a list to a crosstab, 364 creating reports with, 205

Administration Guide 825

Index
toolbars changing buttons, 450 customizing, 450 distributing, 452 ini files, 306 resetting, 450 setting up buttons, 450 showing or hiding, 450 ToPage Property (Impromptu), 698 total page numbers, 239 total summary, 768 totals adding to a list report, 232 generating automatically, 230 number of pages, 239 running, 239 Transformer files, 193, 194 exporting, 557 trendlines adding in charts, 131 exponential, 131 linear, 131 logarithmic, 131 moving average, 131 polynomial, 131 trim-leading function, 755 trim-trailing function, 755 troubleshooting cannot access the database, 311 catalog has no user class, 312 DMS-E-DBACCESS, 311 Error 53 dms-e-yv_systemerr, 313 macro cannot find Impromptu object, 457 the catalogs available user classes do not correspond, 312 unable to connect to database, 314 unexpected windows error (1157), 313 type libraries, 307 type library, 107 type of database setting, 109 Type Property (Impromptu), 698 type-in prompts multiple values, 332 types of catalogs, 425 updating (cont'd) distributed catalogs, 549, 604 HotFiles, 90, 421 links, 400 personal distributed catalogs, 426, 427 tables, 33 upgrading catalogs, 203 reports, 203, 475, 501 uppercase function, 755 UseDatabase Method (Impromptu), 604 UseQueryWarnings Property (Impromptu), 701 user classes, 79 active, 612, 624 adding, 433 adding folders, 616 adding user classes, 617 catalog access, 632 changing, 534 column filters, 642, 643 columns access, 633 controlling the retrieval of large text items, 77 creating, 65 creating cross-product reports, 80 creating new reports, 617 DatabaseConnections collection, 490 denied catalogs, 492 denied columns, 493 denied folder items, 494 denied schemas, 495 denied select values, 496 denied tables, 497 displaying duplicate data, 79 editing, 66 effects of, 425 entering SQL statements in report queries, 618 FilteredColumns collection, 498 folder item access, 634 identifying, 702 identifying database connections, 628 limiting number of rows retrieved, 78 minimizing database connection times, 673 modifying folders, 616 modifying user classes, 617 removing filters, 594 restricting time connected to database, 81 schemas access, 635 select values access, 635 setting maximum rows retrieved, 668 setting maximum tables per report retrieved, 669 setting maximum text-blob characters retrieved, 670 setting outer join permissions, 678 setting query execution time warning, 684 setting query execution times, 667 setting query processing, 686 setting rows retrieved warning, 689 setting select distinct permissions, 691 setting sorting on non-index columns, 677 setting tables per report warning, 696 sorting on non-indexed columns, 79 table access, 636 text-blob limit, 656

U
unexpected windows error (1157) error message, 313 ungrouping data, 217 parts of a report, 243 unhiding parts of a report, 241, 242 UniqueID Property (Impromptu), 700 unlock catalog, 73 unlocking catalog, 427 unreferenced prompts, 329 UpdateCatalog Method (Impromptu), 604 updating, 604 catalogs, 604

826 IBM(R) Cognos(R) Impromptu(R)

Index
user connection, 469 user profile, 484 UserClass Object (Impromptu), 484 UserClasses Collection (Impromptu), 505 user-classes function, 730 UserClasses Property (Impromptu), 702 user-name function, 730 UserName Property (Impromptu), 703 using a report as a data source, 207 Access Manager, 67 calculations, 346 conditions, 55 conditions in conditional formatting, 55 data scoping for Excel, 414 database, 604 database stored procedures, 547 detail filters, 318 filters, 319, 321 HotFiles, 91, 421 namespaces with Impromptu catalogs, 676 query warnings, 701 report images in other applications, 540 snapshots, 421 stored calculations, 54 stored conditions as a filter, 55 summaries for Excel, 414 summary filters, 318 this book, 21 type libraries, 307 values in prompts, 329 utilities IBM Cognos Scheduler, 105 IBM CognosScript Dialog Editor, 105 IBM CognosScript Editor, 105 viewing (cont'd) headers and footers, 248 reports, 181, 182, 183 reports in HTML, 185 visibility setting, 605 Visible Method (Impromptu), 605

W
warning sorting on non-indexed columns, 79 Web browsers, 185 Weight Property (Impromptu), 705 width, 270, 273 windows activating, 510 WindowState Property (Impromptu), 706 working offline, 278 working with calculations, 51 conditions, 51 HotFiles, 89, 91 prompts, 51 worksheets adding names before export to Excel, 412 changing order before export to Excel, 412 grouping report objects for Excel, 413

Y
year function, 741 year-of-ymd-interval function, 740 years-between function, 741 ymdint-between function, 741 ymdint-to-daysint function, 742

V
Value Property (Impromptu), 703 values, 726 date, 769 date-time, 769 false, 769 finding, 226 interval, 769 null, 778 number, 769 selecting in a list, 268 string, 769 time, 769 true, 769 used in expressions, 52 ymd interval, 769 variance summary, 768 verifying tables, 33 version information, 560 version of document, 2 Version Property (Impromptu), 704 viewing Access tab, 421 frame types, 374

Z
zeroes exporting to Microsoft Excel, 626 retain in text on export, 414

Administration Guide 827

Index

828 IBM(R) Cognos(R) Impromptu(R)

Das könnte Ihnen auch gefallen