For partners that build or integrate commercially available applications and service solutions with the Oracle Cloud Platform
For partners that provide implementation or managed services around Oracle Cloud Applications
Hello,
I created a report_id = 120 to display in list2.php. What I want is when someone click on the Search button (using search panel), I want the search function to use report_id = 130. I am not sure if I make any sense, but if you know what I mean, please let me know how do I do it.
Thank You
Dat
Comment
Hi Matt,
For some reasons it could not see reportId 130. reportId does exist but for whatever reason it returns "Result not found". Do you know why ?
Thanks for your help!
hooks.php
----------------------------------------------------------------------------------------
$rnHooks['pre_report_get'][] = array(
'class' => 'reporthook_model',
'function' => 'preReportGet',
'filepath' => ''
);
reporthook_model.php
------------------------------------------------------------------------------------------
<?php
class reporthook_model extends Model
{
function __construct()
{
parent::__construct();
}
public function preReportGet($filters)
{
if ($filters['data']['reportId'] == 120)
{
$filters['data']['reportId'] = 130;
}
}
}
Be the first to rate this
|
Sign in to rate this
Dat,
Could it be that report 130 is running, but, based on the filters, there are simply no results to display? If you don't have the hook function modify any data, do you get results from report 120?
James
Be the first to rate this
|
Sign in to rate this
Hi Dat,
I agree you should try running the report in the console with the filters that are being passed from the customer portal. If all else fails copy the report and then modify it to meet your needs. You don't have to use the default it you don't want to.
Regards,
Matthew
Be the first to rate this
|
Sign in to rate this
To answer James questions, the report 130 is not running. I get the results if I ran the report 130 manually through the Report Explorer. I also get results from report 120 if I don't have the hook function. Also, if I switched it around (130 --> 120) I still get the no results. So the point is no matter what report number I put after the If statement I get the no result back even though the report id is there and I get the results if I ran it manually.
class reporthook_model extends Model
{
function __construct()
{
parent::__construct();
}
public function preReportGet($filters)
{
if ($filters['data']['reportId'] == 120)
{
$filters['data']['reportId'] = 130;
}
}
}
Be the first to rate this
|
Sign in to rate this
Hi Dat,
I finally looked at the reports and they are very different. What are you using to display the results. Which widget ?
The filters available for each report are also very different which may be causing a problem. Are you using a standard page or custom.
Regards,
Matthew
Be the first to rate this
|
Sign in to rate this
Hi Matt,
What I did was I copied report 176 (which is a default report), renamed it and put in filter. I am using rn: container.
Is that helped ?
Thank You,
Be the first to rate this
|
Sign in to rate this
Dat,
One additional thing to try is to add an ampersand to the function call. It may be a pass-by-reference issue:
Does that help?
James
Be the first to rate this
|
Sign in to rate this