TACTIC Open Source
How to make custom report in Tactic? - Printable Version

+- TACTIC Open Source (http://forum.southpawtech.com)
+-- Forum: TACTIC Open Source (http://forum.southpawtech.com/forumdisplay.php?fid=3)
+--- Forum: TACTIC Discussion (http://forum.southpawtech.com/forumdisplay.php?fid=4)
+--- Thread: How to make custom report in Tactic? (/showthread.php?tid=10)

Pages: 1 2


How to make custom report in Tactic? - EricTsuei - 10-12-2019

Hi
I have look for the docs, and can't find any samples to make custom report.
can you show me some samples?
like chart difference pipeline status, or total count or sum some custom columns by certain filters?


RE: How to make custom report in Tactic? - listy - 10-12-2019

You can see how it is made in source codes, also check out Report samples.

Here you can find widget, and use it as boilerplate:
tactic.ui.chart.CalendarChartWdg


RE: How to make custom report in Tactic? - EricTsuei - 10-14-2019

I am sorry but I can't find any info about CalendarChartWdg, in all pdfs.
is there any samples of this wdg?

and I am thinking , this "chart.SObjectChartWdg" wdg should more useful for my case.


RE: How to make custom report in Tactic? - remkonoteboom - 10-15-2019

It not very well documented. We have a bunch of old examples in xml format in the file:

$TACTIC_INSTALL_DIR/src/tactic/ui/config/reports-conf.xml

They are in an old format using LinkWdg, but you can translate it pretty easily:

For example:

<element name='weekly_tasks_completed' title='Weekly Tasks Completed' image="GRAPH_BAR_04" description='Task count completed each week'>
<display class="LinkWdg">
<class_name>tactic.ui.chart.CalendarChartWdg</class_name>
<title>Task Completed Chart</title>
<y_title># Tasks</y_title>
<search_type>sthpw/task</search_type>
<start_date>{$THIS_YEAR}</start_date>
<elements>{@COUNT()}</elements>
<column>actual_end_date</column>
<chart_type>bar</chart_type>
</display>
</element>

The current format does not use "LinkWdg" and is translated as follows:

<element name='weekly_tasks_completed' title='Weekly Tasks Completed' image="GRAPH_BAR_04" description='Task count completed each week'>
<display class="tactic.ui.chart.CalendarChartWdg">
<title>Task Completed Chart</title>
<y_title># Tasks</y_title>
<search_type>sthpw/task</search_type>
<start_date>{$THIS_YEAR}</start_date>
<elements>{@COUNT()}</elements>
<column>actual_end_date</column>
<chart_type>bar</chart_type>
</display>
</element>

... which can be used directly in a Custom Layout

or you can just use straight Python code:

widget = CalendarChartWdg(
title="Task Completed Chart",
y_title="# Tasks",
search_type="sthpw/task",
start_date="{$THIS_YEAR}",
elements="{@COUNT()}",
column="actual_end_date".
chart_type="bar"
)


RE: How to make custom report in Tactic? - EricTsuei - 10-16-2019

I just want to add some graph like attachment, 
this is the graph I create in shotgun.
I can count, sum all values that I need.
display values in bars.
please see for the attachment, graph and graph definition.
Can I make some graph in tactic? with python or html  in custom layout?


RE: How to make custom report in Tactic? - remkonoteboom - 10-16-2019

This will do something similar.

<element>
<display class="tactic.ui.chart.SObjectChartWdg">
<title>Number of check-ins per user</title>
<chart_type>bar</chart_type>
<expression>@SOBJECT(sthpw/login)</expression>
<x_axis>login</x_axis>
<elements>{@COUNT(sthpw/task['status','Pending'])}|{@COUNT(sthpw/task['status','In Progress'])}</elements>
<rotate_x_axis>true</rotate_x_axis>
</display>
</element>

It's a bit cryptic, but if you know the expression language, you could graph almost any information. We haven't really build a fancy front end for this. For something better looking, you could add this to a custom layout and window dress it.


RE: How to make custom report in Tactic? - EricTsuei - 10-18-2019

thank you
I have create some graph finally.
but this can't work:
<elements>{@SUM(production_management/main_page['budget'])}</elements>

and need to change to this:
<elements>{@sum(production_management/main_page.budget)}</elements>

don know why.

but can we do some more? like display sum or count value at the top of each bar?


RE: How to make custom report in Tactic? - Celton McGrath - 10-18-2019

(10-18-2019, 01:12 AM)EricTsuei Wrote: thank you
I have create some graph finally.
but this can't work:
<elements>{@SUM(production_management/main_page['budget'])}</elements>

and need to change to this:
<elements>{@sum(production_management/main_page.budget)}</elements>

don know why.

but can we do some more? like display sum or count value at the top of each bar?

In the TEL (TACTIC Expression Language), square brackets are used for filters and SQL operators

ie. "[<column>, <value>]"
ie. @SOBJECT(prod/shot.sthpw/task['@ORDER_BY','process']['@LIMIT','50'])

and "." are used for columns and schema connections.

In this case, to sum the budget column, "." is correct. 



Best,

Celton


RE: How to make custom report in Tactic? - remkonoteboom - 10-21-2019

I would like to note that the TACTIC charts were developed a long time ago when most of the charting libraries left a lot to be desired. This is no longer the case. I would recommend using something like chart.js (https://www.chartjs.org/) which would be super easy to just use. We could consider putting this into TACTIC itself.


RE: How to make custom report in Tactic? - EricTsuei - 10-22-2019

is it possible to put it in 4.5v1? by my self?