Beruflich Dokumente
Kultur Dokumente
entry Type the text for the HTML TOC entry Impromptu Administration Guide
ADMINISTRATION GUIDE
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
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
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
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
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
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
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.
Administration Guide 21
Introduction
Administration Guide 23
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
Administration Guide 41
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.
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.
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
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).
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.
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)
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.
Example
You define Cust-id as the key of the Customer table because there can be only one customer number for each customer.
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.
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.
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
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.
Table D
Table E
Now, tables A and C can only be joined through table B, and the desired path will be used.
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.
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
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.
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.
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, =)
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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 '%,'.
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).
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.
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.
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.
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.
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).
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.
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
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
Administration Guide 71
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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
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.
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
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.
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.
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.
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.
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
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.
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.
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.
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
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.
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).
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.
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).
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
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
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.
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.
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.
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
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
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.
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.
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.
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.
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.
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).
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.
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' ...
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.
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.
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.
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
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
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.
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
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.
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.
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.
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.
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
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.
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.
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.
Tips
To quickly access the Chart properties, right-click the chart and click Properties.
Related Topics
"Choosing a Chart Type" (p. 119) "Format a Chart" (p. 123)
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.
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.
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)
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).
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)
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)
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)
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)
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)
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)
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)
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)
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)
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).
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.
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.
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.
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.
In the Chart Properties dialog, in the Chart type list, click Log.
In the Chart Properties dialog, in the Chart type list, click Tape.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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.
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.
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
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.
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.
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
Y1 Axis: area, bar, bubble, correlation, HLCO, HLO, line, radar, scatter Y2 Axis: area, bar, correlation, line X Axis: bubble, scatter
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
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
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.
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.
Allows you to manually specify the number Series Axis of data series plotted in the chart.
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.
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
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
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.
Direction slider
Specifies the direction in which the depth is applied. This option is not available for bar charts with the True 3D layout.
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
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
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
Rotates the pie chart. Changes the shape of markers. For line and scatter charts, this option is only available if Show Markers is selected.
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
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.
pie
Creates a ring variant of the pie chart. The total of pie all slices is placed in the center.
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
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
Style list
HLCO, HLO
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.
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.
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
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)
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.
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
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.
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 (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
Adds a title to the X Axis of the chart. Only bubble bubble, scatter and scatter charts include an X Axis.
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
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.
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.
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).
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
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.
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.
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.
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
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.
Location
All macro files are in either \installation_location\Samples\Impromptu\Macros or \installation_location\Samples\CogMac.
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
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.
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.
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.
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.
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.
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.
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.
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"] )
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"]]
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.
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)
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.
Related Topics
"View a Report" (p. 181) "View the Details of a Value in a Report" (p. 182)
Example
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)
Step
From the View menu, click Screen Layout or Page Layout.
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)
Tip
Save the report to a folder called my report to keep all related files together.
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.
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.
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)
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.
Related Topics
"Print a List Report With Repeating Columns" (p. 190) "Print a Report" (p. 187)
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.
What if ...
The Fit To Page check box is unavailable?
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)
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.
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?
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)
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
Related Topics
"Attach a Report to Email" (p. 196) "Export a Report to Other Applications" (p. 194) "CSV File Format" (p. 196)
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.
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)
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)
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)
Step
From the File menu, click Send. The report appears as an attachment to a new Microsoft Mail, Exchange, or Outlook message.
Related Topics
"Export a Report" (p. 193)
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)
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.
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.
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.
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.
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)
Related Topics
"Create a Report" (p. 201) "Open a Catalog" (p. 202)
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.
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)
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)
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.
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.
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.
Related Topics
"Create a Report" (p. 201) "Apply a Template to an Existing Report" (p. 247)
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)
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)
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)
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.
Related Topics
"Create a Report" (p. 201)
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.
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)
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)
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)
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)
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.
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)
Example
You remove simple calculations such as totals that become redundant once you create more complex calculations, such as totals by branch and salesperson.
Related Topics
"Add or Remove Data" (p. 211)
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.
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)
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.
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
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.
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
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)
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.
Related Topics
"Group, Sort, or Associate Data in a Report" (p. 215)
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 ...
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)
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.
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)
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.
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
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)
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.
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.
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)
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)
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.
Related Topics
"Filter or Find Data" (p. 221)
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:
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).
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)
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
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)
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)
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.
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)
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.
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)
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.
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)
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.
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)
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.
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.
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)
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)
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.
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)
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)
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.
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.
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)
Steps
1. Select the parts of the report you want to group. 2. From the Format menu, click Group Objects.
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
Related Topics
"Hide, Show, Group or Resize Parts of a Report" (p. 241)
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.
Related Topics
"Hide, Show, Group or Resize Parts of a Report" (p. 241)
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.
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)
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)
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.
Steps
1. From the Report menu, click Apply Template. 2. Locate the template you want and click OK.
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)
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.
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.
Related Topics
"Format a Report" (p. 247)
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.
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)
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.
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)
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.
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)
. (period) , (comma) $
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.
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 @ @* | ""
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).
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.
""
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.
""
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.
""
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:
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.
Related Topics
"Format Data" (p. 253) "Enhance Data Display" (p. 259)
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.
Related Topics
"Format Data" (p. 253) "Justify Data" (p. 258)
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).
Related Topics
"Format Data" (p. 253)
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.
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>
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.
3. From the File menu, click Save. To view the changes to the Currency Symbol list, restart the product.
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)
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.
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)
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.
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.
Example
You show selected data items in boldface and increase the font size of selected text in a header.
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.
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)
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.
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)
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
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)
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:
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.
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.
What if ...
The pointer changes to the following when you move it over the column headers.
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)
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)
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.
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.
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)
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.
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)
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.
What if...
You want to add a title to the list header?
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)
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.
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)
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
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)
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.
Related Topics
"Format a List or Crosstab Report" (p. 267)
Example
You select the Sales Amount column for every sales channel in order to apply formatting. 274 IBM(R) Cognos(R) Impromptu(R)
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.
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)
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)
Snapshots
When you open a snapshot report, the report accesses data stored in a snapshot located on your personal computer.
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.
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.
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)
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.
Chapter 36: Reporting While Disconnected From the Database Snapshot icon
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)
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.
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)
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.
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)
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)
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.
Related Topics
"Drill Through to IBM Cognos Query" (p. 281)
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)
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.
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.
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).
Related Topics
"Create Burst Reports" (p. 285) "Notify the Report Administrator" (p. 286)
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.
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.
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.
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.
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
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)
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)
[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.
Related Topics
"Configuration Files" (p. 293)
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)
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)
[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.
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.
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)
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.
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.
ruler displayed=<setting>
Default Description To change ruler displayed=0 Sets whether to show the ruler. From the View menu, click Ruler.
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.
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.
maximize document=<setting>
Default Description To change maximize document=1 Sets whether to show Impromptu reports as maximized. Maximize or restore a report.
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
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
To change
To change
To change
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.
<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.
Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)
<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.
Example
To change
Related Topics
"Impromptu.ini" (p. 295) "Configuration Files" (p. 293)
[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)
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.
Comprehensive Index
A comprehensive index for the online Help contains keywords for topics within both the online Help files.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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')
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.
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.
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.
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.
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:
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.
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.
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.
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
Chapter 44: Report Data The values appear in the Select values for <data_item> box in the specified order. 4. Click OK.
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.
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.
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.
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).
This prompt enables you to select multiple items from the list using Ctrl+click.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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?
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.
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.
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.
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.
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.
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 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].
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.
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.
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
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].
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.
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.
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.
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).
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).
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
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
4. Click OK to close the Calculation Definition dialog box and if necessary, click OK to close the Data tab (Query dialog box).
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).
Steps
1. Double-click Summaries and double-click Average. 2. Double-click Summaries and double-click Total.
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).
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.
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).
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).
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).
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).
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).
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.
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).
"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.
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).
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.
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
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.
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.
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.
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.
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.
Step
Select one or more report objects and then select the condition to apply from the Condition dialog box (Format menu, Conditional formats).
Step
Move the required conditions in the Condition dialog box (Format menu, Conditional Formats).
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
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
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
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".
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
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
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:
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.
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
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.
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.
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.
Steps
1. Open the template. 2. From the Report menu, click Query. The following Template tab 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.
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.
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.
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.
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.
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.
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.
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
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)
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.
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.
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.
Impromptu adds the data At the position where you clicked the mouse button.
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
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
Text frame
The flashing I-beam appears where you can begin inserting text.
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).
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.
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.
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.
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.
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).
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
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.
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.
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.
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
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.
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"
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.
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
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
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.
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.
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
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.
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.
3. Edit the summarized data item in the Expression box and Click OK.
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.
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.
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).
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
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.
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.
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.
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).
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.
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).
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.
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.
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.
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.
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.
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).
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.
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).
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).
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.
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.
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.
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.
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.
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.
Chapter 46: Complex Reports 6. If you are prompted to save the changes you made, click Yes.
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
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
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
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.
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
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.
(3.25, .25)
(5.5, .25)
(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).
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:
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
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.
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
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
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.
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".
Steps
1. Open a report. 2. Resize or move objects so that none overlap.
Steps
1. Right-click the list frame, and click Properties. 2. In the Name box, type a meaningful name, and click OK.
Steps
1. Select the list frame.
Chapter 46: Complex Reports 2. From the Format menu, click Stacking, and click a stacking command such as Send Back or Bring Forward.
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.
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.
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.
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).
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.
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).
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
TextFrame1
Flowchart
Start
No
Y1=Y2
Yes
No
Y1<Y2
Yes
No
X1=X2
Yes
No
Z1<Z2
Yes
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
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
Text1 Text2
Form Frame1
Text1
Text2 Text1
Form Frame
Text1
Text2
Text1
Form Frame1
Text1
You run a query You open a catalog that points to your view of the data in the database
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.
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.
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.
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).
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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."
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.
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.
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.
Product Type
Recycled Products
Sunblock
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.
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.
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
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.
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.
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.
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.
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.
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
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).
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.
Chapter 49: Optimize Performance in Impromptu Joins are defined by your administrator. For more information about joins, see your administrator.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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)
Example
You can create a macro that shows a list of the five most frequently used reports every time you start Impromptu.
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)
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)
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)
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
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.
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
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.
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
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.
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
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.
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.
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
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.
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
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
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.
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.
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
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.
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.
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
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
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")
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.
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
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
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
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
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.
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.
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
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)
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
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
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)
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.
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.
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
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"
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)
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
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
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
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.
Description Returns the Application object. Returns the number of items 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
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.
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.
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.
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.
Description Returns the Application object. Returns the number of items in the collection. Returns the specified item in the collection.
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.
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)
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.
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.
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
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")
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
Related Topics
"CatalogLevels Property" (p. 619) "DeniedTables Property" (p. 636) "SchemaLevels Property" (p. 690) "UserClasses Property" (p. 702)
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
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)
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
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)
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)
Chapter 55: Methods Add Method "Add Method (TableLinks)" (p. 516) "Add Method (Tables)" (p. 512)
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
Related Topics
"TableLinks Property" (p. 694)
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
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)
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
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
Related Topics
"Items Collection" (p. 500) "Items Property" (p. 663)
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
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)
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")
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
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.
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
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
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
26 25 44 48 6
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
Name multiply not not equal null numeric constant or percentile percentage plus prefilter prompt
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.
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
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.
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]
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)
UsePosition Parameter
Required. Specifies the position of the name of the report query column in the selected report. Type: Integer
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
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
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 _
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)
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
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.
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
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
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
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
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"
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.
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
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.
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.
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
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)
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.
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
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
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
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
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)
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
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
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
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]
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
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
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
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).
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.
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.
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
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.
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.
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.
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
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.
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
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 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 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.
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 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 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.
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.
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
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
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
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
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
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
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
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""]]"
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.
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.
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.
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)
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
Parameters ToPage
Description Optional: Specifies the page number of the last page to print. Type: Integer
Copies
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
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.
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
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")
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)
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
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
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
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
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.
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
Applies To
ReportDocument Object
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
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)
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)
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
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
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
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)
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.
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
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
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.
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
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"
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.
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.
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
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()
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
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
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)
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
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
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
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
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
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)
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
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.
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
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
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
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
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)
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.
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()
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
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
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.
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
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
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
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
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
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
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)
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) & _
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
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
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
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.
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.
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.
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"]
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
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.
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.
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)
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
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.
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
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
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
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
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
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.
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
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
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
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
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)
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
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
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
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
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) & _
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
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
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
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 & " )."
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
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
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
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
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")
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)
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"
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
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
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
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
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.
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
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
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()
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
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.
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.
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()
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
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
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
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
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
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.
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
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.
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
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
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)
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
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
Chapter 57: Sample Macros Change the name and location of the report. Change the name and location of the report in the Publish method.
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.
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.
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, =)
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.
Catalog-User-Profile
Description
Inserts the user class name as set up in the Impromptu catalog.
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
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.
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)
Note
Assume today's date is 03/20/1998.
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)
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)
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)
Note
Assume today's date is 10/20/1998.
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)
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)
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)
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)
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)
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)
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)
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)
Example
daysint-to-ymdint (1998-03-20, 500 00:00:00.000)
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)
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)
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)
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)
Syntax
hour (time_exp | datetime_exp | integer_exp)
Examples
hour (09:10:00.000)
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)
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)
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)
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)
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))
Note
This function is processed only on the database. For local processing, use the Pre50-Months-Between function.
Number-to-Date
Description
Returns the date from an integer.
Syntax
number-to-date (integer_exp)
Example
number-to-date (19980930)
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)
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)
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))
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)
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)
Today
Description
Returns the current date according to the date set on your computer.
Syntax
today ()
Example
today ()
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)
Syntax
year-of-ymd-interval (ymdinterval_exp)
Example
year-of-ymd-interval (1998-03-21 14:42:00.000)
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)
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)
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)
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
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)
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)
Syntax
absolute (numeric_exp)
Examples
absolute (-5.3)
Ceiling
Description
Returns a number rounded to the next highest integer.
Syntax
ceiling (numeric_exp)
Examples
ceiling (-1.23)
Floor
Description
Returns a number rounded to the next lowest integer.
Syntax
floor (numeric_exp)
Examples
floor (-1.23)
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)
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)
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)
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)
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)
Examples
number-to-string-padded (12345, 8)
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)
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)
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)
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)
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)
Sqrt
Description
Returns the square root of a positive number.
Syntax
sqrt (numeric_exp)
Examples
sqrt (2)
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.
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')
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)
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'
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')
First-Word
Description
Returns the first word in a string.
Syntax
first-word (string_exp)
Example
first-word ('Cat sat on the mat')
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)
Lower
Description
Converts uppercase characters to lowercase.
Syntax
lower (string_exp)
Example
lower ('ABCDEFG')
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 ( ! )
or-bar ( | )
Parentheses ( () ) Pound ( # )
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.
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')
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')
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)
Examples
position ('DEF', 'ABCDEF')
Reverse
Description
Reverses the characters in a string.
Syntax
reverse (string_exp)
Example
reverse ('ABCDEF')
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)
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)
Example
spread ('ABC')
String-to-Integer
Description
Returns the integer representation of string_exp.
Syntax
string-to-integer (string_exp)
Example
string-to-integer (' 101 tents')
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')
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.
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)
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)
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 )
Upper
Description
Converts lowercase characters to uppercase.
Syntax
upper (string_exp)
Examples
upper (Auriga)
Quartile Rank Running-Average Running-Count Running-Difference Running-Maximum Running-Minimum Running-Total Standard-Deviation Tertile Total Variance
Average
Description
Returns the average value of selected data items.
Syntax
average (<numeric_exp)
Example
average (Sales)
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)
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)
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.
Minimum
Description
Returns the minimum value of selected data items.
Syntax
minimum (numeric_exp)
Example
minimum (Sales)
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.
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.
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
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)
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
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)
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
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
Qty 7 3 6 4 3 5 4
Note
IBM Cognos Query and Transformer do not support this function.
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
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
Qty 7 3 6 2 4
Chapter 60: Summary Functions Minimum (Qty) for Lastname 3 3 Running-minimum (Qty) for Lastname 4 3
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)
Qty 2 3 6 7 3 5 4
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.
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.
Total
Description
Returns the total value of selected data items.
Syntax
total (numeric_exp)
Example
total (Sales)
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.
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.
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.
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.
Example
Salary not between 40000 and 50000
Impromptu retrieves all the salaries except those that fall between $40,000 and $50,000.
Syntax
Char1 + Char2
Example
FirstName + LastName
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.
Syntax
Value1 [=,<,>,<=,>=] Value2
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
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.
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]
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.
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)
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)
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.
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).
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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
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
Data Intervals
Format d hh:mm:ss.sss
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.
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.
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.
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 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 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.
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.
picture
Any Windows bitmap file (.bmp) or Device Independent Bitmap (DIB) file that is stored in a location your computer can access.
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.
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.
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.
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.
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.
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.
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.
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.
ymdinterval_exp
A year-month-day interval expression.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Index