SlideShare uma empresa Scribd logo
1 de 58
Baixar para ler offline
ADVANCED CRYSTAL REPORTS
Techniques for compiling
Annual Reports & other statistics
Chad Petrovay
Musical Instrument Museum
ADVANCED CRYSTAL REPORTS
Report
Formula
Parameters
SQL
ANNUAL REPORT
ANNUAL REPORT
ANNUAL REPORT: CR XI
ANNUAL REPORT: GROUPING
ANNUAL REPORT: FORMULAE
ANNUAL REPORT: FORMULAE
@f_artist_prefix
if isnull ({OBJECTDESCRIPTION.Prefix})
then ""
else {OBJECTDESCRIPTION.Prefix}+" "
@f_artist_suffix
if isnull ({OBJECTDESCRIPTION.Suffix})
then ", "
else " "+{OBJECTDESCRIPTION.Suffix}+", "
@f_artist
if isnull ({OBJECTDESCRIPTION.DisplayName})
then ""
else {@f_artist_prefix}+{OBJECTDESCRIPTION.DisplayName}+{@f_artist_suffix}
ANNUAL REPORT: CR XI
ANNUAL REPORT
ANNUAL REPORT: PARAMETERS
ANNUAL REPORT: RECORD SELECTION
ANNUAL REPORT: PARAMETERS
STATISTICS AT A GLANCE
STATISTICS AT A GLANCE
STATISTICS AT A GLANCE: SQL VIEW
CREATE VIEW [plugin_SAG] AS
SELECT '_____' AS grouper, '______' AS label, COUNT(*) AS value, '_' AS rank
FROM ___________ WHERE _____________________________
UNION
SELECT '2. Basic Media' AS grouper, 'Media Count - Approved' AS label, COUNT(*) AS value,
'2' AS rank FROM MediaMaster WHERE ApprovedForWeb = 1
UNION
SELECT '1. Basic Object' AS grouper, 'Object Count - Total' AS label, COUNT(*) AS value,
'1' AS rank FROM Objects
UNION
SELECT '1. Basic Object' AS grouper, 'Object Count - Virtual Records (excluding Group)' AS
label, COUNT(*) AS value, '3' AS rank FROM Objects
WHERE isVirtual = 1 AND ObjectNumber NOT LIKE 'Grp%'
UNION
SELECT '3. Object By Level' AS grouper, 'Management Level - Total' AS label, COUNT(*) AS
value, '2' AS rank FROM Objects
WHERE ObjectLevelID = 1
STATISTICS AT A GLANCE
STATISTICS AT A GLANCE: CR XI
STATISTICS AT A GLANCE: GROUP/SORT
ECLIPSE REPORT: OVERVIEW
Wishlisted
ECLIPSE REPORT
ECLIPSE REPORT
ECLIPSE REPORT: CREATE TABLE
CREATE TABLE mim_Eclipse (
[ID] int IDENTITY(1,1) NOT NULL,
[virtual] int NOT NULL,
[actual] int NOT NULL,
[free] int NOT NULL,
[TimeStamp] timestamp NULL
)
ECLIPSE REPORT
ECLIPSE REPORT: STORED PROCEDURE
CREATE PROCEDURE [do_eclipse] AS
DECLARE @virtual int, @actual int, @free int
/* Find and Record Virtual Records */
SELECT ObjectID FROM Objects
WHERE ObjectNumber LIKE 'V%‘ AND ObjectID IN (SELECT ObjectID FROM mim_activeExhObj)
SET @virtual = @@ROWCOUNT
/* Find and Record Actual Records */
SELECT ObjectID FROM Objects
WHERE ObjectNumber NOT LIKE 'V%'
SET @actual = @@ROWCOUNT
/* Find and Record Unallocated Records */
SELECT ObjectID FROM mim_voReconciliation
SET @free = @@ROWCOUNT
/* Do SQL INSERT */
INSERT INTO mim_Eclipse ( virtual, actual, free ) VALUES ( @virtual, @actual, @free )
ECLIPSE REPORT
ECLIPSE REPORT: CR XI
ECLIPSE REPORT: RECORD SELECTION
ECLIPSE REPORT: CHART
ECLIPSE REPORT: CHART
ECLIPSE REPORT: CHART
ECLIPSE REPORT: SUBREPORT
ECLIPSE SUBREPORT
ECLIPSE SUBREPORT: FORMULA
ECLIPSE SUBREPORT: GROUP SORT
ECLIPSE SUBREPORT: CHART
EXHIBITION STATUS REPORT
EXHIBITION STATUS REPORT: TMS
EXHIBITION STATUS REPORT
EXHIBITION STATUS REPORT: SQL VIEW
SELECT TX.ID AS ExhibitionID, T.Term, 1 AS type
FROM ThesXrefs TX
INNER JOIN TMSThes.dbo.Terms T ON TX.TermID = T.TermID
WHERE TX.TableID = 47 AND TX.ThesXrefTypeID = 29 AND Active = 1
UNION ALL
SELECT TX.ID AS ExhibitionID, T.Term, 2 AS type
FROM ThesXrefs TX
INNER JOIN TMSThes.dbo.Terms T ON TX.TermID = T.TermID
WHERE TX.TableID = 47 AND TX.ThesXrefTypeID = 30 AND Active = 1
UNION ALL
EXHIBITION STATUS REPORT: SQL VIEW
SELECT ExhibitionID, CONVERT(Varchar,Count(*)) As Term, 3 AS type
FROM mim_activeExhObj
GROUP BY ExhibitionID
UNION ALL
SELECT E.ExhibitionID, CONVERT(Varchar,Count(*)) As Term, 4 AS type
FROM mim_activeExhObj E
INNER JOIN Objects O ON E.ObjectID = O.ObjectID
WHERE O.ObjectNumber LIKE 'V%‘
GROUP BY E.ExhibitionID
UNION ALL
SELECT E.ExhibitionID, CONVERT(Varchar,Count(*)) As Term, 5 AS type
FROM mim_activeExhObj E
INNER JOIN Objects O ON E.ObjectID = O.ObjectID
WHERE O.ObjectNumber NOT LIKE 'V%'
GROUP BY E.ExhibitionID
EXHIBITION STATUS REPORT: SQL VIEW
CREATE VIEW [ mim_activeExhData ] AS
SELECT ExhibitionID,
MAX(CASE WHEN type = 2 AND Term = 'yes' THEN 'TRUE' ELSE 'FALSE' END) AS DataSubmission,
MAX(CASE WHEN type = 1 THEN Term ELSE NULL END) AS ExhStatus,
MAX(CASE WHEN type = 3 THEN Term ELSE 0 END) AS QtyTotal,
MAX(CASE WHEN type = 4 THEN Term ELSE 0 END) AS QtyVirtual,
MAX(CASE WHEN type = 5 THEN Term ELSE 0 END) AS QtyAcq
FROM (
/* Insert UNION ALL statements here */
) AS Data
GROUP BY ExhibitionID
EXHIBITION STATUS REPORT
EXHIBITION STATUS REPORT: CR XI
EXHIBITION STATUS REPORT: FORMULA
EXHIBITION STATUS REPORT: FORMATTING
EXHIBITION STATUS REPORT: FORMULA
EXHIBITION STATUS REPORT: FORMATTING
QUESTION & ANSWER
chad.petrovay@themim.org
http://petrovay.com/tmsblog

Mais conteúdo relacionado

Mais procurados

Sql server ___________session_20(ddl triggers)
Sql server  ___________session_20(ddl triggers)Sql server  ___________session_20(ddl triggers)
Sql server ___________session_20(ddl triggers)
Ehtisham Ali
 

Mais procurados (20)

Examples sandhiya class'
Examples sandhiya class'Examples sandhiya class'
Examples sandhiya class'
 
MEngine Overview
MEngine OverviewMEngine Overview
MEngine Overview
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
 
Linked list searching deleting inserting
Linked list searching deleting insertingLinked list searching deleting inserting
Linked list searching deleting inserting
 
StackArray stack3
StackArray stack3StackArray stack3
StackArray stack3
 
Project of data structure
Project of data structureProject of data structure
Project of data structure
 
CSharp v1.0.2
CSharp v1.0.2CSharp v1.0.2
CSharp v1.0.2
 
XKE Typeclass
XKE TypeclassXKE Typeclass
XKE Typeclass
 
Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2
 
실시간 대중교통 경로 탐색
실시간 대중교통 경로 탐색실시간 대중교통 경로 탐색
실시간 대중교통 경로 탐색
 
SQL Keywords
SQL KeywordsSQL Keywords
SQL Keywords
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
 
กลุ่ม6
กลุ่ม6กลุ่ม6
กลุ่ม6
 
Sql server ___________session_20(ddl triggers)
Sql server  ___________session_20(ddl triggers)Sql server  ___________session_20(ddl triggers)
Sql server ___________session_20(ddl triggers)
 
Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1
 
Stack push pop
Stack push popStack push pop
Stack push pop
 
Reactive Programming at Cloud-Scale and Beyond
Reactive Programming at Cloud-Scale and BeyondReactive Programming at Cloud-Scale and Beyond
Reactive Programming at Cloud-Scale and Beyond
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
 
array implementation
 array implementation array implementation
array implementation
 

Semelhante a Advanced Crystal Reports: Techniques for compiling Annual Reports & other statistics

RELATIONAL DATABASES & Database designCIS276EmployeeNumFir.docx
RELATIONAL DATABASES & Database designCIS276EmployeeNumFir.docxRELATIONAL DATABASES & Database designCIS276EmployeeNumFir.docx
RELATIONAL DATABASES & Database designCIS276EmployeeNumFir.docx
sodhi3
 
Linq Sanjay Vyas
Linq   Sanjay VyasLinq   Sanjay Vyas
Linq Sanjay Vyas
rsnarayanan
 

Semelhante a Advanced Crystal Reports: Techniques for compiling Annual Reports & other statistics (20)

Reactive clean architecture
Reactive clean architectureReactive clean architecture
Reactive clean architecture
 
Arrays
ArraysArrays
Arrays
 
Beginning Scala Svcc 2009
Beginning Scala Svcc 2009Beginning Scala Svcc 2009
Beginning Scala Svcc 2009
 
Grammarware Memes
Grammarware MemesGrammarware Memes
Grammarware Memes
 
The STL
The STLThe STL
The STL
 
Kotlin for Android Developers
Kotlin for Android DevelopersKotlin for Android Developers
Kotlin for Android Developers
 
Java Generics
Java GenericsJava Generics
Java Generics
 
Day 1
Day 1Day 1
Day 1
 
ECMAScript 5: Новое в JavaScript
ECMAScript 5: Новое в JavaScriptECMAScript 5: Новое в JavaScript
ECMAScript 5: Новое в JavaScript
 
RELATIONAL DATABASES & Database designCIS276EmployeeNumFir.docx
RELATIONAL DATABASES & Database designCIS276EmployeeNumFir.docxRELATIONAL DATABASES & Database designCIS276EmployeeNumFir.docx
RELATIONAL DATABASES & Database designCIS276EmployeeNumFir.docx
 
Linq Sanjay Vyas
Linq   Sanjay VyasLinq   Sanjay Vyas
Linq Sanjay Vyas
 
Functional microscope - Lenses in C++
Functional microscope - Lenses in C++Functional microscope - Lenses in C++
Functional microscope - Lenses in C++
 
Presentation
PresentationPresentation
Presentation
 
Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++Функциональный микроскоп: линзы в C++
Функциональный микроскоп: линзы в C++
 
RESTful API 제대로 만들기
RESTful API 제대로 만들기RESTful API 제대로 만들기
RESTful API 제대로 만들기
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
Chap 2 Arrays and Structures.ppt
Chap 2  Arrays and Structures.pptChap 2  Arrays and Structures.ppt
Chap 2 Arrays and Structures.ppt
 
Chap 2 Arrays and Structures.pptx
Chap 2  Arrays and Structures.pptxChap 2  Arrays and Structures.pptx
Chap 2 Arrays and Structures.pptx
 
Tips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET ApplicationTips and Tricks of Developing .NET Application
Tips and Tricks of Developing .NET Application
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
 

Mais de Chad Petrovay

How Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills setsHow Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills sets
Chad Petrovay
 

Mais de Chad Petrovay (8)

A Crash Course in SQL Server Administration for Reluctant Database Administra...
A Crash Course in SQL Server Administration for Reluctant Database Administra...A Crash Course in SQL Server Administration for Reluctant Database Administra...
A Crash Course in SQL Server Administration for Reluctant Database Administra...
 
Developing Dynamic Reports for TMS Using Crystal Reports
Developing Dynamic Reports for TMS Using Crystal ReportsDeveloping Dynamic Reports for TMS Using Crystal Reports
Developing Dynamic Reports for TMS Using Crystal Reports
 
How Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill SetsHow Clean is your Database? Data Scrubbing for all Skill Sets
How Clean is your Database? Data Scrubbing for all Skill Sets
 
The Museum System & Social Media: Changing their relationship status from ‘It...
The Museum System & Social Media: Changing their relationship status from ‘It...The Museum System & Social Media: Changing their relationship status from ‘It...
The Museum System & Social Media: Changing their relationship status from ‘It...
 
The Museum System (TMS) & Researchers: Synergizing Collection and Library Inf...
The Museum System (TMS) & Researchers: Synergizing Collection and Library Inf...The Museum System (TMS) & Researchers: Synergizing Collection and Library Inf...
The Museum System (TMS) & Researchers: Synergizing Collection and Library Inf...
 
How Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills setsHow Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills sets
 
The Rest of the Collection: Using virtual objects to manage abstract objects,...
The Rest of the Collection: Using virtual objects to manage abstract objects,...The Rest of the Collection: Using virtual objects to manage abstract objects,...
The Rest of the Collection: Using virtual objects to manage abstract objects,...
 
TMS as a Remote Application
TMS as a Remote ApplicationTMS as a Remote Application
TMS as a Remote Application
 

Último

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Último (20)

WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - KanchanaWSO2Con2024 - Hello Choreo Presentation - Kanchana
WSO2Con2024 - Hello Choreo Presentation - Kanchana
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 

Advanced Crystal Reports: Techniques for compiling Annual Reports & other statistics