Trip and Idle report with Ignition
Adding Ignition values to the Trip and Idle report.
- Note: this report has been replaced by a more efficient version. How to install, follow this guide.
This modification will allow you to take into account the Ignition status into your Trip and Idle reports.
The standard Trip and Idle report generates a new row of information every time either of the two statuses has changed.
With this modification we will have three different possible results in our report.
|Standard Trip and Idle Report:||Trip and Idle Report with Ignition:|
- A device compatible with the Ignition signal (check the devices link)
Update 2017-01-30: You can setup a similar report much easier. Click here for more information.
These are the steps to setup our modification:
- Map the Ignition input on the Device Mapper
- Creating a new Data Provider
- Generating a new report with the new Data Provider
- Modify the report Layout
- Enable the new report into your application
- Make the report visible to the users inside the application
1. Map the Ignition input on the Device Mapper
The first thing we are going to do is to Map the Ignition input in the Device Mapper:
To do that you need to log in into the Application and go to Admin-> Device Mappers and verify the Ignition signal is mapped to the Ignition variable on the right.
2. Creating a new Data Provider
A new Data Provider has to be created for this report copy to include the Ignition signal.
On the Site Admin page go to Reporting -> Manage Data Providers
Select Copy of Distance01 and click on Next
Now rename the new data provider to Distance01withIgnition and also, select Value -> Add
Now you have to select the variable Ignition in the Field column. You can rename the value on the Name column, from New to Ignition as well. To do that click on Insert. At the end the configuration should look like this:
In the same screen, we also need to add a new value on Select when data should be written. Click on Add on Column value change. This will allow generating a new row of data when the Ignition signal has changed.
In Monitor column, select now the Ignition value.
The whole configuration should look like this:
To end, click on Save.
3. Generating a new report with the new Data Provider
Go to the Site Admin page, then Reporting -> New. Create a copy of the Trip and Idle (detailed).
Select the new copy of the report by clicking in View. On the bottom you’ll be able to see Query Editor, just click on it:
Now click on Report Queries -> Distance Detailed on the left of the screen. You should now be able to see the whole query.
Copy the entire query code to a Notepad, and replace it with the following code (MYSQL), for MsSQL check this post:
Don’t forget to click on Save to take changes into account.
4. Modify the report Layout
Now that we have the Ignition data in the query, we have to include it into the report layout.
We did three basic modifications to the standard layout:
A) Add a new row with the text Total Duration Parking: and next to it the following code: $sum([ParkingTime]).
In the same cell, right click on it, select Unit > SHORT_TIME_SPAN in order to preserve the right time format for this new cell.
B) You can add some description of the Parking status by adding a new chart field type.
C) Modify the column name to Trip/Idle/Parking with the following code below:
The result should look like this:
Finalize by clicking on Save at the bottom.
5. Enable the new report into your application
Select your application in the Site Admin under Applications (don’t log into the application, just click on it to see its properties). Go to the bottom and search for the category Reporting -> _CreateReport, and enable your new application.
6. Make the report visible to the users inside the application
Now log in into the application with an Admin user, and go to Reports -> Manage Reports, select the new one and click on Open
Now select the parameters you want to to set up for this report by default and click Save.
If you have data in the selected dates your report should now be able to display the three possible different statuses of the vehicle:
To make this solution work in an MsSQL environment, check out this forum post:
- Customize your GpsGate Server - Reports
- Reporting Manual
- Customizing Reports, Best Practices
- Trip and idle report with temperature
- How to add Driver information to your Trip and Idle report
Discuss this blog post on the forum please