Dynamic Report Builder - MSSQL TWA (Time Weighted Average)

This is Version 2 of the "DRB - Dynamic Report Builder". Version 1 with known bugs can be found here http://www.indusoft.com/Support/Forums/aft/1224

Mission Objective: Integrate an on-demand multi-user report builder into an Indusoft screen. 

NOTES: The attached version is not multi-user yet, I need to use the $user+Date+Time function to create user output files for each user session. Once this is done the report builder can be deployed on a server and anyone can create their own reports at the same time.

Features: 

1.) Preforms a TRUE TWA from an MSSQL Database with trend sheet generated data.

2.) Export in XLSX or CSV. Exporting in XLSX will format the report nicely.

I really hope this helps someone in the future as this took a tremendous amount of time to engineer. This report generator is fully functional but still needs minor improvements/comments. 

Future versions will include tag descriptions in the tag select grid; Option to email CSV/XLSX, Multi-User on a server instance; Spinning Hour Glass, Protection against double clicking on critical submit buttons and so on....

____________________________________________________________________________________________________________________ 

HOW TO USE THE DYNAMIC REPORT BUILDER
 
____________________________________________________________________________________________________________________ 

Step 1
: Click on the database link connection icon and connect to your "Test" Indusoft database with existing data.
 
Step 2: Click on Clear Report to refresh the database connection tags. 

Step 3: Click on refresh taglist. If your connection is good the first grid object will populate will all of your trend tags from your database. 

Step 4: Select your Start Date, End Date, and Interval. 

Step 5: Add tags! Click on a tags in the first grid object and then click on the green add tag button. 

Step 6: Run Report. 

Step 7: After you run the report a window will pop up with your data in it. If you choose to "save as xlsx" wait 5 seconds. This pop-up screen will close and open a directory with your report in it. Good Luck

Sincerely,

-The Keyboard Cowboy

Parents
  • Hi Mr Andrew,

    I try to add LINE YEAR and MONTH as the same below, but do you have any comments. please support me. thanks


    Function DRB_BuildQuery(ByVal currentTag,ByRef thisQuery)
    thisQuery(0) =""
    thisQuery(1) =""
    thisQuery(2) =""
    thisQuery(3) =""
    Dim xMin
    xMin = 1
    ' ADD Month and Year into project

    If( $DRB_INTERVAL_TYPE_NAME="Year") Then '( 1 year= 12 Month)
    xMin = 518400 * $DRB_INTERVAL_VALUE

    ElseIf( $DRB_INTERVAL_TYPE_NAME="Month") Then '( 1 Month =30 days) Example only.
    xMin = 43200 * $DRB_INTERVAL_VALUE




    ElseIf( $DRB_INTERVAL_TYPE_NAME="Day") Then
    xMin = 1440 * $DRB_INTERVAL_VALUE
    ElseIf( $DRB_INTERVAL_TYPE_NAME="Hour") Then
    xMin = 60 * $DRB_INTERVAL_VALUE
    ElseIf($DRB_INTERVAL_TYPE_NAME="Minute") Then
    xMin = $DRB_INTERVAL_VALUE
    End If
Reply
  • Hi Mr Andrew,

    I try to add LINE YEAR and MONTH as the same below, but do you have any comments. please support me. thanks


    Function DRB_BuildQuery(ByVal currentTag,ByRef thisQuery)
    thisQuery(0) =""
    thisQuery(1) =""
    thisQuery(2) =""
    thisQuery(3) =""
    Dim xMin
    xMin = 1
    ' ADD Month and Year into project

    If( $DRB_INTERVAL_TYPE_NAME="Year") Then '( 1 year= 12 Month)
    xMin = 518400 * $DRB_INTERVAL_VALUE

    ElseIf( $DRB_INTERVAL_TYPE_NAME="Month") Then '( 1 Month =30 days) Example only.
    xMin = 43200 * $DRB_INTERVAL_VALUE




    ElseIf( $DRB_INTERVAL_TYPE_NAME="Day") Then
    xMin = 1440 * $DRB_INTERVAL_VALUE
    ElseIf( $DRB_INTERVAL_TYPE_NAME="Hour") Then
    xMin = 60 * $DRB_INTERVAL_VALUE
    ElseIf($DRB_INTERVAL_TYPE_NAME="Minute") Then
    xMin = $DRB_INTERVAL_VALUE
    End If
Children
No Data