Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
Copyright © 2010-2011, Software for Professionals, LLC
Sunset Reports is a trademark of Software for Professionals, LLC
Sunset Reports™
Your “First” Report
This document will take you through the entire process of creating a simple
report and putting it in the repository and having it updated each night.
The steps involved include:
Setting up the Data Source
Creating a Report Design
Creating a Report Definition
Adding it to the Queue
Processing the Report
Please refer to the User Manual for additional details if needed beyond what is
provided here.
Our report will be a report for product sales that will include the sales for the previous day. It will
be organized by product category and be sorted to show the products with the highest sales first.
It will be scheduled to run in the morning at 2:00 am and be put in the repository for viewing by
staff on the following day. It will not run for weekends. The data will come from the sample
nwind.mdb MS Access database.
Sunset Reports – White Paper
Page 2
Setting up the Data Source
The database contains a query called ProductSalesByDay which we will use for this report. It
contains 4 fields: CategoryName, SalesDate, ProductName, and SalesAmount. (Note: Because
data is not being added to the sample database, the query has a calculation to adjust the dates so
there is always sales on the current date.)
1. From the Main Menu in Sunset Reports, choose File – New Data Source. You will get a
blank Data Source Detail form.
2. Enter “Daily Sales” as the Data Source Name
3. Select “Access” as the Data Source Type
4. Click on the “Browse for
Access File” button and
choose the file
“nwind.mdb” which
should be located in the
Sunset Reports folder in
your My Documents
folder.
5. Use the dropdown list for
Table Query View and
select
“ProductSalesByDay”.
6. You can click on the
“View Data” button to
confirm the correct data
connection.
The completed Data Source
Detail form should look like the
figure.
Close the form.
Sunset Reports – White Paper
Page 3
Creating a Report Design
1. On the Preferences form, go to the Program tab, and make sure the “Existing Data
Source” under When starting a new Report Design start with... is selected.
2. From the Main Menu, choose File – New Report Design. You will be prompted to Select a
Data Source. Choose “Daily Sales”. You will now see the Report Designer with a blank
report. (Note: this may take several seconds depending on the speed of your computer)
3. Click on the Field List tab and expand the branch “ProductSalesByDay”. You should see
the form as shown in the following figure.
Sunset Reports – White Paper
Page 4
4. We will use the Report Wizard to create this first report. Click on the top-left corner of the
Design Panel (Report Smart Tag) to see the Report Tasks and select “Design in Report
Wizard”
5. Choose “Standard Report” and click next.
6. Choose all the fields by clicking on the double right pointing arrows. The Report Wizard
should look like the following
Click Next
7. Add CategoryName as a group, by selecting that field and pressing the single right arrow,
then click Next.
8. Choose the “Outline 1” layout and Portrait orientation, click Next
Sunset Reports – White Paper
Page 5
9. Leave the style at Bold, and click Next
10. Enter the title “Daily Sales Summary” and click Finish. The Report Designer should look
like the following:
11. All that is left to do is to sort the products with the highest Sales Amount first. Click on the
“Group and Sort” tab located on the bottom left.. Press the “Add a Sort” button, choose
SalesAmount. Change the Sort Order to Descending. The Group and Sort tab should
now look like this.
12. Click on the Design Panel (Area where the report is shown) to close the Group and Sort
Tab.
13. At this point you can select the “Preview” tab and see the report with data.
14. Click on the Save button on the Main Toolbar. Enter the report design name “Daily Sales
Summary”.
Sunset Reports – White Paper
Page 6
Creating a Report Definition
1. From the Main Menu , choose File – New Report Definition. You will now see a blank
Report Definition Detail form.
2. Enter the Report Definition Name: “Sales Summary”
3. Choose the “Daily Sales Summary” from the drop down list for the Report Design.
4. Enter “Prior Day Sales Summary” for Title1
5. Click the green checkbox button to save your entries.
6. On the Parameters tab, select the Date tab.
7. Click the green + button on the bottom of the Date tab.
Sunset Reports – White Paper
Page 7
8. Enter the Parameter Name “DateRange” on the newly created blank line. (no spaces are
allowed in the parameter name)
9. Click on the down arrow button near the label “Dynamic Date” and choose “Yesterday”.
10. The Report Definition Detail form should now look like this...
11. Click on the Design button next to the field Report Design. You are going to do this to
make the report design aware of the new parameter you just created.
12. The Report Designer should now open up. Click on the “Load Parameters” button on the
Main Toolbar.
13. Select the Field List and expand the branch labeled “Parameters”. It should look like the
following..
Sunset Reports – White Paper
Page 8
Note that the Global, My, and Data parameters have been added as well as Title1 and
Title2. In particular note that in addition to the parameter DateRange, two other
parameters have been added: DateRange_Start and DateRange_End. The reason for
this is as follows: The parameter DateRange is a string type and will contain the word
“Yesterday”. To actually use a Date type parameter, the DateRange_Start and
DateRange_End parameters are automatically added. With these you can work with the
actual dates.
Sunset Reports – White Paper
Page 9
14. To filter the report by the parameter, Click on the Report Smart Tag and choose the Build
button for the Filter String
You will then get the FilterString Editor.
15. Using the controls on the FilterString Editor add the following filter...
and then press OK
16. At this point we are going to add two parameters so they print on the report. Expand the
reportHeaderBand by grabbing the bottom edge and dragging it down. Grab the
Company_Name parameter from the Field List and drag it to just undernieth the label
control with Daily Sales Summary displayed. Grab the right edge of this new control and
Sunset Reports – White Paper
Page 10
drag it to make it wider. It should look like this...
17. Now we want to replace the report title “Daily Sales Summary” with the Title1 parameter.
Select the Daily Sales Summary control, click on the Smart Tag on the top right corner.
This will give you the Label Tasks list. Use the drop down list for Data Binding and
choose the parameter Title1.
18. Save the Report and return to the Report Definition Detail form.
19. Close the Report Definition Detail form.
Copying a Report Definition
We now have a report definition that will give us yesterday’s sales. As an extra little task, let’s
create a similar report that will give us the same information for last week. Because of the
flexibility of our original report design, we only need to copy the report definition and make some
minor changes.
1. Click on the Report Definitions block on the Navigator or use the pull-down menu item Edit
– Report Definitions. You will see a list of report definitions, find the one called Sales
Summary which we just created.
2. Select that report definition by clicking on the blank section to the left of the row. Now
press the Copy button. You should see a new Report Definition on the list called “Sales
Summary (copy).
3. Double click on the left most section of the row for that copy. The Report Definition Detail
form should appear.
4. Rename the report definition to: Sales Summary Last Week
5. Do not change the Report Design
6. Change Title1 to: Prior Week Sales Summary
Sunset Reports – White Paper
Page 11
7. Go to the Parameters tab, select the Date parameter, and change “Yesterday” to “Last
Week”. You can simply type it, or choose from a list by clicking on Dynamic Date.
8. Your changes should look like this:
9. Close the form and then Refresh the Report Definition List.
Sunset Reports – White Paper
Page 12
10. At this point you can press the Preview button to see the Sales Summary or Sales
Summary Last Week reports.
11. Close the Report Definition List form.
Sunset Reports – White Paper
Page 13
Adding it to the Queue
We want to run the “Sales Summary” report every night for the prior day’s sales except for
weekends.
1. Click on the top icon on the Browse Reports box on the Navigator or choose the pull-down
menu item View- Reports-List.
2. Locate the report definition just created named “Sales Summary”. Select the report
definition and then press “Add to Queue”.
3. Change the time to run the report to 2:00:00AM.
4. Set any other appropriate entries like format and destination folder. These initially are set
based on the preferences previously setup. Your form should look similar to this...
5. Press the Add to Queue button.
6. Close the Reports list form.
7. Click on the bottom icon on the Report Queue box on the Navigator or choose the pull-
down menu item View- Report Queue-Calendar.
8. Locate the queue entry we just added. The calendar comes up with the current date and
unless you changed that, you should be able to find the entry by scrolling back to 2AM.
Note that the report has a duration of 5 minutes. That is just a default so the appointment
has some duration. You can change it, but it will not have any effect on anything but the
Sunset Reports – White Paper
Page 14
appearance on the calendar views.
9. Double click on the entry, the appointment form should be appear. Since we want the
report to run at 2:00AM on Tues through Sat (Tues will report on Mon, etc.), click on the
“Recurrence” button.
10. On the Appointment Recurrence form you should change the Recurrence Pattern to be
weekly and check off Tuesday through Saturday.
Sunset Reports – White Paper
Page 15
11. Set the Range of recurrence as appropriate or just leave the defaults as is.
12. Click OK and then OK on the Appointment form.
13. Change the view to Month View by right mouse clicking on the Calendar. Confirm the
report is scheduled for the appropriate days.
14. Close the Report Queue Calendar.
Sunset Reports – White Paper
Page 16
Processing the Report
Now that the report is in the Queue, we just need to setup the Report Processor to run when
needed to process the report. Since it is unlikely you will be logged onto your computer at
2:00AM with Sunset Report running, you should use the Report Processor Service to run the
report in the background.
To control the operation of the service, you can click on the Report Processor Service on the
Navigator, or use the pull down menu Tools - Report Processor Service. You will then see the
form in the next figure.
For the purposes of this example, we will ignore the Incoming Email Settings. The only items you
need to do is set the timing of the option “Check report queue every...”. Set it as often as you will
need, but for this example, setting it to 5 or 10 minutes will be fine. Then make sure the service is
running by pressing the Start button. (The Start button will not work on Windows Vista or Windows
7 if User Account Control settings are set high. You will need to start the service from the
Windows Management screen, see user manual for more details). Press OK on this form and you
are done and the report will run at about 2:00 am for each day scheduled.
Congratuations, you have gone through all the major steps using Sunset Reports to create
a report and schedule it’s processing. There are so many more functions and features for
you to learn and explore. Have fun!
For more information visit: www.sunsetreports.com