How to Create Reports with filtering preset date ranges

How to Create Reports with filtering preset date ranges

More Information

In order to filter a report using preset date ranges you must perform two steps. The first is to setup your

query with special field specifiers that tell the report writer where to insert the dates. The second step is to

write code that replaces the field specifiers in your query with actual date values.

Step 1

  1. Use the Query Builder to create and edit the query as required for your report. Insert actual date ranges where required for testing.
  2. Once the report have been created, edit the query and replace the actual dates with special field specifiers. For example replace the starting date with <<startdate>> and the end date with <<enddate>>.

Step 2

  1. From the View menu click Code.
  2. From the section list select Document.
  3. From the event list select OnReportStart.
  4. Add the following code to the OnReportStart procedure.

rpt.Sections("Detail").Controls("DataControl1").Source =

Replace(rpt.Sections("Detail").Controls("DataControl1").Source,"<<startdate>>",CStr(swcsAssistant.Get

Date(9)))

rpt.Sections("Detail").Controls("DataControl1").Source =

Replace(rpt.Sections("Detail").Controls("DataControl1").Source,"<<enddate>>",CStr(swcsAssistant.Get

Date(10)))

Replace GetDate(9) and GetDate(10) with the specific values you need. See Notes for more information.


Notes

  • Supported GetDate values:

1 = Last month start date

2 = Last month end date

3 = Last week start date

4 = Last week end date

5 = Month start date; Pass a date as the first parameter.

6 = Month end date; Pass a date as the first parameter.

7 = Current month start date

8 = Current month end date

9 = Current week start date

10 = Current week end date

11 = Week start date; Pass a date as the first parameter.

12 = Week end date; Pass a date as the first parameter.

13 = Recent start date (3 weeks ago)

14 = Recent end date (3 weeks from now)

15 = Today start date

16 = Today end date

17 = Yesterday start date

18 = Yesterday end date

19 = This year start date

20 = This year end date

APPLIES TO

  • Solatech Report Writer 1.0
  • Solatech Report Writer 1.1

    • Related Articles

    • Using the Reports Center

      Summary Solatech Focus and DOS users have the ability to run reports from their system. The types of reports available will vary by user type. In this knowledge base article, we will describe how to run, view and export reports that can be opened in ...
    • Running Reports

      More Information These navigation and entry instructions may not be the only way to complete the desired task.  For more in-depth explanations, any related articles will follow the instructions as links. Steps From the Reports tab on the main ...
    • How to create, modify and setup production labels

      This article explains how to create, add and modify custom production labels.  Solatech provides default labels in the software; however, they cannot be customized.  Below are the steps for creating a new label that can be modified to fit specific ...
    • How to customize reports

      Summary Solatech Focus and DOS users can create custom versions of reports available in the Report Center. This knowledge base explains the process of creating a custom version of a stock report. Instructions From the Report center, select a report ...
    • How to Modify Process Reports in SalesPRO

      Summary This article will explain how to tailor delivered Process Reports for your company-specific information.  More Information There are common sections defined as tabs in the Modify Report Layout window.  Not all will apply for every report. ...