Presentation is loading. Please wait.

Presentation is loading. Please wait.

SqlReports Dean Dahlvang PSUG-MO March 2010. About Dean Dean Dahlvang Director of Administrative Technology for the Proctor.

Similar presentations


Presentation on theme: "SqlReports Dean Dahlvang PSUG-MO March 2010. About Dean Dean Dahlvang Director of Administrative Technology for the Proctor."— Presentation transcript:

1 sqlReports Dean Dahlvang PSUG-MO March 2010

2 About Dean Dean Dahlvang (ddahlvan@proctor.k12.mn.us) Director of Administrative Technology for the Proctor Public Schools (just outside of Duluth, Minnesota at the tip of Lake Superior). PowerSchool Admin for 9 years, PowerSchool contracted state reporting programmer for the last 4 years. I have never used a wood chipper.

3 What is sqlReports? sqlReports is a simple way of creating sql queries inside of PowerSchool without the need to have a traditional sql client and odbc access. Both of those things definitely help however. It allows you to create queries that are available to end users to execute. It is like a fancy List Students function only you can query any table or view, save the query for repeated use and export the query and give it to goofy Uncle Eugene at Thanksgiving.

4 Downloading sqlReports sqlReports can be downloaded from the PowerDataSolutions website: – www.powerdatasolutions.org You will need to create an account in order to login and download anything from PDS

5 Installing sqlReports After downloading the zip file from PDS, uncompress it and place the sqlReports folder in the admin folder of your custom web_root. For more details on adding custom pages see the following: – Link to pds for custom pages

6 Adding sqlReport to the Reports Menu In order to quickly access sqlReports, it is nice to add it to the main reports menu. This is not required but certainly makes navigation easier. Modify admin/reports/reporttabs.html ~[if.~[gpv:repType]=sqlReports]sqlReports[else] sqlReports [/if]

7 Using sqlReports Now that sqlReports is installed, how do we use it? Navigate to Reports and select sqlReports from the tabs. In order to create a new report your user account needs to be part of Group 9 (Administrators). Click the link to Create a new sqlReport link.

8 A New sqlReport First thing – try using the sqlReports help in the upper right corner if you get stuck A very simple report to list teachers Report Name: Teacher List Report Title: Teacher List Report Description: Teacher List Report Header: Name Email sql Query: select lastfirst, email_addr from teachers Next…the tricky part

9 Fixing the sql to Work with sqlReports Once the raw sql is entered (this is where a traditional query tool is helpful), we need to tag the command to work with sqlReports. Tagging the sql will basically turn the query that may produce multiple columns of data in to one that produces just ONE column of data with the proper web table tags included. To tag the sql, just click the Add Tags link.

10 More on Tagging the sql Initially our sql looked like: – select lastfirst, email_addr from teachers Now it looks like this: – select ' '|| lastfirst||' '|| email_addr||' ' from teachers Notice the tags and the || (pipes). This helps form the columns for the tlist_sql that is running the show. Once the sql is tagged, submit our first sqlReport.

11 Running the sqlReport From the sqlReports menu, click the name of the report (Teacher List). A screen appears to execute the sql. If we would have specified parameters for the report, we could have entered them here. Click submit to see the report in action. *Poof* instant report.

12 Lets Try Parameters Suppose our list of teachers should have been selected based on their schoolid. We can do that with the parameters. We can use up to 5 total parameters with sqlReports. Edit the Teachers List report by clicking the Edit link on the right side.

13 Parameters Modify the sql Query to look like this: – select lastfirst, email_addr, schoolid from teachers where schoolid in (%param1%) Adding the schoolid as a select field makes sense, what about the where clause? Using the in function allows for multiple comma delimited options. The %param1% code is sqlReports way of handling the parameter 1. Use %param2%, etc for more parameters. Be sure to tag the sql and add Schoolid to the header!

14 More on Parameters In the Optional Parameters section, give parameter 1 a Name to Display (like School Number). Also, set a default value, if you want one. Submit the page to save the report.

15 Running a Parameter Report Back the sqlReports menu, click the Teacher List report to execute it. A page appears asking for the School Number and may have a default value already entered. Make sure we have a value in the School Number field and submit this page. The resulting report should be a list of teachers for the school number selected.

16 Advanced Features UnTag – Tries to remove previous tagging and populates the parameters of the sql. This can then be copy and pasted in to a sql query tool. Student Selections – obviously this is for student based queries. Turning on the check box actives the Student Selection Query. This query is basically identical to the main query except that it just selects DCID.

17 Wait! There are Even More Advanced Features Include Row Number – adds row numbers (huh? Who would have thought?) Open in a New Window Display Debug Info – displays the exact query just before it is run through the tlist_sql command Last Run Info – identifies is the report is used often

18 Importing and Exporting To export a query in sqlReports, simply just edit the query. At the bottom, right click on the link to export the query and choose Save As to save the query in a text file format. To import a query, open an exported text file with your favorite editor. Copy the entire contents to the clipboard. Select the Import a new sqlReport option and paste the query in the text box provided. Submit the change and the query is now imported.

19 Let’s Look at Some Examples The Birthday List The F List – This includes the Student Selection Function


Download ppt "SqlReports Dean Dahlvang PSUG-MO March 2010. About Dean Dean Dahlvang Director of Administrative Technology for the Proctor."

Similar presentations


Ads by Google