Top Banner
Report Writing Using SSRS Monday, May 22, 2017 9:00 AM – 4:00 PM Elizabeth Wojcik, Computer System Innovations Trisha Haas, Computer System Innovations
39

Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

Sep 17, 2018

Download

Documents

vuongque
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

Report Writing Using SSRS

Monday, May 22, 20179:00 AM – 4:00 PM

Elizabeth Wojcik, Computer System InnovationsTrisha Haas, Computer System Innovations

Page 2: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Beginner – never built an SSRS report• Intermediate – built simple reports, edited reports. • Advanced – built more complicated reports with multiple

formulas and datasets• Expert – building from SQL code mostly

What do you know?

Page 3: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• SSRS stands for SQL Server Reporting Services– This is the reporting tool that can be used to create and modify

SSRS reports

• SSRS is a server based report generation software• Similar to Crystal Reports, but is much more robust

– Crystal creates a rpt file– SSRS creates a rdl file

What is SSRS?

Page 4: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• SSRS is replacing Crystal as the report engine for iMIS– All new reports written by ASI are SSRS reports

• You already own SSRS with SQL server, but recent versions of Crystal cost your organization $$$

• Enhanced tools compared to Crystal• Could offer more flexibility over IQA as well as speed

Why use SSRS?

Page 5: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Create a Request Process – What is the end goal?– What are you looking to do with this data?– Who is your audience?– Where do you want to access this report?– Will this report be used long term or one time only?

Requirements Gathering

Page 6: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Table and Field naming best practices– Table names

• Start with a prefix– Demo_Communication– CSI_Membership_Stats– DO NOT use “Name_”

• Use upper and lower case• No spaces! Only underscore

– Field names• Start with a prefix that is an abbreviation of the table name

– CM_OPT_IN• Use ALL CAPS• No spaces! Only underscore

Let’s take a step back

Page 7: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

Visual Studio vs. Report Builder

• Visual Studio • Report Builder

For more information: https://technet.microsoft.com/en-us/library/dd207010(v=sql.105).aspx

Page 8: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Visual Studio• BIDS (Business Intelligence Development Studio)• SSRS

Getting Familiar with SSRS

Page 9: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Solution• Project• RDL

Getting Familiar with SSRS, cont.

Page 10: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Report Data Pane• Solution Explorer• Properties• Server Explorer• Toolbox

Getting Familiar with SSRS, cont.

Page 11: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• RiSE• Report Manager• Other tools with Microsoft Report Viewer control (ICE)

Ways to Access/Share Data

Page 12: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Create and edit an SSRS report with the Report Wizard• Modify an existing iMIS SSRS report

– Where to find– Best practices for cloning

• Create an SSRS report without the Report Wizard• Crystal to SSRS – use caution!

Different Ways to Create/Modify SSRS Reports

Page 13: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• iMIS Table Structure

• Basic expressions– Select * from Name

• Report Style– Tabular vs. Matrix

vs. List

• Creating a solution, project and shared data source (Handout)

Creating Basic Reports

Page 14: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Using the Report Wizard

• Helpful tool for beginner to advanced users

• Follow along with the Handout for step by step instructions

Creating Basic Reports, cont.

Page 15: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

Basic Filter Examples

• Member_type=‘MEM’• Status=‘A’• State IN(‘IL’,’MO’,’TN’)

– “= X” for equal to– “<>X” for not equal to– “>X” for greater than– “<X” for less than– “is in (X,Y,Z)” for multi values– “not in (X,Y,Z)” to exclude

multi values

Page 16: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Create a report using the Report Wizard – use the Handout as a quick reference guide

• Use the following tables– Name– 1 custom user defined table from your database

• Use the following filters– Member type = Select one of your member types– Status = Active– One other filter of your choice

• Display– Full name– Member type– State– One or more fields from your custom user defined table

Lab 1

Page 17: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

Questions before lunch?

Page 18: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Follow along with Handout for step by step instructions– Importing .rdl into iMIS– Creating Content Record with a Report Display content item– Deploying the new content into the site

Loading Reports to RiSE

Page 19: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Follow along with the Handout for step by step instructions

• Overview:– Download RDL file from

sample IQA– Modify report to add

chart– Save– Upload report back into

iMIS

Using an IQA as a Data Source

Page 20: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• When wouldn’t you use the wizard?– List/Freeform Report– Using a report to execute a stored procedure– You have SQL experience/experience building views– Have the SQL code ready to dump into a report

• Follow along with the Handout for step by step instructions

Creating a Report Without the Wizard

Page 21: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Adding Basic Parameters– More than one way to add a parameter:

• Edit Query• Via Parameters in Report Data Pane

• Date Parameters– Different data types

Editing Reports

Page 22: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• When should you add a second dataset?– Creating a “Pick List” for a parameter

• Setting Available Values

• Cascading Parameters• Default Values• Multi-select Parameter

– IN NOT =

Editing Reports, cont.

Page 23: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

Using the report you created in Lab 1:• Add a parameter to your report• Set default values for the parameter

Extra credit:• Using your custom table, or the name table, determine what

parameters could work together. – Examples: Region>Chapters, Member Type>Category, Company Member

Type>Member Type, etc.• Add a second dataset that queries for one parameter within the other

– Example: Select distinct demo_chapter.ChapterName where demo_chapter.region=@Region

Extra, extra credit:• Make one parameter multi-select

Lab 2

Page 24: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Grouping– Best/easiest way is through wizard– Adding the Row Groups Pane is key– Using grouping to Drilldown in report– Adding a calculation within a group

• Adding headers and images• Using IF/THEN for conditional formatting

– =IIF(Fields!Fieldname.value=‘1’,’RED’,’GREEN’)– =IIF(RowNumber(Nothing) Mod2=0,”red”,”white”)

• Using Properties Pane to change fonts, colors, etc.• Using textbox properties to easily format numbers, etc.

Editing Reports, cont.

Page 25: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

Using your existing report from Labs 1 and 2:• Add a header• Add your company logo in the header• Add grouping by one of your custom fields• Set up your report so that you can drilldown within your

field of choice• Use the Properties Pane to:

– Change font colors– Add conditional formatting to one of your custom fields– Alternate row colors

Lab 3

Page 26: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• SQL Joins

Table Linking

Page 27: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Editing linking within Wizard

Table Linking

Page 28: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Using General Lookup Validation Tables– Example (insert before last table join):

(SELECT CODE, DESCRIPTIONFROM Gen_Tables AS Gen_Tables_1WHERE (TABLE_NAME = 'CM_TYPE')) AS CMType ON

Demo_Communication.CM_TYPE = CMType.CODELEFT OUTER JOIN

Table Linking, cont.

Page 29: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Create a new report with or without the wizard:• Use the following tables

– Name– 1 custom user defined table from your database

• Filter to only display records from one state of your choice• Join the Activity Table• Add a filter for a specific Activity Type of your choice

– Examples: Committee, Call, Gift• Add all activity information to report

– Display everyone from name table, regardless of whether or not they have row in activity table for your activity type

• *HINT* Remember the different types of joins• Group by one field from the activity table

Lab 4

Page 30: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• In a drilldown report, a user clicks a plus or minus button to expand or collapse a section of a report to show detail data in place. In a drill-through report, the user clicks a link for a summary value, and this opens a separate, related report to show detail data. The detail data is only retrieved when the detail report runs. Drill-through reports typically require fewer resources than drilldown reports.

• Remember: The report you click through TO must be created first

Drill down vs. Drill Through

Page 31: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Follow along with Handout for step by step instructions• Remember: The names in the parameter list must match

the expected parameters in the target report exactly. – For example, parameter names must match by case. If the names

do not match, or if an expected parameter is not listed, the drill through report fails.

Advanced Report – Drill Through

Page 32: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Create your own drill through report• Objective: Create an event report that displays all

registrants for an event of your choosing. When you click on the order number, you are able to drill through to the details of their registration.

• Create “To” report first that has all data from table– *HINT* use ORDER_LINES table

• Create “Main” report that has all registrants for a specific meeting– *HINT* use ORDER_MEET table

• Create drill-through action on order number of main report• Format your reports using the Properties Pane

Lab 5

Page 33: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• The UNION operator combines result-set of two or more SELECT statements

• Caveats– Each select in a UNION

must have the same number of columns

– Each column must have similar data types

– Columns in each SELECT statement must be in the same order

Advanced – Union Statements

Page 34: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Deploy reports to report server:– Set target URL

under report project

– Deploy reports to server with 2 mouse clicks

Deploying Reports

Page 35: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• A Reporting Services subscription is a configuration that delivers a report at a specific time or in response to an event, and in a file format that you specify.

• Can create multiple subscriptions for a single report

• NOT available in every edition of SQL server

Using Subscriptions

Page 36: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• If/Then/Else– =IIF(Fields!Fieldname.value='Jupiter',’Planet’,’Not Planet’)– Can be used for conditional formatting in tangent with Properties Pane

• =IIF(Fields!Fieldname.value=‘1’,’RED’,’GREEN’)• Math

– Not Equal <>– Round =Round(1.3)– Sum =SUM(Fields!amount.value)– Count

• Today– Similar to getdate(), =Today()

• String Functions– Is one of IN(‘001’,’002’,’003’)– Is NOT one of NOT IN(‘001’,’002’,’003’)– Concatenation with carriage return =Fields!FirstName.value & vbCrLf &

Fields!LastName.value

Handy Formulas

Page 37: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

• Do you have reports you need to build?• Do you have reports you have been trying to edit?• Do you need to add a formula or parameter to an existing

report?• What other questions do you have?

Lab Time

Page 39: Report Writing Using-SSRS - niug.org · • SSRS stands for SQL Server Reporting Services – This is the reporting tool that can be used to create and modify SSRS reports • SSRS

Strategic Partners

Corporate PartnersAmericaneagle.com • Ascension Technology Solutions, LLC • Association Technologies, Inc. • Bursting Silver CadmiumCD • enSYNC Corporation • Informz • ISG Solutions • MemberPrime • RSM US LLP • Visual Antidote

Event PartnersArmstrong Enterprise Communications • Computer System Innovations • C Systems Global • iFINITY

Intuitive Business Concepts • Lane Services, LLC • Source of Knowledge (Official Recording Partner) • TGD Communications

Thank You To Our Sponsors