Adding custom reports to the Results page
Posted: Thu Dec 09, 2010 8:52 pm
Hi, all. I did some searching the last few days and was not able to find any clear procedures for creating a new report in the Results page. The user manual notes the .php and .tpl files and that you need to add a link in the strings.txt file but the exact syntax (such as the $TLS_xxxxxxx variables and how they relate to the name you gave it in custom_config.inc.php) was not covered. After much frustration and some detailed searching through source, I pulled together a procedure for creating a new custom report. Hopefully, this will save someone all the painful and fruitless searching I had to go through before finding the answers. 
For example, let's say you wanted to make a custom QA report and name it "QA Custom Report 1." This report is mostly based on the "Test Cases with Execution Details" built-in report. You would do the following:
Enjoy!
John

For example, let's say you wanted to make a custom QA report and name it "QA Custom Report 1." This report is mostly based on the "Test Cases with Execution Details" built-in report. You would do the following:
- Copy testlink/lib/results/testCasesWithCF.php to testlink/lib/results/qa1.php and modify the qa1.php file to suit your needs.
- Copy testlink/gui/templates/results/testCasesWithCF.tpl to testlink/gui/templates/results/qa1.tpl
- Edit your custom_config.inc.php and add a link to your qa1 report like so:
// If you create your OWN reports and add something like this:
//
// ------------------------------------------------------------
$tlCfg->reports_list['qa_custom_1'] = array(
'title' => 'link_qa_custom_1',
'url' => 'lib/results/qa1.php',
'enabled' => 'all',
'format' => 'format_html,format_xls'
);
// -----------------------------------------------------------
// Your reports WILL BE ON TOP OF standard TL Reports on left frame
//
// - Edit testlink/locale/en_GB/strings.txt and add a string entry for your report name like so:
// ----- cfg/reports.cfg.php -----
$TLS_link_qa_custom_1 = "QA Custom Report 1"; - Edit any other language's strings.txt files and add your localizations as needed.
- Restart your web server if needed.
Enjoy!
John