APPENDIX The .NET Compact Framework
Adapted from Larry Roof's forthcomingApress book, The Definitive Guide to the .NETCompact Framework (ISBN 1-59059-095-3).
MicRosoFr DEVEWPED the .NET Compact Framework (.NET CF) with one intention in mind: to build applications. By applications, I do not mean drivers, COM components, ActiveX controls, or Today screen plug-ins. I am talking about applications that display, gather, process, and forward information-those appli• cations that give users a reason to carry a device. While they typically will have an interface, they do not have to have one. The data that they are working with might be local, remote, or some combination of the two. The .NET Compact Framework simplifies application development on smart devices. Presently this includes the Pocket PC, Pocket PC 2002, Pocket PC Phone Edition, Smartphone, and other devices running Windows CE .NET 4.1 or later.
NOTE Currently you cannot use the .NET Compact Frame• work to develop applications that target the SmartPhone. There will be a Smartphone software development kit (SDK) released later. This SDK will install on top ofVisual Studio .NET and will include a Smartphone emulator.
You will need Visual Studio .NET 2003 to build applications that target the .NET Compact Framework. You can build applications using either Visual C# .NET, Visual Basic .NET, or both. The .NET Compact Framework has two main components: the common lan• guage runtime, or CLR, and the .NET Compact Framework class library. The CLR is the foundation of the .NET Compact Framework. It is responsible for managing code at execution time, providing core services such as memory management and thread management while enforcing code safety and accuracy.
627 Appendix
Code that targets the runtime is known as managed code; code that does not target the runtime, as is the case with eMbedded Visual C++, is known as unmanaged, or native, code. The .NET Compact Framework class library is a collection of reusable classes that you can use to quickly and easily develop applications. This framework was designed with porting in mind, whether to Microsoft or other third-party plat• forms. What does this mean to you? Simply that the coding techniques and the applications you create today to run on a Pocket PC could run on other plat• forms, such as a cell phone or another vendor's PDA, if a version of the .NET Compact Framework was created for that platform.
Common Language Runtime
The common language runtime provides a code-execution environment that manages code targeting the .NET Framework. Code management can take the form of memory management, thread management, security management, code verification and compilation, and other system services. The CLR is designed to enhance performance. It makes use of Just-In-Time (TIT) compiling, which enables managed code to run in the native machine lan• guage of your application's platform. This allows you to create applications that can target a variety of platforms and not have to worry about recompiling or gen• erating executables that target each specific platform. Even though your mobile application is written in VB .NET or C# .NET, and as such is managed code, you are still able to incorporate functions and subrou• tines stored externally in dynamic link libraries (DLLs), including the Windows CE APis. The .NET Compact Framework provides the data types and support for structures to allow you to easily incorporate functions from the Wmdows CE APis into your application.
• NET Compact Framework Class Library
The .NET Compact Framework class library is a collection of reusable classes that tightly integrate with the common language runtime. Your applications leverage these libraries to derive functionality. As you would expect from an object-oriented class library, the .NET Compact Framework types enable you to accomplish a range of common programming tasks, including tasks such as interface design, leveraging XML, database access, thread management, and file 110. The following sections describe the common functionality available through .NETCE
628 The .NET Compact Framework
Form-Related Classes
The .NET Compact Framework implements a subset of the System.Windows.Forms and System.Drawing classes, which allow you to con• struct rich Wmdows CE-based user interfaces for your device applications. The Form Designer within Visual Studio .NET manages much of the interaction with these classes for you. The implementation ofWmForms under the .NET Compact Framework includes support for forms, most controls found in the .NET Framework, hosting of third-party controls, bitmaps, and menus. Table A-I lists the controls included with the .NET Compact Framework.
Table A-1. Controls Included with the .NET Compact Framework
CONTROL DESCRIPTION Button Simple command button CheckBox Common check box ComboBox Drop-down list of times ContextMenu Context-sensitive menu for association with another object DataGrid Grid that can be bound to a data source DomainUpDown List of items that the user can navigate using scroll bars HScrollBar Horizontal scroll bar lmageList Container used to store images, which in turn will be used with other controls such as the ToolBar, ListView, and Tree View
InputPanel Controls the Soft Input Panel (SIP) on Wmdows CE devices Label Simple control that allows you to display text ListBox List of items from which the user can pick ListView Provides four views for displaying data: large icon, small icon, list, and details MainMenu Menu with a form NumericUpDown Numeric input field that allows both manual entry as well as scroll bars
OpenFileDialog Interfaces with the standard Wmdows CE open file dialog box Panel Container used to hold other controls PictureBox Used to display images of a variety of formats (continued)
629 Appendix
Table A-1. Controls Included with the .NET Compact Framework (Continued) CONTROL DESCRIPTION ProgressBar VISual indicator of a task's progress Radio Button Common radio button SaveFileDialog Interfaces with the standard Wmdows CE save file dialog box StatusBar Simple panel for displaying text TabControl Tabbed interface for an application TextBox Standard text input field Timer Basic timing component ToolBar Implements a toolbar on a form TrackBar Slider interface used with numeric data Tree View Presents data in a hierarchical layout VScrollBar Vertical scroll bar
Like everything that is part of the .NET Compact Framework, tile controls included with .NET CF have limited functionality. They are missing properties, methods, and events found in their .NET Framework counterparts. A little coding can correct these shortcomings. That is because .NET CF allows you to create your own controls by inheriting from the base control class. From this foun• dation, you can add your own properties, methods, and events to create just the control you need.
Data and XML Classes
The .NET Compact Framework includes a set of classes that allow you to easily incorporate data, whether it is from a relational or nonrelational data source, and XML content into your mobile applications. These classes are defined under the System.Data and System.Xml namespaces. The implementation of both data and XML classes under .NET CF is a subset of those found in the .NET Framework.
Web Services
The .NET Framework is much about Web services. In the .NET Compact Frame• work System.Web namespace, you have a scaled-down version of the capabilities
630 The .NET Compact Framework and functionality offered in the corresponding .NET Framework namespace. Most significantly, you can create Web service clients, but you cannot host Web services under the .NET Compact Framework. These Web service clients can be either synchronous or asynchronous. Creat• ing a Web service client that targets the .NET Compact Framework is easy. The Visual Studio .NET IDE does much of the work for you.
GDI Support
The .NET Compact Framework provides support for the basic GDI drawing elements including bitmaps, brushes, fonts, icons, and pens through the System.Drawing namespace.
Base Classes
The .NET Compact Framework provides a robust set of base classes that expose a wide range of functionality for use by developers. This underlying infrastructure enables you to write rich .NET applications, including being able to create multi• threaded applications {System. Threading), leveraging networking resources {System.Net), and working with files {System.IO).
IrDA Support
Wmdows CE devices, such as the Pocket PC and Pocket PC 2002, include infrared {IR) communication capabilities. In support of this, the .NET Compact Frame• work includes classes that allow you to leverage IR communication from within your application. These classes are part of the System.Net.IrDA namespace. You can use IR to communicate to Pocket PCs, printers, and other IR-enabled devices.
Bluetooth Support
The .NET Compact Framework does not natively provide support for Bluetooth. You can access most third-party Pocket PC implementations of Bluetooth via either serial port communications or a provider's API.
631 Appendix
Visual Basic Support
Visual Basic .NET makes liberal use of helper functions that are located in a VB Helper library. The .NET Compact Framework includes a subset of these functions as well. These functions are considered by VB developers to be a core part of the language, which is the reason for their inclusion. Ifyou are an existing Visual Basic or eMbedded Visual Basic developer convert• ing over to .NET CF, what this means is that many of the VB language functions you are used to working with will be available to you in Visual Basic .NET.
A La Carte Features
To conserve resources on the target device, Microsoft divided the .NET Compact Framework into logical components. By delivering components as separate DLLs, or, as they are referred to within the .NET Compact Framework, assem• blies, Microsoft gives you the option of picking and choosing the features you need, and only those features that your target device has the space to hold. An example of this is the System.SR assembly, which contains error message strings. Including this j;lssembly with your application allows access to detailed descriptions of any errors encountered, which is certainly helpful during a debugging session, but infrequently needed in an application once it is released to production. Excluding this assembly does not affect the performance or func• tionality of your application; it simply means you will not have access to detailed error messages. Another example of the .NET CF a Ia carte approach is the SQL Server CE components, delivered in a set ofDLLs totaling slightly over 1MB in size. Unless you explicitly add a reference to the System.Data.SqlServerCe assemblies, these DLLs will not be included with your application.
Features Missing from the .NET Compact Framework
Some serious trimming had to be made to the .NET Framework so that it could fit into the operating constraints ofWmdows CE. The most notable .NET Frame• work features that did not make it into the .NET Compact Framework are the subject of this section.
632 The .NET Compact Framework
Method Overloads
Overloading a method provides alternative ways to call that method. It also increases the size of a framework. Because of this, the .NET Compact Framework trimmed the overloads from almost all methods. What this means to you is twofold. First, there is a good chance that a partic• ular method overload you used with a desktop application will not be available under .NET CR Second, when you read the documentation, pay close attention to whether or not a method is supported by .NET CR
Missing Controls
A number of .NET controls did not make their way into the .NET Compact Framework. The absence of most of these controls is insignificant to mobile developers. Since printing has such a limited role in mobile applications, remov• ing the whole family of print-related controls is not an issue. That takes care of the CrystalReportViewer, PageSetupDialog, PrintDialog, PrintDocument, PrintPreviewControl, and PrintPreviewDialog controls. You can replace many of the missing dialog boxes with your own or by accessing system dialog boxes directly using the Wmdows CE API.
XML Functionality
As much as the .NET Compact Framework offers in the way ofXML, an equal amount of functionality was trimmed. The key missing XML-related component is the System.Xml.XPath namespace. The XPath namespace made XML parsing far easier than the methods offered under .NET CR In its absence, you can use a combination of recursive and iterative searches against the Document Object Model (DOM). The .NET Compact Framework is missing another key XML component, Extensible Stylesheet Language Transformation, or XSLT. With XSLT, you can con• vert an XML document into different formats. On an XML-related note, .NET CF does not provide support for developing device-based Web services.
633 Appendix
Database Support
While the .NET Compact Framework offers a robust set of data-related tools, it is not without shortcomings. Support is provided for a single database, SQL Server CE. The .NET Compact Framework does not provide support for Pocket Access databases or other third-party device-based databases. On the server side, the .NET Compact Framework provides support for only SQL Server. The key missing namespace is System.Data.OleDb.
Binary Serialization
Both the BinaryFormatter and SoapFormatter classes are absent from the .NET Compact Framework, severely limiting serializing and deserializing objects.
Access to the Windows Registry
The .NET Framework has the Microsoft.Wm32.Registry namespace, which makes it easy to work with the Wmdows registry from an application. Obviously, this namespace was not included in .NET CF, as it has to do with Wm32, not Wmdows CE. Unfortunately, no Wmdows CE equivalent of this namespace was included in .NET CE As a result, you are forced to turn to the Wmdows API if your application requires access to the Wmdows CE registry.
Leveraging COM Components
The absence of the COM interop is one of the most debated limitations of the .NET Compact Framework. This is particularly true for developers who are switching over from eMbedded Visual Basic, where they were accustom to lever• aging COM objects, including ActiveX controls, to extend their development capabilities. Incorporating COM objects into a .NET CF application is a two-step process. First, you must write an unmanaged (that is to say, eMbedded Visual C++) DLL wrapper that exposes the COM object. Depending upon the complexity of the COM object, this may be anything from a simple to extremely complicated pro• cess. Second, you must use Plnvoke to access your DLL wrapper. Luckily, the development community has already begun work on accessing the more com• monly used COM components, several of which are included in the references at the end of this appendix.
634 The .NET Compact Framework
Security
The .NET Compact Framework does not secure access to unmanaged code. Any application can call any system or nonsystem API. There is no role-based security with the .NET Compact Framework. The principal object has no understanding of known identity or known role.
Web Services
The most notable exclusion from the .NET Compact Framework Web service capabilities is the inability to use cookies. Cookies are widely used to maintain state on the server between calls from a client. While the use of cookies in Web services is not as prevalent as their use on Web sites, they are still in use. The .NET Compact Framework offers limited cryptographic abilities in respect to Web services.
Printing
The .NET Compact Framework provides no support for printing. There is no easy way to interact with either network printers or external printers via IR. The workaround for accessing network printers is to build a server-based application that accepts and prints jobs submitted by your mobile application. You can send output through theIR port directly to IR-enabled printers. You use the System.Net.IrDA namespace to access theIR port of your device. The dif• ficult part is that your application needs to control everything sent to the printer, including any control characters that the printer supports.
GDI+
Wmdows CE natively does not support GDI+, so GDI+-related functionality was removed from .NET Compact Framework.
Remoting
Remoting, that wonderful feature of the .NET Framework that allows you to eas• ily build distributed applications, is, sad to say, missing from the .NET Compact Framework. Now, one could make the case that mobile applications are ideal candidates for remoting. To make matters worse, there is not a good way to code around this limitation.
635 Appendix
Additional Resources
Following is a list of resources for further information on .NET CF:
• Larry Roof's MSDN Magazine article "Develop Handheld Apps for the .NET Compact Framework with Visual Studio .NET" at http: I /msdn. microsoft. com/msdnmag/issues/02/03/NETCF/default.aspx
• Larry Roof's "Smart Device Extensions, SQL Server CE, and Me" at http://msdn.microsoft.com/library/default.asp?url=/library/ en-us/dnroad/html/road05222002.asp
• John Kennedy's "Taking Control with C#" at http: I /msdn. microsoft. com/ library/default.asp?url=llibrary/en-us/dnroad/html/road01082003.asp (and other "Two for the Road" columns at MSDN Online)
• Microsoft Newsgroups:
microsoft.public.dotnet.framework.compactframework
microsoft.public.dotnet.framework.aspnet.mobile
microsoft.public.in.dotnet.compactframework
microsoft.public.smartphone.developer
microsoft.public.pocketpc.developer
microsoft. public. pocketpc (and lots of others such as microsoft.public.pocketpc.wireless)
Focus on SQL Server CE 2.0
Microsoft SQL Server CE 2.0 is downloadable from http: I /'tMW. microsoft. com/ sql/ eel downloads/20readme. asp. (Free registration is required-the download is 47.6MB.) Note that it requires Windows XP or 2000 or higher for development. More specifically, you need
• An liS system running under NT4/SP5 or later orWmdows 2000 to do an RDA or replication
• Wmdows 2000 or Wmdows XP for the development system
636 The .NET Compact Framework
• AWmdows CE-based device runningWmdows CE 4.1 for deployment (though you can develop and test apps using the emulators that are included both in Microsoft's free eMbedded Visual Tools 3.0 or the not free Visual Studio .NET and the .NET Compact Framework)
For unmanaged (native) applications (which can run on Pocket PC 2000, Pocket PC 2002, Pocket PC Phone Edition, Handheld PC 2000 [HP/C 2000], and certain other embedded devices that use Windows CE 4.1), you'll use Microsoft eMbedded Visual Tools 3.0 installed with at least one of the following software development kits: Palm-size PC SDK, Handheld PC Pro SDK, or Pocket PC SDK for native (unmanaged) application development. To create Microsoft .NET Compact Framework (managed) applications (which can run on Pocket PC 2000, Pocket PC 2002, Pocket PC Phone Edition, and certain other embedded devices that use Wmdows CE 4.1), you'll need Visual Studio .NET and the .NET Compact Framework (ideally, the just-released 1.1 "Everett" edition). Both development environments have emulators in case you don't have a physical device running CE 4.1. Side-by-side installations of this release ofSQL Server CE 2.0 with earlier versions of SQL Server CE are supported. Download the documentation from http: I /www. microsoft. com/ sql/ ce/techinfo/20bol.asp. Ifyou use SQL Server CE, you must update the server replication compo• nents on servers running Internet Information Services (liS) when you install SQL Server 2000 Service Pack 2 (SP2). Download this package to make sure your operating environment is up to date. SQL Server CE 2.0 Readme (http: I I support. microsoft. com/default. aspx?scid=kb;en-us;Q327957) describes additional info that didn't make it into the SQL Server CE 2.0 documentation. For example, Pocket PC 2000 Service Packl (http://support.microsoft.com/defau1t.aspx?scid=http://www. microsoft.com/mobile/pocketpc/downloads/servicepackl.asporhttp:// www.compaq.com/support/files/handhelds/us/download/9820.htmlforiPAQ users) is required for Integrated Security.
637 Index
Special Characters event firing, grouping, and summary : [colon), 469 fields, 288-89 {} (curly braces), 469 exporting data, 302-4 <%%>(delimiters), 271 free-form text reports, 297-300 %(percent sign), 76, 184 HTTP handlers, 499 "" (quotes), 470 labels, 294-97 ; (semicolon), 470 licensing, 291 " (single quotes), 25 MemoryStream objects, 499-500 page and print settings, 287-88 A Runtime Designer control, 304-5 Access, 335-66 standard columnar reports, 291-94 calling reports from Visual Basic or subreports, 300 VBA,354-56 text box padding, 285 changing report data sources, 351 Viewer control, 290 converting reports, to ActiveReports Web reports, 497-500 for .NET, 285-86 WebViewer control, 497-99 converting reports, to ActiveReports ActiveReports for VB6, 235-80 forVB6, 237-38 components and versions, 235-36 creating PDF reports, 363-64 converting Access and Crystal creating reports, 335-45 Reports reports, 237-38 crosstab reports, 391-92 creating reports, 236-37, 256-68 Distiller printer driver, 363-64 crosstab reports, 404-11 for Pocket PC, 600 data connections, 238-42 report events, 346-48 drill-down feature, 273-74 report events within report sections, eventfiringsequence,246-47 348-50 exporting data, 276-79 report filters, 351-52 free-form text reports, 265-68 reporting concepts, 364-66 grouping and summary fields, 24 7-52 ReportML,356-63 Knowledge Base, 237 report sections, 345-46 labels, 260-64 report snapshots, 363 licensing,235,237,280 report sort orders, 352-53 page and print settings, 242-46 subreport controls, 345 Property List control, 255-56 T-SQL,22 Runtime Designer control, 280 using same report for summary and shading and graphics, 274-75 detail data, 353-54 SpreadBuilder object, 277-79, 333 Acrobat. See Adobe Acrobat standard columnar reports, 256-60 activePDF, 384 subreports, 268-71 ActiveReports for .NET, 281-305 table of contents, 252-54 bookmarks (table of contents), unbound reports, 271-73 289-90 Viewer control, 254-55 converting Access and Crystal Web reports, 490-97 Reports reports, 285-86 Active Server Pages. See ASP (Active creating reports, 283-85, 291-300 Server Pages) crosstab reports, 411-18 ActiveXAutomation, 111,113,307 data connections, 286-87 ActiveX controls, 441-42,490 development environment, 281-82 ActiveX DLL/EXE reports, 485-89 drill-down feature, 300-302 Active XL ReportPro, 333-34
639 Index
ADO (ActiveX Data Objects), 63--69. See Command classes, 595-98 also database access; ADO Connection classes, 592-95 MD technologies DataReader classes, 598--600 ActiveReports and, 238-39 features, 589 ADO.NET vs., 68-69 (see also gathering data, 603-4 ADO. NET) Pocket Access and, 600 Command objects, 64--65 SQL Server CE provider, 591-92 Connection objects, 63--64 SQL Server provider, 590-91 Crystal Reports 9 and, 125 System.Data namespace, 590-92 passing Recordsets to Crystal Reports Advanced Transact-SQLfor SQL Server 9,140-48 2000,63 Recordset objects, 66--68 aesthetics, report, 3-5, 12 Adobe Acrobat, 377-84 aggregate functions, SQL, 40-43 Access PDF reports, 363-64 AS clause and, 40-41 alternatives, 384 AVG,43 books,384 COUNT,41-42 converting existing documents, MIN and MAX, 43 378-81 mixing,44 displaying documents in appli• restricting record access, 42 cations, 381-84 SUM,43 licensing, 377-78 aliases, table, 51,54 online Web document conversion, Analysis Services, SQL Server, 427, 381 428-29 PDF files and, 377-78 anchor tag , HTML, 477, 550-51 Reader, Writer, and Distiller, 377 AND operator, SQL, 32-33 Adobe Acrobat 5 PDF Bible, 384 ANSI SQL-92 join syntax, 55-56 Adobe Acrobat 5: The Professional User's Application objects, 310,335,354 Guide,384 applications Adobe Distiller, 363--64, 377, 378 client vs. server-based, for Web ADOCE,590 reports, 441-42 ADO MD technologies, 429-39 Crystal Enterprise licensing and connecting to OIAP databases with server-based, 525-26 VB6,436-39 desktop vs. Pocket PC, 602, 609, 613, connecting to OIAP databases with 620 VB .NET, 439-40 displaying documents in, 381-84 cubes as DataSets, 429 .NET Compact Framework, 627 MDP and TDP providers, 429-30 Palm (see Palm reporting) MDX (multidimensional Pocket PC (see Pocket PC reporting) .expressions), 430-36 sample (see sample applications) ADO. NET, 68-74. See also database ApressWeb site, 7, 104, 127, 142,202, access 209,232,277,367,397,476, ActiveReports for .NET and, 286-87 601,608,613,620 ADO vs., 68--69 (see also ADO (ActiveX APS (Automated Process Server), Crystal Data Objects)) Enterprise, 519-20 Command objects, 69-74 ARConsulting, 17-19 connecting to OIAP databases, 439-40 arrays Connection objects, 69 control, 78,81-82,94 DataReader objects, 72-74 VS-View array-based reports, for .NET Compact Framework (see 195-202,397-99 ADO.NET for .NET Compact ASCII file export Framework) Preview, 232 passing data to Crystal Reports for VS-View, 206 Visual Studio .NET, 154-56 Web services, 516-18 ADO.NET and ADO Examples and Best AS clauses, SQL, 29-30, 40-41 Practices for VB Programmers, ASMXfiles, 518 63 ASP (Active Server Pages). See also ADO.NET for .NET Compact ASP. NET Framework,589--600 ActiveX DLLs/EXEs and, 485-89 ADOCE vs., 590 COM components and, 485
640 Index
HTML reports, 473-81 (see also Internet Explorer as market standard, HTML (Hypertext Markup 446 (see also Internet Language) reports) Explorer) posting, 452-54 Palm,540,550,564 PQAs and, 566--69, 574 PocketiE,601-2,606 pros and cons of classic report deliv• ReportML files and, 357 ery,456-57 styles and, 468-69 ASP. NET unknown tags and, 472 criteria screens, 505-15 (see also cri• URL length limits, 443 teria screens, Web) DataGrid control reports, 500-505 c Web reports, 500-518 (see also Web calculated members, OLAP, 428 reports candidate keys, 47 Web services, 515-18 Cartesian joins, 50 attachments, e-mail disclaimer, cascading style sheets, 468-73 374-75 case, UPPER function and,38-39 attributes, XML, 358 case-sensitive naming, SQL, 25 audit trail tables, 2-3 Catalog object, OLAP, 438-39 Autolncrement properties, 47 CDATA (character data), XML, 358 Automated Process Server (APS), Crystal Certicom, 543 Enterprise, 519-20 Chart Wizard Automation Server, RDC, 112-16 Access, 336 AutoReport features, Access, 336 Excel,327 availability, report, 15-16 check boxes Avery labels, 184, 225 criteria screens and, 76 AVG function, SQL, 43 JavaScript, 446, 505-6 axis rowsets, OLAP, 430 VB6,88-89 checks,3 B CHILDREN keyword, MDX, 433-34 bandwidth, 564 class attribute, CSS, 470-71 Base64 encoding, 516-18 classes. See object models base classes, .NET Compact Framework, class library, .NET Compact Framework, 631 627,628-32 baud rate, Palm, 573 class wrappers, 78-81,94 BETWEEN clauses, SQL, 36-37 clients. See also servers binary serialization, .NET Compact client-side validation, 76 Framework, 634 Web Clipping and, 542-43 bins. See paper bins Web report applications, 441-42 Bluetooth support Clipper browser, Palm, 542, 550 .NET Compact Framework, 539, 631 code Palm,539 adding, to Pocket PC applications, Pocket PC, 619 586 bookmarks, ActiveReports for .NET, managed and unmanaged, 580 289-90 printing Pocket PC reports with, 607 books Code Centric: T-SQL Programming with Acrobat, 384 Stored Procedures and Excel, 334 Triggers, 62 Outlook, 370 Code Warrior, 539 SQL,62-63 Code window, 586 Word,322 collections, control, 95-96 borders, Preview, 219-22 colon(:), 469 bound reports, 238. See also data con• color, 12, 465, 560-61 nections; data sources COLSPAN command, 462-64 breakpoints, 589 columnar reports browsers Access, 336, 337 ActiveX controls and, 490 ActiveReports for .NET, 283-85, Crystal Reports RDC object, 112 291-94 fonts,464 ActiveReports forVB6, 236-37, HTML compatibility, 441-42 256--60
641 Index
columnar reports (Continued) ActiveReports for VB6 Runtime Crystal Reports 9, 122-26 Designer control, 280 HTML,457-58 ActiveReports for VB6 Viewer, 254-55 Preview, 212-14 ActiveX, 441-42, 490 VS-View, 160--65,178--80 ASP.NET DataGrid, 500-505 VS-View snaked column, 188-94 criteria screen, 75 VS-View variable length columns, Crystal Reports Embeddable 194-202 Designer Control, 135-37 Word, 310, 313 CrystalReportsViewer, 150-51 column concatenation, SQL, 29-30 device-specific, 581 combo boxes grid, 330-34 criteria screens, 75, 76 HTML,446 VB6,87-88 JavaScript, 446 COM components Java Viewer control, 490 ActiveX DLL/EXE reports, 485-89 .NET Compact Framework, 585, ADO MD technologies, 429-39 (see 629-30,633 also ADO MD technologies) RichEdit, 265-68 COM drivers and Crystal Reports, RichTextBox,297-300 145-48 VB6, 77-82 COM interop and, 429, 439, 634 VS-View, 202-4 .NET Compact Framework, 634 converting documents to PDF files, command line 378-81 running PQAs from, 556-57 converting reports specifying criteria for Report CE, 623 to ActiveReports for .NET, 285-86 Command objects to ActiveReports forVB6, 237-38 AD0,64-65 cookies ADO.NET, 69-74 .NET Compact Framework and, 635 ADO.NET for .NET Compact Web Clipping and, 544 Framework,595-98 Copilot, 537 comments,HTML,554 copyright, 15 common language runtime (CLR), .NET correlated subqueries, SQL, 57-58 Compact Framework, 627-28 COUNT function, SQL, 41-42 ComponentOne, Inc., 159, 184, 235, 580. criteria, report, 10-11 See also Preview for .NET; criteria pages, 2 VS-View for Visual Basic criteria screens, 75-107 compiling, Just-In-Time (JIT), 628 building SQL WHERE clauses, 89-94, Compressed Markup Language (CML), 102-6 564 data-driven programming, 77-82, concatenation, SQL column, 29-30 94-97 Connection objects. See also data con- user interface considerations, 75-76 nections VB6, 77-94 AD0,63-64 VB .NET, 94-106 ADO.NET,69 Web (see criteria screens, Web) ADO.NET for .NET Compact criteria screens, Web, 442-56 Framework,592-95 ASP.NET, 505-15 connection pooling, 63, 67 dynamic, 449-56 connections. See data connections Internet Explorer as market standard, constant values 446 ActiveReports, 250 JavaScript check boxes, 446 VS-View, 167-69,171,205 passing parameters, 442-45 controls SQL injection security, 444-45 Access report, 342-43 URL length limits, 443 Access subreport, 345 Web site help, 442 ActiveReports for .NET Runtime cross joins, 50 Designer, 304-5 Crosstab Query WIZard, 392 ActiveReports for .NET Viewer, 290 crosstab reports, 327, 385-423 ActiveReports for .NETWebViewer, Access, 391-92 497-99 ActiveReports for .NET, 411-18 ActiveReports for VB6 Property List, ActiveReports for VB6, 404-11 255-56 crosstab SQL, 385-96
642 Index
Crystal Reports, 419-23 exporting data, 153 dynamic date ranges, 406-7 integrating RPT reports, 149 Excel PivotTables and, 386-90 passing ADO.NET data directly to, Oracle, 395-96 154-56 printing, 396 passing parameters, 152 SQL Server 2000, 392-95 ReportDocument objects, 149-50 types of, 385-86 viewing reports, 150-51 VS-View/Preview, 396-404 CrystalReportsViewer controls, 150-51 zero-sum rows and columns, 396 cubes, OLAP Crystal Decisions, 109, 111, 519, 524-29, as DataSet objects, 429 580 dimensions and, 426-29 Crystal Enterprise 8.5, 519-24 curly braces ({}), 469 alternatives, 528-29 cursor position, VS-View, 172 Crystal Reports 9 and, 109, 519 (see cursors,firehose,66-67, 72 also Crystal Reports 9) licensing, 524-29 D report servers and, 526-28 data. See also database access nwnndngreports,519-23 connections (see data connections) scheduling reports, 523-24 data-driven programming (see data- server-based applications and, driven programming) 525-26 derived, 271 Web site, 442 exporting (see also exporting) Crystal Reports 8.5: The Complete external, 14 Reference, 529 multidimensional, 424-26 Crystal Reports 9, 109-57 .NET Compact Framework, 630 advanced dynamic report creation, parameters (see parameters) 127-35 XML (see XML (Extensible Markup cons, 110-11 Language)) converting reports to ActiveReports, DataAdapter objects, ADO.NET, 237-38,285-86 154-56 crosstab reports, 419-23 database access, 63-74. See also SQL Crystal Enterprise and, 109, 519 (see (Structured Query Language) also Crystal Enterprise 8.5) Access (see Access) Crystal Reports for Visual Studio .NET AD0,63-69 vs., 148 (see also Crystal ADO.NET, 68-74 Reports for Visual Studio ADO.NET for .NET Compact .NET) Framework,589-600,603-4 dynamic report creation, 120-27 Crystal Reports repository, 117-20 Embeddable Designer Control, .NET Compact Framework, 634 135-37 OLAP (seeOLAP (online analytical exporting data, 138-40 processing)) headers, 11 OLTP vs. OLAP, 423-24, 436 licensing,111,126-27,135,525,530 Oracle (seeOracle) object model, 111-12, 121-22 passing ADO.NET data to Crystal passing ADO recordsets directly to, Reports for Visual Studio 140-48 .NET, 154-56 pros,109-10 passing ADO Recordsets to Crystal ROC Automation Server, 112-16 Reports 9, 140-48 ReCrystallize Pro and, 529-33 restricting record access, 3, 42 report designers vs. RPT files, 112 SQL Server (see SQL Server 2000; SQL repository, 117-20 ServerCE) runtime,111 data connections. See also data sources Section Format event, 134-35 ActiveReports for .NET, 283-84, versions, 109 286-87,291-92 Web services, 518-19 ActiveReports for VB6, 238-42 Crystal Reports for Visual Studio .NET, AD0,63-64 148-56 ADO.NET,69 crosstab reports, 419-23 ADO.NET for .NET Framework, Crystal Reports 9 vs., 148 (see also 592-95 Crystal Reports 9) Crystal Reports 9, 125, 129-30
643 Index
data connections (Continued) detail data, Access report, 353-54 Crystal Reports crosstab report, 420 devices. See also drivers DataReader objects and, 72 Web Clipping device capabilities, pooling, 63-67 554-55 VB6, to OLAP databases, 436--39 device profiles, 581 VB .NET, to OLAP databases, 439-40 printers, 13, 619 (see also printer Data Control Language (DCL), 24, 62 selection) Data Definition Language (DDL), 24,62 smart, 580, 627 data-driven programming VS-Vievv Devices property, 172 VB6, 77-82 DHTML (dynamic HTML), 457 VB .NET, 94-97 dictionary prints, 12 Data Dynamics, 235,237, 256, 580. See dimensions, OLAP, 426--29 also ActiveReports for .NET; disclaimers ActiveReports forVB6 e-mail, 374-75 DataGrid control, 500-505 report, 15 paging, 505 disconnected DataSets, 72 reports, 500-503 Distiller printer driver, 363-64, 377, 378 sorting, 503-4 DISTINCT clauses, SQL, 37-38, 41 Data Manipulation Language (DML), 24. distribution, report, 2, 15-16,366. See See also SQL (Structured also e-mail; Web reports Query Language) DML (Data Manipulation Language), 24. DataReader objects See also SQL (Structured ADO.NET, 72-74, 154,286--87 Query Language) ADO.NET for .NET Compact Document objects, 310 Framevvork,598-600 documents DataSet objects Office XP (see Office XP) DataTable objects and, 68-69 paging HTML report, 482-85 OLAP cubes as, 429 security, 3 passing, to Crystal Reports for Visual XML (see XML (Extensible Markup Studio .NET, 154-56 Language) data sources. See also data connections document type definition (DTD), 359, Access report, 344-45,351 361 COM drivers for Crystal Reports, drill-dovvn feature 145-48 ActiveReports for .NET, 300-302 DataTable objects, 68-69 ActiveReports forVB6, 253-54, date and time pickers, Palm OS, 558-59 273-74 date manipulation, SQL, 32 ASP and HTML reporting, 457, 476 date ranges design and, 10 criteria, 75-76 Excel PivotTable crosstab reports, 390 design and, 11 drivers. See also devices dynamic, for crosstab reports, 406--7 COM, 145-48 VB .NET, 98-99 printer, 159, 363-64, 377, 378 DBMSs. See database access DSR files, 236, 280 DCL (Data Control Language), 24,62 dumps. See exporting DDL (Data Definition Language), 24, 62 duplicates, eliminating, 37-38 debugging Pocket PC applications, 581, dynamic controls, 81-82 588-89 dynamic criteria screens, 77, 114-16, Definitive Guide to Excel VBA, 334 449-56,505-15 Definitive Guide to the .NET Compact dynamic crosstab reports, 386, 394-95 Framework, 579 n.1, 627 dynamic date ranges deploying Pocket PC applications, 581, crosstab report, 406--7 586-88 VB .NET criteria screen, 98-99 derived data, 271 dynamic report creation DESCENDANTS function, MDX, 434-35 ActiveReports,256-64,291-97 DESC keyword, SQL, 26, 27 Crystal Reports, 120-34 design, report. See report design designers, report. See report designers E Design Vievv, Access, 335, 340-45 efficiency. See also performance desktop applications vs. Pocket PC appli- Excel crosstab reports, 390 cations,602,609,613,620 high-volume printing, 13
644 Index
report,4 equi-joins, SQL, 51 SQL,62 error message strings, 632 eFinder PQA, 541 Essbase,385,424 elements, XML, 358 Ethernetconnections,588,619 e-mail, 366-76 events disclaimers, 374-75 Access report, 346-50 Lotus Notes, 370-74 ActiveReports for .NET, 288-89 Outlook, 367-70 ActiveReports forVB6, 246-47, Palm applications, 546, 553 249-51 Report CE reports, 624-25 Crystal Reports, 134-35 reporting and, 366 VB .NET handlers, 96-97 setup forms, 375--76 Excel, 322-34 Embeddable Designer Control, Crystal ActiveReportsexport,277 Reports, 135-37 ASP export, 457 eMbedded VISual Tools, 637 books, 334 emptystrings,30-31 Crystal Reports 9 export, 140 emulators efficiency, 390 Palm, 537-40 graphing,327-30 Pocket PC, 581, 587 grid dumping, 330-34 encryption, Web Clipping, 543 PageSetup objects, 309-10 End of Report phrase, 2 PivotTable crosstab reports, 386-90 enterprise reports Preview export, 232 ActiveReports forVB6 and .NET (see spreadsheetexport,322-27,387 ActiveReports for .NET; third-party alternatives, 333-34 ActiveReports for VB6) VS-View export, 206-9 Adobe Acrobat and, 377-84 Excel2002 VBA Programmer's Reference, aesthetics, 3-5 334 criteria screens (see criteria screens) ExecuteReadermethod,72 crosstab reports (see crosstab ExecuteScalar method, 73-74 reports) ExecuteXMLReader method, 74 Crystal Reports (see Crystal EXE files, Crystal Reports, 112 Enterprise 8.5; Crystal Reports exporting. See also parameters 9; Crystal Reports for Visual Access ReportML files, 356-63 Studio .NET) ActiveReports for .NET, 302-4 database access, 63-74 (see also data- ActiveReports for VB6, 276-79 base access) ASPand,457 design, 9-16 Crystal Reports 9, 138-40 e-mail and, 366 (see also e-mail) Crystal Reports for Visual Studio evolution of, 1-2 .NET, 153 international considerations, 6-9 Excel grid dumping, 330-34 .NET Compact Framework and, Excel spreadsheet export, 322-27, 627-38 387 Office XP (see Office XP) Preview, 232 online analytical processing (OLAP), reporting and, 12-13 423-40 (see also OLAP (online VS-View, 205--9 analytical processing)) Extensible Markup Language. See XML for Palms (see Palm reporting) (Extensible Markup for Pocket PCs (see Pocket PC report• Language) ing) external data, 14 Preview for .NET (see Preview for external style sheets, 471-72 .NET) reporting issues, 1-20 F report servers, 16-20 FarPoint Technology, 83, 102 security, 2-3 feature attributes, OLAP, 426 SQL (see SQL (Structured Query Fergus, Dan, 579 n.l Language)) fields, Access subreport linking, 345 VS-View for Visual Basic (seeVS-View fields, summary. See summary fields for Visual Basic) Field Software, 601, 607, 619, 636 Web reports (see Web reports) File Repository Service (FRS), Crystal entities, XML, 358 Reports, 520
645 Index
files FROM clauses, SQL, 24-25, 55-56 ASMX,518 functions, SQL, 38-40 CSS,468-73 aggregate,40-43 Palm formats, 541 mixing aggregate, 44 PDF (see PDF files) search performance and, 39 PQA (see PQAs (Palm Query Applications)) G RDF, 490-91 GDI+ support, .NET Compact ReportML,356-63 Framework, 635 RPT, 110, 112, 143, 149, 520 GDI support, .NET Compact RPX and DSR, 236, 237-38, 280 Framework, 631 RTF, 187-88, 265-68, 297-300 GetLocallnfo API function, 6-8 saving Pocket PC reports in, 605 GET method, 443, 444 temporary, 489 global formatting, VS-View, 163 TTX, 141-42 graphics VB6 FRM, 77-78 ActiveReports for .NET export, 304 filters ActiveReports forVB6, 274-75 Access report, 351-52 .NET Compact Framework support, ActiveReports subreport, 269-71 631,635 criteria screens (see criteria screens) PQA, 551, 560 Report CE, 621-22,623 Preview, 231-32 firehose cursors, 66-68, 72 VS-View, 204 fonts. See also styles graphing, Excel, 327-30 aesthetics and, 3-5 grid dumping, Excel, 330-34 browsers and, 464 GROUP BY clauses, SQL, 38, 44-45 Pocket PC application, 617 grouping footers, report Access report, 346, 350 Access,345-46,350 ActiveReports for .NET, 288-89 ActiveReports subreport, 268 ActiveReports forVB6, 247-51 Crystal Reports 9, 133 Guru's Guide to Transact-SQL, The, 62 Preview, 222 VS-View, 176-77 H foreign keys, 47-49 handheld devices. See Palm reporting; format files, label, 184 Pocket PC reporting formatting Handles keyword, VB .NET, 96-97 Access,348,349,350 HAVING clauses, SQL, 45-46 Crystal Reports, 134-35 headers, report Palm Clipper, 550 Access,345-46,350 Pocket PC HTML reports, 604-5 ActiveReports subreport, 268 reports, 1-2 Crystal Reports 9, 130-31 VS-View, 163, 164 design and, 11-12 Form_Load event, 97,237 Preview, 222 forms VS-View, 176-77 e-mail setup, 375-76 "Hello, World!" PQA, 548-50 .NET Compact Framework classes, help files, criteria screen, 83 629-30 help resources. See books; Palm PQA, 553-54 KnowledgeBase; MSDN Pocket PC applications, 584-85 (Microsoft Developers preprinted, 13 Network); Web sites special variables in Web Clipping, Hewgill, Greg, 537 554-59 Hewlett-Packard, 580 VB6 criteria, 77,82-89 hierarchies, 59-62 forward-only cursors, 66-68, 72 hierarchy, OLAP, 427 free-form text reports. See also mail high-volume printing, 13-14 merge reports horizontal scrolling, 569 ActiveReports for .NET, 297-300 HREF attribute, HTML, 477-78 ActiveReports forVB6, 265-68 HTML (Hypertext Markup Language) Preview, 227-31 reports, 456-85 VS-View, 184-88 ASP, 473-81 FRM files, VB6, 77-78 browser fonts, 464
646 Index
cascading style sheets, 468-73 Java Viewer control, 490 check boxes and controls, 446 Joe Celko's SQLfor Smarties: Advanced CMLvs.,564 SQL Programming, 62 comments and PQAs, 554 joins, SQL, 46-62 documentpaging,482-85 correlated subqueries, 57-58 dynamic criteria screens, 445-56 Crystal Reports 9, 129-30 dynamic (DHTML), 457 Crystal Reports crosstab report, 421-22 features missing in Web Clipping, inner, 51 543-44 n-level trees, 59-62 JavaScript, 466-68 older syntax, 55-56 passing parameters, 442-45 outer, 52-54 for Pocket PC, 601-7 primary keys, foreign keys, and rela- pros and cons of classic, 456-57 tionships, 47-49 snaked column reports, 4 77 self, 54-56 table of contents, 477-81 subqueries, 56-57