help with multiple parameter drill through using php/java bridge [message #647335] |
Wed, 05 January 2011 16:51 |
Ryan Ott Messages: 2 Registered: January 2011 |
Junior Member |
|
|
I have been following the examples from Integrating BIRT with php and from the BIRT examples in the java bridge itself, however when drilling into another report that accepts multiple parameters only the first parameter is being passed.
Here is the loop that sets the parameters before the report is run. This is almost identical to the code in the example in the javabridge and the above link.
for ($i=0; $i < $parmarraysize; $i++) {
$parmhandle = $sh->get($i);
$parmname = $parmhandle->getName();
$dt = $parmhandle->getDataType();
$passedinvalue = $_REQUEST[java_values($parmname)];
echo $parmarraysize."<br>";
echo $i."<br>";
if (isset($passedinvalue)) {
if( strcasecmp(java_values($dt), "integer") == 0 )
{
$Parm = new Java("java.lang.Integer", (int)$passedinvalue);
$task->setParameterValue($parmname, $Parm);
}else if( strcasecmp(java_values($dt), "string") == 0 )
{
$Parm = new Java("java.lang.String", $passedinvalue);
$task->setParameterValue($parmname, $Parm);
}else if( strcasecmp(java_values($dt), "decimal") == 0 )
{
$Parm = new Java("java.lang.Float", (float)$passedinvalue);
$task->setParameterValue($parmname, $Parm);
}
}
}
I'm echoing a few variables for debugging purposes. For a report with two parameters this results in
2
0
This means the report accepts two parameters, and the loop is in its first iteration. However, after this the code after the loop runs without the loop ever entering its second iteration.
I'm very confused by this as it appears that the loop should run for every parameter that the report accepts. Any help would be appreciated.
[Updated on: Wed, 05 January 2011 16:52] Report message to a moderator
|
|
|
|
Re: help with multiple parameter drill through using php/java bridge [message #647367 is a reply to message #647335] |
Wed, 05 January 2011 18:57 |
|
Are you echoing parmarraysize?
Jason
On 1/5/2011 11:51 AM, Ryan Ott wrote:
> I have been following the examples from
> http://www.theserverside.com/news/1363642/Intergrating-BIRT- with-PHP and
> from the BIRT examples in the java bridge itself, however when drilling
> into another report that accepts multiple parameters only the first
> parameter is being passed.
> Here is the loop that sets the parameters before the report is run. This
> is almost identical to the code in the example in the javabridge and the
> above link.
>
> for ($i=0; $i < $parmarraysize; $i++) {
> $parmhandle = $sh->get($i);
> $parmname = $parmhandle->getName();
> $dt = $parmhandle->getDataType();
> $passedinvalue = $_REQUEST[java_values($parmname)];
> echo $parmarraysize."<br>";
> echo $i."<br>";
> if (isset($passedinvalue)) {
> if( strcasecmp(java_values($dt), "integer") == 0 )
> {
> $Parm = new Java("java.lang.Integer", (int)$passedinvalue);
> $task->setParameterValue($parmname, $Parm);
> }else if( strcasecmp(java_values($dt), "string") == 0 )
> {
> $Parm = new Java("java.lang.String", $passedinvalue);
> $task->setParameterValue($parmname, $Parm);
> }else if( strcasecmp(java_values($dt), "decimal") == 0 )
> {
> $Parm = new Java("java.lang.Float", (float)$passedinvalue);
> $task->setParameterValue($parmname, $Parm);
> }
> }
> }
>
> I'm echoing a few variables for debugging purposes. For a report with
> two parameters this results in
>
> 2
> 0
>
> This means the report accepts two parameters, and the loop is in its
> first iteration. However, after this the code after the loop runs
> without the loop ever entering its second iteration.
>
> I'm very confused by this as it appears that the loop should run for
> every parameter that the report accepts. Any help would be appreciated.
|
|
|
Powered by
FUDForum. Page generated in 0.03408 seconds