This document discusses using Excel for reporting purposes by connecting it to a database using ActiveX Data Objects (ADO). It provides an overview of ADO basics like using connection and recordset objects to retrieve and manipulate data. The document then covers building reports programmatically in Excel/VBA by inserting row/column headers from database tables, retrieving data blocks using SQL queries, and applying formatting/styles. The goal is to automate report generation while storing transactional data in a proper database for audit trails, security, and referential integrity.
Microsoft Information Protection Implementation using C# and PowerShellAditya Sharma
This document discusses programmatically applying Azure data classification labels to Excel, Word, and PDF files during their creation in C#. It provides code samples for creating files of each type, calling a PowerShell command to label the files using the Set-AIPFileLabel cmdlet, and passing the file path and label ID as parameters. It also describes manually creating document templates with default classifications that can be used in the code.
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Amanda Lam
** This workshop was conducted in the Hong Kong Open Source Conference 2017 **
Excel formulas can be quite slow when you're processing data files with thousands of rows. It's also especially difficult to maintain the files when you have some messy mixture of VLOOKUPs, Pivot Tables, Macros and VBAs.
In this interactive workshop targeted for non-coders, we will make use of SQLite, a very lightweight and portable open source database library, to perform some simple and repeatable data analysis on large datasets that are publicly available. We will also explore what you can further do with the data by using some powerful extensions of SQLite.
While SQLite may not totally replace Excel in many ways, after the workshop you will find that it can improve your work efficiency and make your life much easier in so many use cases!
Who should attend this workshop?
- If you're frustrated with the slow performance of Excel formulas when dealing with large datasets in your daily work
- No coding experience is required
The document compares and summarizes the key differences between Microsoft Excel 2007, 2010, and 2013. Excel 2013 focuses on collaboration, data analysis and visualization. It introduces features like FlashFill for auto-completing data entry and recommended pivot tables and charts. Excel 2010 introduces the ribbon interface, backstage view, sparklines, slicers and the PowerPivot add-in for large data analysis. It also includes version recovery, protected view and trusted documents features. Both 2010 and 2013 allow accessing Excel files online through the Excel Web App.
1. The document provides an overview of basic Oracle financial functions including journal entries, document numbering, budgets, accounts payable, accounts receivable, and more.
2. Key functions of Oracle General Ledger include recording journal entries from other modules, assigning categories and sources to journal entries, and maintaining journals in batches.
3. The document describes how to enter journal entries including assigning document numbers, categories, periods, and reversal information. It also covers submitting journal batches for approval and entering journals for prior periods.
This document provides information about an inplant training program offered by KAASHIV INFOTECH in Chennai, India. It outlines 5-day training schedules for students of CSE/IT/MCA and ECE/EE/EIE focused on topics like Big Data, cloud computing, CCNA, ethical hacking, and MATLAB. It also lists a 5-day training schedule for mechanical/civil engineering students and provides contact information for the training program.
Constraints are the rules enforced on the data columns of a table. These are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the database.
Constraints can be divided into following two types:
Column level constraints : limits only column data
Table level constraints : limits whole table data
Aggregate Functions
Microsoft Information Protection Implementation using C# and PowerShellAditya Sharma
This document discusses programmatically applying Azure data classification labels to Excel, Word, and PDF files during their creation in C#. It provides code samples for creating files of each type, calling a PowerShell command to label the files using the Set-AIPFileLabel cmdlet, and passing the file path and label ID as parameters. It also describes manually creating document templates with default classifications that can be used in the code.
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Amanda Lam
** This workshop was conducted in the Hong Kong Open Source Conference 2017 **
Excel formulas can be quite slow when you're processing data files with thousands of rows. It's also especially difficult to maintain the files when you have some messy mixture of VLOOKUPs, Pivot Tables, Macros and VBAs.
In this interactive workshop targeted for non-coders, we will make use of SQLite, a very lightweight and portable open source database library, to perform some simple and repeatable data analysis on large datasets that are publicly available. We will also explore what you can further do with the data by using some powerful extensions of SQLite.
While SQLite may not totally replace Excel in many ways, after the workshop you will find that it can improve your work efficiency and make your life much easier in so many use cases!
Who should attend this workshop?
- If you're frustrated with the slow performance of Excel formulas when dealing with large datasets in your daily work
- No coding experience is required
The document compares and summarizes the key differences between Microsoft Excel 2007, 2010, and 2013. Excel 2013 focuses on collaboration, data analysis and visualization. It introduces features like FlashFill for auto-completing data entry and recommended pivot tables and charts. Excel 2010 introduces the ribbon interface, backstage view, sparklines, slicers and the PowerPivot add-in for large data analysis. It also includes version recovery, protected view and trusted documents features. Both 2010 and 2013 allow accessing Excel files online through the Excel Web App.
1. The document provides an overview of basic Oracle financial functions including journal entries, document numbering, budgets, accounts payable, accounts receivable, and more.
2. Key functions of Oracle General Ledger include recording journal entries from other modules, assigning categories and sources to journal entries, and maintaining journals in batches.
3. The document describes how to enter journal entries including assigning document numbers, categories, periods, and reversal information. It also covers submitting journal batches for approval and entering journals for prior periods.
This document provides information about an inplant training program offered by KAASHIV INFOTECH in Chennai, India. It outlines 5-day training schedules for students of CSE/IT/MCA and ECE/EE/EIE focused on topics like Big Data, cloud computing, CCNA, ethical hacking, and MATLAB. It also lists a 5-day training schedule for mechanical/civil engineering students and provides contact information for the training program.
Constraints are the rules enforced on the data columns of a table. These are used to limit the type of data that can go into a table. This ensures the accuracy and reliability of the data in the database.
Constraints can be divided into following two types:
Column level constraints : limits only column data
Table level constraints : limits whole table data
Aggregate Functions
The document describes how to build a Movie List application using ASP.NET MVC and Entity Framework Core by explaining how to set up the model classes, controllers, views, and database context to display, add, edit and delete movie data, relating movies to genres and making the URLs more user-friendly. It provides code examples for each part of the application.
Generate Excel documents with Rational Publishing Engine 1.1.2 and Reporting ...GEBS Reporting
Integrating IBM Rational Publishing Engine 1.1.2 with Reporting Arena Excel Converter to generate documents from various IBM Rational tools in MS Excel format.
The document provides an overview of SQL and database evolution. It discusses:
1) The evolution of databases from early technologies like punched cards to modern relational database management systems (RDBMS) introduced by Ted Codd in 1970.
2) Codd's 12 rules for RDBMS.
3) The different languages used in SQL - DDL for definitions, DML for manipulations, DQL for queries, DCL for controls, and more.
4) Examples of key SQL statements like CREATE TABLE, INSERT, UPDATE, DELETE, ALTER TABLE, CREATE INDEX, and SELECT.
Query Analyser , SQL Server Groups, Transact –SQLKomal Batra
The document provides information about SQL Server Query Analyzer, including how it can be used to design and test Transact-SQL statements, create queries and scripts to execute against databases, and debug stored procedures and query performance. It also discusses SQL Server groups which are used to organize server instances, and how to register server instances to a group. Finally, it provides a brief overview of Transact-SQL and cursors in T-SQL.
The document describes Excel Power User training courses that teach intermediate and advanced Excel users how to leverage new powerful features in Excel like Power Pivot and Power Query to work with large datasets, connect to various data sources, and create insightful reports and dashboards without needing macros or advanced formulas. The courses show users how these tools can transform them into Excel power users and boost productivity by enabling them to easily answer complex questions about organizational data.
Rational Publishing Engine with Rational DOORSGEBS Reporting
The document describes how to use Rational Publishing Engine (RPE) to extract data from a Rational DOORS module and linked modules to generate an output document. It provides steps to:
1) Iterate through objects in a DOORS module and display attributes.
2) Configure an RPE data source to extract data from linked modules.
3) Filter and extract children objects from the linked modules.
4) Use schema discovery to add new attributes and update the schema.
5) Create templates, queries, containers and other elements to display the extracted DOORS data in paragraphs, tables and other structures in the output document.
This document discusses various ways to share and incorporate external data in Microsoft Excel 2007, including:
1) Setting up shared workbooks for multiple users to collaborate and track revisions.
2) Applying and modifying passwords to control access to shared workbooks.
3) Importing and exporting XML and HTML data using schemas and web queries.
4) Running web queries to retrieve external data from the internet and save it in Excel.
This document provides an overview of relational database programming using ADO.NET. It discusses relational database systems and SQL, connecting applications to databases, using database objects like commands and readers, and executing statements. Key topics covered include relational models, SQL, database constraints, ADO.NET providers and objects, parameterized commands, and transactions.
1. By default, if a statement fails within a transaction due to a statement terminating error, only that statement is rolled back and the transaction continues.
2. The SET XACT_ABORT ON setting configures SQL Server to roll back the entire transaction if any statement causes a run-time error.
3. Most common errors in T-SQL are statement terminating rather than batch or scope terminating, allowing subsequent statements to still execute even if one fails.
RPE - Template formating, style and stylesheet usageGEBS Reporting
The document discusses creating styles and using stylesheets in Rational Publishing Engine (RPE) document templates. It provides steps to:
1) Create a Word stylesheet to define styles for headings in the Word output.
2) Design the template's first page with a title, image and borders using tables and styles.
3) Add content areas and define a master page with headers and footers for navigation.
Using Rational Publishing Engine to generate documents from Rational RhapsodyGEBS Reporting
The goal of this tutorial is to introduce to the user the basics of using Rational Publishing Engine to extract data from Rational Rhapsody and create output documents to present in a friendly way the extracted data.
At the end of this tutorial the user will know how to create an RPE template for Rhapsody, how to obtain a valid Rhapsody schema and how to run a document specification to extract data from Rational Rhapsody.
Advanced Queuing provides database-integrated message queuing functionality that allows asynchronous communication between applications. It allows producers to ENQUEUE messages into queues and consumers to DEQUEUE messages. Key features include persistence of messages, propagation between queues, priority ordering of messages, transformation of message formats, and access control. The document provides an overview of these features and how to configure and use Advanced Queuing through PL/SQL interfaces and APIs.
Db performance optimization with indexingRajeev Kumar
This article discusses common issues developers face when using indexes in Oracle databases and provides recommendations to address them. It covers situations where the query engine may not pick up an index, such as when table statistics are out of date or the query is returning most of the table data. The article also discusses how functions, null values, and operators can prevent the use of indexes. Recommendations include using function-based indexes, updating statistics, and rewriting queries. In general, the article advises using EXPLAIN PLAN to check execution plans and understand that full table scans are not always inefficient.
The document discusses the database tools available in the Rational Application Developer data perspective. It describes how to connect to databases, work with database objects in the Database Explorer and Data Project Explorer views, and generate SQL statements using the SQL Editor or SQL Query Builder. The built-in Derby database that comes with RAD allows for a single client connection. Users can import existing database schemas and query data in the DB Output view.
This document provides a step-by-step guide for creating a Java application with an embedded database. It describes how to design a database from an Excel spreadsheet with normalized tables, create the database using Java DB, and link the tables. It then explains how to create a NetBeans project and connect it to the embedded database, and generate entity classes to represent the database tables in the Java application. The goal is to demonstrate how to link a database designed in Excel to a Java application using Java DB and JPA techniques.
The document provides an introduction to VBA and Excel functions like VLookup.
It explains the syntax and parameters of VLookup and provides an example. Pivot tables and pivot charts are also introduced along with examples using sample sales data.
Finally, it discusses getting started with VBA including recording and editing macros, understanding the VBA editor window, and some fundamental concepts like variables, control statements, and functions.
This document provides information on data models in BI Publisher and their components. A data model contains instructions to retrieve structured data from one or more sources to generate BI Publisher reports. It can extract, transform, and aggregate data. Key components of a data model include data sets, triggers, flexfields, lists of values, parameters, and bursting definitions. The data model editor allows users to link data between sets, perform calculations, and select from various data sources when building a data model. It provides an interface to design the data structure and properties. Parameters and lists of values can be added to allow for user filtering of report data.
1. The document provides a monthly review and trends for April, including stats on video viewing preferences, April Fools' Day brand engagement examples, an app called Qanda for video questions, and an IKEA photo contest app called Klikk.
2. It also discusses a sarcastic Organic Balance video, a Natrel mac and cheese photo contest on Instagram, Hyundai's "Real Fans First" campaign for Euro 2016, and a Taco Bell ordering bot for Slack.
3. Additional sections cover Sabra's "#UnofficialMeal" campaign for pre-dinner snacking and a JetBlue program that rewards passengers with discounts if babies cry on flights.
The document describes how to build a Movie List application using ASP.NET MVC and Entity Framework Core by explaining how to set up the model classes, controllers, views, and database context to display, add, edit and delete movie data, relating movies to genres and making the URLs more user-friendly. It provides code examples for each part of the application.
Generate Excel documents with Rational Publishing Engine 1.1.2 and Reporting ...GEBS Reporting
Integrating IBM Rational Publishing Engine 1.1.2 with Reporting Arena Excel Converter to generate documents from various IBM Rational tools in MS Excel format.
The document provides an overview of SQL and database evolution. It discusses:
1) The evolution of databases from early technologies like punched cards to modern relational database management systems (RDBMS) introduced by Ted Codd in 1970.
2) Codd's 12 rules for RDBMS.
3) The different languages used in SQL - DDL for definitions, DML for manipulations, DQL for queries, DCL for controls, and more.
4) Examples of key SQL statements like CREATE TABLE, INSERT, UPDATE, DELETE, ALTER TABLE, CREATE INDEX, and SELECT.
Query Analyser , SQL Server Groups, Transact –SQLKomal Batra
The document provides information about SQL Server Query Analyzer, including how it can be used to design and test Transact-SQL statements, create queries and scripts to execute against databases, and debug stored procedures and query performance. It also discusses SQL Server groups which are used to organize server instances, and how to register server instances to a group. Finally, it provides a brief overview of Transact-SQL and cursors in T-SQL.
The document describes Excel Power User training courses that teach intermediate and advanced Excel users how to leverage new powerful features in Excel like Power Pivot and Power Query to work with large datasets, connect to various data sources, and create insightful reports and dashboards without needing macros or advanced formulas. The courses show users how these tools can transform them into Excel power users and boost productivity by enabling them to easily answer complex questions about organizational data.
Rational Publishing Engine with Rational DOORSGEBS Reporting
The document describes how to use Rational Publishing Engine (RPE) to extract data from a Rational DOORS module and linked modules to generate an output document. It provides steps to:
1) Iterate through objects in a DOORS module and display attributes.
2) Configure an RPE data source to extract data from linked modules.
3) Filter and extract children objects from the linked modules.
4) Use schema discovery to add new attributes and update the schema.
5) Create templates, queries, containers and other elements to display the extracted DOORS data in paragraphs, tables and other structures in the output document.
This document discusses various ways to share and incorporate external data in Microsoft Excel 2007, including:
1) Setting up shared workbooks for multiple users to collaborate and track revisions.
2) Applying and modifying passwords to control access to shared workbooks.
3) Importing and exporting XML and HTML data using schemas and web queries.
4) Running web queries to retrieve external data from the internet and save it in Excel.
This document provides an overview of relational database programming using ADO.NET. It discusses relational database systems and SQL, connecting applications to databases, using database objects like commands and readers, and executing statements. Key topics covered include relational models, SQL, database constraints, ADO.NET providers and objects, parameterized commands, and transactions.
1. By default, if a statement fails within a transaction due to a statement terminating error, only that statement is rolled back and the transaction continues.
2. The SET XACT_ABORT ON setting configures SQL Server to roll back the entire transaction if any statement causes a run-time error.
3. Most common errors in T-SQL are statement terminating rather than batch or scope terminating, allowing subsequent statements to still execute even if one fails.
RPE - Template formating, style and stylesheet usageGEBS Reporting
The document discusses creating styles and using stylesheets in Rational Publishing Engine (RPE) document templates. It provides steps to:
1) Create a Word stylesheet to define styles for headings in the Word output.
2) Design the template's first page with a title, image and borders using tables and styles.
3) Add content areas and define a master page with headers and footers for navigation.
Using Rational Publishing Engine to generate documents from Rational RhapsodyGEBS Reporting
The goal of this tutorial is to introduce to the user the basics of using Rational Publishing Engine to extract data from Rational Rhapsody and create output documents to present in a friendly way the extracted data.
At the end of this tutorial the user will know how to create an RPE template for Rhapsody, how to obtain a valid Rhapsody schema and how to run a document specification to extract data from Rational Rhapsody.
Advanced Queuing provides database-integrated message queuing functionality that allows asynchronous communication between applications. It allows producers to ENQUEUE messages into queues and consumers to DEQUEUE messages. Key features include persistence of messages, propagation between queues, priority ordering of messages, transformation of message formats, and access control. The document provides an overview of these features and how to configure and use Advanced Queuing through PL/SQL interfaces and APIs.
Db performance optimization with indexingRajeev Kumar
This article discusses common issues developers face when using indexes in Oracle databases and provides recommendations to address them. It covers situations where the query engine may not pick up an index, such as when table statistics are out of date or the query is returning most of the table data. The article also discusses how functions, null values, and operators can prevent the use of indexes. Recommendations include using function-based indexes, updating statistics, and rewriting queries. In general, the article advises using EXPLAIN PLAN to check execution plans and understand that full table scans are not always inefficient.
The document discusses the database tools available in the Rational Application Developer data perspective. It describes how to connect to databases, work with database objects in the Database Explorer and Data Project Explorer views, and generate SQL statements using the SQL Editor or SQL Query Builder. The built-in Derby database that comes with RAD allows for a single client connection. Users can import existing database schemas and query data in the DB Output view.
This document provides a step-by-step guide for creating a Java application with an embedded database. It describes how to design a database from an Excel spreadsheet with normalized tables, create the database using Java DB, and link the tables. It then explains how to create a NetBeans project and connect it to the embedded database, and generate entity classes to represent the database tables in the Java application. The goal is to demonstrate how to link a database designed in Excel to a Java application using Java DB and JPA techniques.
The document provides an introduction to VBA and Excel functions like VLookup.
It explains the syntax and parameters of VLookup and provides an example. Pivot tables and pivot charts are also introduced along with examples using sample sales data.
Finally, it discusses getting started with VBA including recording and editing macros, understanding the VBA editor window, and some fundamental concepts like variables, control statements, and functions.
This document provides information on data models in BI Publisher and their components. A data model contains instructions to retrieve structured data from one or more sources to generate BI Publisher reports. It can extract, transform, and aggregate data. Key components of a data model include data sets, triggers, flexfields, lists of values, parameters, and bursting definitions. The data model editor allows users to link data between sets, perform calculations, and select from various data sources when building a data model. It provides an interface to design the data structure and properties. Parameters and lists of values can be added to allow for user filtering of report data.
1. The document provides a monthly review and trends for April, including stats on video viewing preferences, April Fools' Day brand engagement examples, an app called Qanda for video questions, and an IKEA photo contest app called Klikk.
2. It also discusses a sarcastic Organic Balance video, a Natrel mac and cheese photo contest on Instagram, Hyundai's "Real Fans First" campaign for Euro 2016, and a Taco Bell ordering bot for Slack.
3. Additional sections cover Sabra's "#UnofficialMeal" campaign for pre-dinner snacking and a JetBlue program that rewards passengers with discounts if babies cry on flights.
Muchas especies de fauna ibérica se encuentran en peligro de extinción, incluyendo el lince ibérico, el oso pardo, el lobo, la foca monje, la ballena azul, el águila imperial, la nutria y el quebrantahuesos. Algunas de estas especies amenazadas son el lobo ibérico, que ha sido perseguido y se alimenta de presas pequeñas; el oso pardo, el animal terrestre más grande que se alimenta principalmente de vegetales; y el lince ibérico, un á
The document provides a summary of Shaik Jameel's profile, including his work experience, education, skills, and contact information. As a sales professional with over 10 years of experience, he has worked in management, sales, production forecasting, and sales administration. His education includes courses in multimedia and sales/management obtained in India between 2000-2007. Currently residing in Dubai, UAE, he is proficient in Hindi, English, and Arabic and has strong skills in programs like Photoshop, Illustrator, and 3D Maya.
This document is a resume for Patrick B. De Guzman, who has over 10 years of experience working in hospitality roles in Dubai and Singapore, including positions as a bartender, barman, waiter, and management trainee. He has a bachelor's degree in computer science from Interworld College of Science and Technology Foundation in Tarlac City, Philippines. His resume lists his duties and responsibilities at each job, as well as seminars and training he has attended on topics like food hygiene, fire safety, and guest complaints.
Terminó el campeonato nacional escolar de basquetbol Varones U-18 realizado en Victoria.
El Colegio Patmos de Viña del Mar representando la Región de Valparaíso se tituló Campeón Invicto al superar ampliamente a la Región Metropolitana por un categórico 66 a 36, demostrando ser el mejor equipo del país.
En los partidos previos derrotó a Aysén, Coquimbo, Los Ríos (Valdivia) y Araucanía (Temuco). Tercero fue Temuco y cuarto Bio Bio.
La selección estuvo integrada por: Ignacio Sanino, Pablo Sarmiento, Pablo Jara, Enrique Riveros, Javier Palacios, Barham Amor, Benjamín Yáñez, Francisco Álvarez, Joaquín Ibarra y Fernando Orsola, dirigidos por el profesor José Luis De la Maza.
La carta confirma el encargo de MB Auditores&Consultores,S.A. de C. V. para auditar los estados financieros e información complementaria de la Administración Nacional de Acueductos y Alcantarillados (ANDA) por el periodo del 1 de enero al 31 de diciembre de 2015. La auditoría se llevará a cabo de acuerdo con las Normas Internacionales de Auditoría y otras normas aplicables. La carta también describe los informes que se presentarán y las responsabilidades de la dirección y los auditores.
Palestra sobre Departamentos Jurídicos, por Lara SelemLara Selem
Lara Selem é uma advogada e consultora em gestão de serviços jurídicos com experiência internacional e vários livros publicados sobre o tema. O documento discute a evolução dos departamentos jurídicos, desde sua natureza mais burocrática até se tornarem estratégicos e focados em resultados.
I Encontro Nacional da Advocacia CorporativaLara Selem
O documento discute o aumento da litigiosidade no Brasil e seus impactos no planejamento estratégico das empresas. A litigiosidade cresceu devido ao Código de Defesa do Consumidor e ao ingresso de novos consumidores nos tribunais. Isso sobrecarregou o Judiciário e aumentou a insegurança jurídica para as empresas. Para reduzir esses impactos, as empresas precisam prever o aumento da demanda jurídica e trabalhar em estreita colaboração com seus departamentos jurídicos e escritóri
C:\Documents And Settings\Anderb04\My Documents\Trainings\February\Item Analy...Brenda Anderson
The document discusses item analysis and its use for advocacy and student achievement. Item analysis examines the skills required to correctly answer standardized test questions. This allows teachers to connect the skills tested to information literacy instruction. Item analysis can be used as an advocacy tool by showing administrators how library programs build foundations for student success on high-stakes tests. An example item analysis form is provided to categorize questions by format, skills, content, and connections to standards.
Wi-Fi allows two-way communication of signals through radio waves, allowing data to be sent wirelessly between devices like computers and routers. It works by converting digital data into radio signals transmitted at frequencies like 2.4GHz or 5GHz, which helps avoid interference from other electronic devices. These radio signals are transmitted between a computer and wireless router to enable wireless internet access without wires.
Translated presentation of "Session 2: Introduction to Modern Assessment Theory (continued)" from UNESCO Bangkok's Capacity Development Workshop: Test and Item Development and Design in Vientiane, Lao PDR 27-30 September 2016
O documento discute estratégias para reinventar a advocacia, incluindo focar no longo prazo em vez de apenas no curto prazo, usar mentalidade estratégica em vez de imediatista, e posicionar o escritório de advocacia de acordo com o tipo de cliente e serviço oferecido (padronizado, customizado, especializado ou científico).
A look at a project to send automated emails. The processes behind it and how to do it yourself using 6 techniques: Secured folders, ODBC connections, Access queries, Excel Pivot tables, Excel macros and scheduled tasks
Excel Services allows users to interact with Excel workbooks in a web browser. It has three main components: Excel Calculation Services calculates workbooks, Excel Web Access displays workbooks in a browser, and Excel Web Services provides an API. Excel Services enables viewing and filtering data, refreshing external connections, and creating dashboards and reports to share data in a secure way. It can integrate with other business intelligence features like the Report Center and KPI web parts.
ADO.NET is Microsoft's data access technology for .NET applications to connect to data sources. It uses a multilayered architecture centered around connections, commands, and dataset objects. Key differences from ADO include using a generic set of objects regardless of data source and a data provider model. ADO.NET supports features like interoperability, maintainability, typed programming, and performance through its disconnected data architecture.
This document discusses how to connect to an Oracle database from Visual Basic 6 using ADO objects rather than an ADO data control. It explains how to declare ADO connection, recordset and command objects, open a connection to the database, execute a SQL query to populate the recordset, and set the recordset as the data source for a data grid control to display the results, allowing retrieval and display of data from Oracle without using the ADO data control.
This document discusses automating SolidWorks with Excel using Visual Basic for Applications (VBA). It covers creating user interfaces in Excel, accessing SolidWorks through VBA code, and driving SolidWorks automatically using loops in Excel. Examples are provided on building SolidWorks VBA code that can be used in Excel macros, including connecting to SolidWorks, accessing Excel data from VBA, and driving SolidWorks models with Excel values and information. Attendees are encouraged to ask questions during or after the presentation.
Sql server 2012 tutorials writing transact-sql statementsSteve Xu
This tutorial provides an introduction to writing basic Transact-SQL statements for creating and manipulating database objects. It is divided into three lessons: Lesson 1 covers creating a database, table, inserting and updating data; Lesson 2 covers configuring permissions on database objects by creating logins, users, views and stored procedures; Lesson 3 covers deleting database objects. The document contains step-by-step tutorials to demonstrate creating a database, table, inserting and reading data, and configuring permissions on the database objects.
ADO.NET by ASP.NET Development Company in india
ADO.NET is a data access technology from the Microsoft .NET Framework that provides communication between relational and non-relational systems through a common set of components.
Video :
Courtesy:
http://www.ifourtechnolab.com
This document provides an overview of developing applications using Oracle Application Express (APEX). It discusses the APEX architecture and components used for browser-based application development like the Application Builder, SQL Workshop, and Administrator. The benefits of APEX are also summarized like rapid development, mobile support, and use cases. Steps for creating a demo "help desk" application are outlined, including designing the database tables, loading sample data, and basic application navigation.
This document provides information about an inplant training program offered by KAASHIV INFOTECH in Chennai, India. It outlines 5-day training schedules for students of CSE/IT/MCA and ECE/EE/EIE focused on topics like Big Data, cloud computing, CCNA, ethical hacking, and MATLAB. It also lists a 5-day training schedule for mechanical/civil engineering students and provides contact information for the training program.
This document discusses data representation in C# and ADO.NET. It begins by explaining that C# objects are similar to Java objects but with properties instead of getter/setter methods. It then covers how to create a class with properties in C# and use objects. The document also discusses encapsulation in ADO.NET and how it handles connecting to databases. It provides steps for connecting to a database, creating a data adapter and dataset, binding controls to display data, and adding code to populate the dataset and allow navigation between records.
Access tips access and sql part 4 building select queries on-the-flyquest2900
This document discusses building select queries dynamically in Microsoft Access using VBA and SQL. It describes creating a stored query, building a dialog box to collect user criteria, and writing code to generate a SQL statement based on the user's selections. The code declares variables, builds the SQL by concatenating strings representing the criteria values, and tests the generated SQL by printing it to the Immediate window or displaying in a message box. The goal is to create a flexible multi-purpose query tool allowing users to filter data without knowledge of Access or SQL.
This document provides information about Venkatesan Prabu Jayakantham (Venkat), the Managing Director of KAASHIVINFOTECH, a software company in Chennai. It outlines Venkat's experience in Microsoft technologies and certifications. It also describes KAASHIVINFOTECH's inplant training programs for students in fields like engineering, electronics, and mechanical/civil studies. The training focuses on developing technical skills through hands-on demonstrations and projects.
This document provides information about Venkatesan Prabu Jayakantham (Venkat), the Managing Director of KAASHIVINFOTECH, a software company in Chennai. It outlines Venkat's experience in Microsoft technologies and certifications. It also describes KAASHIVINFOTECH's inplant training programs for students in fields like engineering, electronics, and mechanical. The training focuses on developing technical skills through hands-on demos and projects.
Oracle APEX is a tool for building database-driven web applications using only a web browser. The document discusses the architecture, features, and benefits of APEX. It also provides step-by-step instructions for creating tables, loading sample data, and building an initial application with forms and reports using the APEX development environment.
This paper’s aim is to point out the RAD ( Rapid application development) elements present in the Microsoft’s MVC 3 and WCF 4.0 using Microsoft Visual Studio 2010. It will describe why creating a new web application using MVC 3 and WCF 4.0 is a easy and fast and also present simple ways to develop such applications.
The document discusses how to automate work using Excel and Access. It provides 5 methods for automation: creating or connecting to a data source, using Access queries to manipulate data, creating pivot tables, using formulas, and creating macros. Several examples are given that illustrate these methods, including projects to automate journal entries, payroll data, 401k audits, and time tracking. Connecting directly to data through ODBC or linking files allows data to update automatically on opening worksheets and pivot tables.
This slide deck presentation provides an overview of managing Microsoft SQL Server for those who are not primarily database administrators. The presentation covers how SQL Server works, backup and restore operations, indexes, database and server configuration options, security models, and high availability and replication options. It also demonstrates various SQL Server management tasks in the SQL Server Management Studio tool. The presentation encourages attendees to reuse the material and provides contact information for the company that created the presentation for additional training opportunities.
What are the key points one must know before learning Advanced Excel.docxshivanikaale214
Master advanced Excel by mastering basic functions, data formatting, and basic formulas before diving into features like PivotTables, conditional formatting, and tools like Solver and Get & Transform for advanced data analysis and optimization tasks. Efficiently manage large datasets by utilizing Excel Tables, PivotTables, external data connections, and optimizing hardware/software settings to overcome performance limitations and maximize productivity.
This document provides an introduction to SQL Server for beginners. It discusses prerequisites for learning SQL such as knowledge of discrete mathematics. It explains that SQL Server runs as a service and can be accessed via tools like SQL Server Management Studio. The document also covers basic concepts in SQL Server including how data is stored and organized in tables, columns, rows and databases. It defines primary keys and discusses different data types. Finally, it discusses the client-server model and how SQL Server can be accessed from client applications via libraries, web services, and other connectivity options.
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...Amit Singh
This document discusses integrating Oracle Application Framework (OAF) BC4J components within a Java concurrent program to perform complex background operations like loading data from an XML file into a database table. It provides steps to setup the development environment, create the necessary OAF model objects (entity object, view object, application module), develop a Java class that implements the concurrent program interface, parse the XML using SAX, and extract and load the data. The goal is to demonstrate how to leverage OAF components for common tasks like database access within a custom Java background job.
Oracle EBS 12.1.3 : Integrate OA Framework BC4J components within java concur...
Excel
1. 1. Excel reporting
1.1. Introduction
Considerable effort is expended by most organizations in the production of management
information, reports that provide the information to support decisions.
While there are a number of automated solutions available, the vast majority is still prepared
manually using Excel. Not only is this time consuming, but there is a significant risk of error
due to the manual nature of the process. Security in Excel is limited (and rarely applied) and
there is no audit trail to identify who made changes.
With an automated solution, the time previously used for report preparation can be used for
more valuable activities such as analysis and interpretation of the information and decision
support.
1.2. What you will learn
In this article we will cover the following topics:
How to connect Excel to a database using ActiveX Data Objects (ADO).
How to build a report using Visual Basic for Applications (VBA) base on data in a database.
Techniques to optimize the performance of your reporting solution.
1.3. What you need to know
The following is assumed:
A basic understanding of VBA for Excel.
A basic understanding of databases and SQL.
1.4. Excel uses
Excel is it own worst enemy. It has such rich functionality that it is often used for purposes for
which there is a much better solution. Extreme versions of this that I have seen include
flowcharting using the drawing functionality or a presentation slide pack. These are obviously
areas that Excel functionality was never intended to satisfy. However, there is a whole raft of
areas that use core Excel functionality that I believe are wrong.
Let’s examine some of these:
Transaction processing. I often see core business processes performed in Excel. It may
be that the Accounts payable or receivable ledger is maintained in Excel.
Accounting adjustment creation. Provisions, accruals and allocations are often calculated
in Excel and then either loaded to the accounting system or exist as part of reporting
adjustments outside the accounting system.
Budgeting. There is a lack of decent budgeting / forecasting solutions at a price acceptable
to the majority of organisations on the market and Excel is almost always used to perform
this function.
Reporting. In most organisations Excel will form part of the reporting suite. While it is OK
to use Excel for reporting it is the manner of creation that I object to. Normally a data
download is taken from the core system and the report created using Excel formulae like
Vlookup and Sumif.
So, what is wrong with this? I believe there are a number of generic issues with Excel:
2. Multi user. While you can share a workbook, Excel does not really do this well – it is not a
database management system that can deal with record locks. Generally, each
subsequent save overwrites previous saves for those cells that have been edited.
Audit trail. Excel has no audit trail, you can delete lines / columns and edit cells with no
record of who did it or when it was done, of course, you do not need to log-in to Excel like
you do for most database applications. Therefore, it is impossible to tell who entered /
removed / edited data.
Dimensionality. Excel can handle 3 dimensions as a result of the nature of worksheets and
workbooks which are organised into sheets, rows and columns. While pivot tables /
PowerPivot allow the analysis of multi dimensional data, I frequently see Excel attempting
to store multidimensional scenarios.
So what should Excel be used for?
1.5. Reporting using Excel
As I have mentioned, I believe that Excel is a perfectly good reporting tool as long as all
transactional and adjustment data is stored in a proper systems that manages areas such as
audit trail and referential integrity.
Excel can connect to databases in a number of ways. Originally we had Microsoft Query to
connect to the database, execute the reporting logic via a SQL statement and present the
resulting data in Excel. Form Excel 2007 onwards, we could do that directly. We can use plain
tables to present transaction data or pivot tables to analyse the data. Where the in-built
functionality starts to be found lacking is the production of standard reports which often have
complex formatting that standard Excel functionality cannot automatically perform.
This is where we need to consider developing our own functionality. There are a number of
different ways to achieve the connectivity to databases but I have found Microsoft’s Activex
Data Objects (ADO) able to meet all my needs. This library has a number of very nice
functions / properties that have persuaded me to stick with it.
There are two major objects in ADO which you will need; the connection and recordset objects.
I will discuss these later in this article.
1.6. ADO basics
So how do we use ADO in Excel? As with all libraries we can either reference the library and
create objects using the New key word or we can create the object using the CreateObject
funcion.
1.6.1. Referencing ADO
ADO can be referenced as follows:
Launch the VBA editor (I use Alt+f11 to do this).
Insert a new module into the current workbook.
Choose Tools, Reference from the menu. The following dialogue is shown:
3. Scroll down to find the ADO library. You will find several versions of this, I generally use
version 2.7 or 2.8.
You can then start entering code as follows:
Function Open_Connection()
Dim con as ADODB.Connection
Set con=new ADODB.Connection
1.6.2. Using CreateObject
The CreateObject function allows you to not reference the ADO class library but, if you use this
approach, the VBA editor will not be able to prompt for available methods / properties of the
objects or enumerations.
The code for this is as follows:
Function Open_Connection()
Dim con as Object
4. Set con= CreateObject(“ADODB.Connection”)
1.6.3. The connection object
The connection object represents a connection to a database. Once you have an open
connection to the database you can do anything to the database; add/ edit / delete data,
retrieve data, and modify the database schema as long as your user account has the rights to
do so.
ADO can connect to a number of different databases (Microsoft SQL Server, Oracle, MySQL
etc), either directly through ADO drivers for the database or through ODBC. The connection is
made by defining the connection parameters or connection string and using the Open method.
The connection string is specific for each database type. You do not need to remember the
syntax for connection strings as there are several sites on the web for this, I recommend
www.connectionstrings.com.
Here is example code to open a connection to a Microsoft SQL Server database:
Function Open_Connection() as ADODB.Connetion
Dim con as ADODB.Connetion
Set con = new ADODB.Connetion
con.Open “Driver={SQL Server}; Server=[Server_Name];
Database=[Dataabse_Name]; UID=[User_Name];PWD=[Password];”
Set Open_Connection = con
End function
Where:
[Server_Name] is the name or IP address of the SQL Server instance.
[Database] is the name of the database to connect to.
[User_Name] and [Password] are the user credentials.
Of course you can pass the user name and password to this function from a user dialogue.
1.6.4. Error trapping
ADO can generate errors, for example, as the result of invalid login credentials or a syntax
error in a SQL statement. If these are left un-trapped the user will get nasty VBA error
messages. In order to prevent this we can use the On Error statement to prevent these errors
appearing to the user but we probably need to take account of the error in our program.
The connection object has two properties that help here:
The State property returns a boolean indicating whether the connection is open (logged in)
or not and can be used to test whether a login attempt was successful.
Errors.is a collection of items that contain details of errors returned by the Connection
object and can be used to return the description of the error.
The following code shows the Open_Connection function modified to return a message if the
log-in is not successful:
Function Open_Connection() as ADODB.Connetion
Dim con as ADODB.Connetion
Set con = new ADODB.Connetion
On Error Resume Next
con.Open _“Driver={SQL
Server};_Server=[Server_Name];_Database=[Dataabse_Name];_UID=[User_Name];PWD=[Pa
ssword];”
5. If con.State = 0 then
MsgBox "There was a problem logging in. " & _
con.Errors(0).Description, vbCritical, "Log in"
End If
Set Open_Connection = con
End function
1.6.5. The Recordset object
The Recordset object represents the results of a SQL select statement and is used to retrieve
data. The Recordset object contains a number of useful methods and properties.
1.6.5.1. Open method
This opens the recordset. The recordset can be a table, a view, a SQL select statement or (for
those databases that support it) a stored procedure that returns records. The following
example function returns a recordset:
Function Get_Data (con as ADODB.Connection) as ADODB.Recordset
Dim rst as ADODB.Recordset
Set rst=new ADODB.Recordset
rst.Open “Select * from tblData”, con
Set Get_Data = rst
End Function
The Open method also accepts a number of optional parameters:
CursorType can be used to identify the type of cursor, the default is **.
LockType defines the record locking. The default is ** which allows you to edit data in the
recordset. I prefer to use Recordsets only to retrieve data and so always use the setting
adLockReadOnly.
Options. This is used to instruct the ADO driver the type of SQL statement being passed,
e.g. the name of a table, a view or a SQL statement. Most of the time, I find that this is not
required, the ADO driver / database engine works this out. However, with Microsoft
Access, I find I need to specify the type of statement or an error ocurrs.
1.6.5.2. Retrieving the data
The Recordset will contain rows and columns. The columns can be referenced using the
Fields property. Fields is a collection representing the columns in the recordset. The value of
a particular column in the current row is referenced as follows:
rst.fields.item(0).value
Because Fields, Item and value are the default properties, this can be written rst(0). The Fields
collection also supports the Count property to determine the number of columns in the
collection. The collection is zero based so the ordinals range from 0 to Count-1.
It is also possible to determine the name of the column using the Name property, e.g.
rst(0).Name and the data type using the Type property, e.g. rst(0).Type.
Traversing the rows can be done with a number of self-explanatory methods, MoveFirst,
MoveLast, MoveNext and MovePrevious.
We can tell when we get to the end (last row) of the recordset using the EOF property. This is
a Boolean which returns True when the cursor is beyond the last record.
The following routine writes the contents of a recordset to an Excel sheet:
6. Sub Write_To_Sheet(rst as ADODB.Recordset)
Dim intRow as Integer, IntColumn as Integer
intRow=1
Do Until rst.EOF
For intCols = 1 to rst.Fields.Count
ActiveSheet.cells(intRow, intColumn)=rst(intColumn-1)
Next
rst.MoveNext
intRow = intRow+ 1
Loop
End Sub
In order to include the column names in the first row, the following may be inserted:
For intCols = 1 to rst.Fields.Count
ActiveSheet.cells(1, intColumn)=rst(intColumn-1).Name
Next
The EOF can also be used to test whether a SQL statement returns any rows at all.
1.6.6. Closing the recordset
Once you have finished with the data from the recordset you should always close it using the
Close method to release system resources and to prevent run-time errors if you attempt to
open the recordset again while it already open.
1.6.7. State property
The Recordset object also has a Boolean State property which can be used to test whether the
recordset opened successfully.
1.7. Report building
1.7.1. Report structure
In my opinion, reports have the following elements:
Title – describes what the report is showing and any data filters applied (e.g. date range,
products, region, business division, etc.)
Criteria – any user applied filters on the report data.
Headers – these are the row and column headers or dimensions of the report and describe
the contents of each row or column (e.g. cost captions (nominal accounts), months,
products etc.
Body – this contains the numerical data.
Calculations – values calculated from the data in the body, may be simply row or column
totals or more complex.
The following image shows these elements.
7. 1.7.2. Report generation
How do we generate such a report programmatically with VBA?
Let’s suppose that we are constructing a profit and loss report from an accounting database.
1.7.2.1. Database schema
For reporting, most databases are designed having a ‘star schema’. This means that there is a
single data table containing the numerical (value) data and foreign keys to each of the master
data tables (e.g. nominal accounts, products, etc.) where descriptions of the dimension
members are held.
Data
Data
FK1 Foreign key 1
FK2 Foreign key 2
FK3 Foreign key 3
FK4 Foreign key 4
FK5 Foreign key 5
Master data 1
PK Primary key
Description
Master data 2
PK Primary key
Description
Master data 3
PK Primary key
Description
Master data 4
PK Primary key
Description
Master data 5
PK Primary key
Description
The data table should not, if any degree of normalization has been performed, contain the
descriptions of the dimensions (master data) that is represented but the index or code value
from the master data table.
1.7.2.2. Named ranges
Named ranges are a feature in Excel that is underused. It allows the user to define and
reference a range of cells using a name. I use this extensively when generating reports.
When a block of data is retrieved from the database, I assign a name to the range of cells that
the data has been inserted into. You can then use the named range for a variety of purposes:
Determine the number of rows / columns.
Use in cell formulae.
8. Apply formatting.
1.7.2.3. Row and column headers
Row and column headers can be inserted into the worksheet using the technique shown in
section 1.6.5.2.
In the example, the row headers are the nominal accounts from a table called Nom_AC. The
table has 4 columns that we are interested in:
idAc – the primary key which is an auto-incrementing integer. This is the field that is
referenced from the data table.
Code_Ac – this is the nominal account code used by the accounting function.
Description – the decription of the account.
Type – the type of account, e.g. profit and loss (Value=1), balance sheet (Value=2).
The report needs the first three of these fields on the sheet so the SQL statement is “Select
idAc, Code_Ac, Description from Nom_Ac where Type=1”
Let us also assume that we have a style called Row_Header that we wil apply to the resulting
data block and that we will apply a name to the range that the data is inserted into.
The code to insert the row header is as follows:
Sub Row_Header(con as ADODB.Connection,intStartRow as Integer)
Dim intRow as Integer, IntColumn as Integer
Dim rst as ADODB.Recordset
Set rst = new ADODB.Recordset
rst.Open “Select idAc, Code_Ac, Description from Nom_Ac where Type=1”, con
intRow=0
Do Until rst.EOF
For intCols = 1 to rst.Fields.Count
ActiveSheet.cells(intRow+intStartRow, intColumn)=rst(intColumn-1)
Next
rst.MoveNext
intRow = intRow+ 1
Loop
rst.Close
Set rst = Nothing
Names.Add “Nominal_Accounts”, Range(cells(intStartRow, 1), Cells(intRow +
intStartRow-1, 3))
Range(“Nominal_Accounts”).Style=”Row_Header”
End sub
The first column contains data we do not need to display to the user so it can be hidden.
1.7.2.4. Data blocks
The report now has row and column headers and we now need to insert the data into the
range of cells that are the intersect of the headers.
In order to insert the data there are a number of approaches. The simplest is to generate a
SQL statement for each cell in the range and insert the value returned into the cell. The code
is as follows:
Sub Data(con as ADODB.Connection)
Dim intRow as Integer, intColumn as Integer
Dim rst as ADODB.Recordset
9. Set rst = new ADODB.Recordset
For intRow = 1 to Range(“Nominal_Accounts”).Rows.Count
For intColumn = 1 to Range(“Months”).Columns.Count
rst.Open “Select Sum(Val) from Data where idAc=” &
Range(“Nominal_Accounts”).Cells(intRow,1) & ” and idMonth=” &
Range(“Months”).Cells(1,intColumn)
ActiveSheet.Cells(Range(“Nominal_Accounts”).Cells(intRow,1),Row,
Range(“Months”).Cells(1,intColumn).Column) = rst(0)
rst.Close
Next
Next
Set rst = Nothing
End Sub
We can, of course, apply a range name and formatting to the block we have inserted.
1.8. Performance optimization
1.8.1. Minimising the database interactions
Communicating with the database can be slow, especially if the database contains large
amounts of data, is not properly indexed or the SQL we are executing is complex. Of course,
each time we execute a SQL statement the database engine will take an amount of time to
process the request. If the database is on a database server, there may also be network
considerations. Therefore, it is good practise to minimize the communication with the
database.
In the example in section 1.7.2.4, a SQL statement was executed for every cell in the report.
Let’s assume we had 200 nominal accounts and 12 months on our Profit and Loss report. This
means we executed 2,400 SQL statements!
Additionally, there may have been no data for some of the cells. The SQL statement would
have returned a zero for these but we have potentially wasted computing resource here and
therefore compromised performance.
A faster way is to retrieve a recordset that contains the data we want and then work out where
to insert the data into the report using VBA.
In order to do this the SQL statement will be:
Select Sum(Val) as Val, idAc, idMonth
from Data
Group by idAc, idMonth
In order to retrieve only data that is relevant to the profit and loss, we should also insert a filter
to our SQL based on the Type column of the Nom_Ac table. The SQL is as follows:
Select Sum(Val) as Val, idAc, idMonth
from Data inner join Nom_Ac on Nom_Ac.idAc=Data.idAcc
Where Nom_Ac.Type=1
Group by idAc, idMonth
This will return a recordset containing a number of rows with each row containing a column for
the value, the nominal account id and the month id. We now need to work out where to put
each value. This is done by looking up the Nominal account id and month id in the row and
column headers.
We could write VBA to perform the lookup on the sheet but it is quicker to use the inbuilt Excel
functions (e.g. MATCH) to do this. We can use Excel worksheet functions from VBA as
follows:
10. Application.WorksheetFunction.Match()
When using the Match function there are a couple of things that we need to be aware of:
1.8.1.1. Single dimension lookup range
We need to supply a 1 dimensional array (i.e. one row or column) as the lookup range
parameter, the Row headers are 2 dimensional ranges and we need the 1st row or column of
them. This can be done using the Rows or Columns property of the Range object:
Range(“Nominal_Accounts”).Columns(1)
1.8.1.2. Data types
The data types of the value being sort must match those in the lookup range, i.e. if your lookup
range contains numerical data, make sure that you supply a numerical value as value to be
matched.
So, in order to get the match, the following code might be used:
Sub Data(con as ADODB.Connection)
Dim intRow as Integer, intColumn as Integer
Dim rst as ADODB.Recordset
Set rst = new ADODB.Recordset
rst.Open “Select Sum(Val) as Val, idAc, idMonth
from Data inner join Nom_Ac on Nom_Ac.idAc=Data.idAcc
Where Nom_Ac.Type=1
Group by idAc, idMonth”, con
Do until rst.EOF
‘Find the row for the data
intRow = Application.WorksheetFunction.Match(rst(“idAc”,
Range(“Nominal_Accounts”).Columns, 0)
intRow = intRow + Range(“Nominal_Accounts”).Row -1
‘Find the column for the data
intColumn = Application.WorksheetFunction.Match(rst(“idMonth”,
Range(“Months”).Rows, 0)
intColumn = intColumn + Range(“Months”).Row -1
ActiveSheet.Cells(intRow , intColumn) = rst(Val)
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
End Sub
11. 1.8.2. Minimising interaction between Excel and VBA
Another thing that slows VBA down is interaction with the host application, in this case, Excel.
For example, reading or writing data from or to a cell takes time.
It is little known that you can exchange data between a range of cells and a VBA array with a
single command rather than having to traverse the range and array. VBA arrays are held in
memory and so can be accessed and manipulated very quickly. Therefore, if you can hold the
data in a VBA array and only read or write to the worksheet when you absolutely have to, then
performance will improve.
Two additional facts can help us speed up our code. The first is the GetRows method of the
ADODB.Recordset object. This allows you to copy the entire contents of a recordset either to
a range of cells in a worksheet or to an array variable in a single command:
varData=rst.GetRows()
The resulting 2 dimensional array has the recordset columns as dimension 1 and the rows as
dimension 2. This means that effectively the reocrdset has been transposed by the GetRows
method.
The second is that the Application.WorksheetFunction methods (e.g. Match, Transpose) can
use an array variable rather than a range of cells.
Using these two facts we can dramatically reduce the number of interactions between the VBA
code and Excel. We can insert the row headers as follows:
Sub Row_Header(con as ADODB.Connection,intStartRow as Integer)
Dim rst as ADODB.Recordset
Dim varData() as variant
Set rst = new ADODB.Recordset
rst.Open “Select idAc, Code_Ac, Description from Nom_Ac where Type=1”, con
‘Populate the array variable from the recordset and transpose at the same time
varData=Application.WorksheetFunction.Transpose(rst.GetRows())
rst.Close
Set rst = Nothing
Names.Add “Nominal_Accounts”, Range(cells(intStartRow, 1), Cells( intStartRow +
Ubound(varData,1), 3))
‘Place the array onto the sheet
Range(“Nominal_Accounts”) = varData
Range(“Nominal_Accounts”).Style =”Row_Header”
End sub
Using this approach the data is transferred to the worksheet in a single operation rather than a
cell at a time. In our example of 200 nominal accounts this would require accessing 600 cells
(3 columns for each nominal account) so we have reduced 600 operations to a few operations.
In order to insert the data into the intersects, we can also use an array variable. But to
minimise the number of interactions with the Excel sheets when looking up against the row and
column headers, we should copy these to array variables. We will also need to create an array
variable to represent the range of cells that we are going to insert the data into.
Sub Data(con as ADODB.Connection)
Dim intRow as Integer, intColumn as Integer, intData as Integer
Dim varData() as Variant, varRows() As Variant, varColumns() As Variant, varInsert()
as variant
Dim rst as ADODB.Recordset
Set rst = new ADODB.Recordset
rst.Open “Select Sum(Val) as Val, idAc, idMonth
12. from Data inner join Nom_Ac on Nom_Ac.idAc=Data.idAcc
Where Nom_Ac.Type=1
Group by idAc, idMonth”, con
varData = rst.GetRows()
rst.Close
Set rst = Nothing
varRows=range(“Nominal_Accounts”).Columns(1)
varColumns=range(“Months”).Rows(1)
Redim varInsert(Ubound(VarRows), Ubound(varColumns))
For intData = Lbound(VarData) to Ubound(varData)
intRow =Application.WorksheetFunction.Match(rst(1),varRows,0)
intColumn =Application.WorksheetFunction.Match(rst(2),varColumns,0)
varInsert(intRow-1, intColumn-1) = rst(0)
Next
With ActiveSheet
Range(.cells(Range(“Nominal_Accounts”).Row, Range(“Months”).Column),
.Cells(Range(“Nominal_Accounts”).Row+ Range(“Nominal_Accounts”).Rows.Count -1,
Range(“Months”).Column + Range(“Months”).Columns.Count -1)) = varInsert
End with
End Sub
1.9. Conclusion
We have explored how to generate reports in Excel from source databases and how to
optimize the code for performance. The techniques covered were all taken from our product
DBReport.
DBReport is an in-Excel Report writer that allows the creation of reports that can be refreshed
at the touch of a button and can explot the rich formatting functionality of Excel.
For more information please visit our website: www.pendragonsystems.com.
1.10. About the author
Jason Raikes is a Chartered Accountant. For the past 20 years he has worked as a
management consultant specialising in helping clients implement management information
solutions. Jason is also the developer of a number of software products focusing on the
automation of management information and marketed by Pendragon Systems Limited.