mortezamashhadi / orclapex-kpi-gauge

orclapex-kpi-gauge
1 stars 0 forks source link

ERROR #1

Open davichowar opened 5 years ago

davichowar commented 5 years ago

When i try to run an APEX 18.1,0 app on a Oracle 11g 11.2.0.1.0 i get the following error:

Error in PLSQL code raised during plug-in processing.

Contact your application administrator. Technical Info (only visible for developers)

is_internal_error: true
apex_error_code: WWV_FLOW_PLUGIN.RUN_PLSQL_ERR
ora_sqlcode: -6502
ora_sqlerrm: ORA-06502: PL/SQL: error : error de conversión de carácter a número numérico o de valor
component.type: APEX_APPLICATION_PAGE_REGIONS
component.id: 36248167399297645
component.name: Gauge
error_backtrace:

ORA-06512: en línea 31
ORA-06512: en línea 135
ORA-06512: en "SYS.DBMS_SQL", línea 1575
ORA-06512: en "APEX_180100.WWV_FLOW_DYNAMIC_EXEC", línea 2360
ORA-06512: en "APEX_180100.WWV_FLOW_DYNAMIC_EXEC", línea 1406
ORA-06512: en "APEX_180100.WWV_FLOW_PLUGIN", línea 1345

error_statement:

begin declare
/****************************************************************************************

 --  Plugin      : APEX_KPI_GAUGE
 --  InternalName: IR.APEX_KPI_GAUGE
 --  Author      : Morteza Mashhadi
 --  Create Date : Friday - 2019 25 January
 --  Version     : 1.0
 --  Description : Key performance indicator gauge for Oracle APEX
 --  Website     : www.mortezamashhadi.blogspot.com

 ****************************************************************************************/

FUNCTION kpi_gauge (
    P_REGION              IN APEX_PLUGIN.T_REGION,
    P_PLUGIN              IN APEX_PLUGIN.T_PLUGIN,
    P_IS_PRINTER_FRIENDLY IN BOOLEAN )
  RETURN APEX_PLUGIN.T_REGION_RENDER_RESULT
IS

gaugeName varchar(20):='kpiGauge'||p_region.attribute_01;
gaugePoint number:=0;
startPoint number:=0;
endPoint number:=100;
startYellow number:=20;
startGreen number:=80;
l_column_value apex_plugin_util.t_column_value_list;

--attributes
angle number:=nvl(p_region.attribute_02,0.12);
lineWidth number:=nvl(p_region.attribute_03,0.18);
radiusScale number:=nvl(p_region.attribute_04,0.99);
pointerLength number:=nvl(p_region.attribute_05,0.45);
pointerStrokeWidth number:=nvl(p_region.attribute_06,0.05);
pointerColor varchar(20):=nvl(p_region.attribute_07,'#000000');

--renderTicks
divisions number:=nvl(p_region.attribute_08,5);
divWidth number:=nvl(p_region.attribute_09,1.1);
divLength number:=nvl(p_region.attribute_10,0.7);
divColor varchar(20):=nvl(p_region.attribute_11,'#333333');
subDivisions number:=nvl(p_region.attribute_12,3);
subLength number:=nvl(p_region.attribute_13,0.5);
subWidth number:=nvl(p_region.attribute_14,0.6);
subColor varchar(20):=nvl(p_region.attribute_15,'#666666');

begin

    --add javascript files
    apex_javascript.add_library (
        p_name      => 'apex_kpi_gauge',
        p_directory => p_plugin.file_prefix,
        p_version   => null );

    l_column_value := APEX_PLUGIN_UTIL.GET_DATA (
        p_sql_statement    => P_REGION.source ,
        p_min_columns      => 5,
        p_max_columns      => 5,
        p_component_name   => P_REGION.NAME,
        p_search_type      => NULL,
        p_search_column_no => NULL,
        p_search_string    => NULL,
        p_first_row        => NULL,
        p_max_rows         => 1);

    --Get value and Label from Query
        gaugePoint := apex_escape.html(l_column_value(1)(1));
        startPoint := apex_escape.html(l_column_value(2)(1));
        endPoint := apex_escape.html(l_column_value(3)(1));
        startYellow := apex_escape.html(l_column_value(4)(1));
        startGreen := apex_escape.html(l_column_value(5)(1));

    sys.htp.p('
              <div style="width:100%; text-align:center">
                <canvas width=400 height=150 id="'||gaugeName||'" ></canvas>
                <div id="'||gaugeName||'-textfield" style="margin: 0px auto;
                text-align: center;
                font-size: 18px;
                font-weight: bold;"></div>
              </div>
    ');

    apex_javascript.add_onload_code(
        gaugeName||' = new Gauge(document.getElementById("'||gaugeName||'"));
        var opts = {
          angle: '||angle||',
          lineWidth: '||lineWidth||',
          radiusScale:'||radiusScale||',
          pointer: {
            length: '||pointerLength||',
            strokeWidth: '||pointerStrokeWidth||',
            color: "'||pointerColor||'"
          },

          renderTicks: {
              divisions: '||divisions||',
              divWidth: '||divWidth||',
              divLength: '||divLength||',
              divColor: "'||divColor||'",
              subDivisions: '||subDivisions||',
              subLength: '||subLength||',
              subWidth: '||subWidth||',
              subColor: "'||subColor||'"
            },

          staticLabels: {
            font: "10px sans-serif",
            labels: ['||startPoint||','||startYellow||', '||startGreen||','||endPoint||'],
            fractionDigits: 0
          },
          staticZ
MaikMichel commented 5 years ago

I get the same error...

BernhardFW commented 5 years ago

for me too - but I managed to "solve" it... the application needs Language English(us) under Application attributes --> globalization.... hope that helps. @Mortazam: suggest to fix this NLS issue... if you have time... thanks

davichowar commented 5 years ago

I will test it, thank you.

El jue., 18 jul. 2019 a las 7:36, Bernhard Fischer-Wasels (< notifications@github.com>) escribió:

for me too - but I managed to "solve" it... the application needs Language English(us) under Application attributes --> globalization.... hope that helps. @Mortazam: suggest to fix this NLS issue... if you have time... thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mortezamashhadi/orclapex-kpi-gauge/issues/1?email_source=notifications&email_token=AH3EBQ34IXSNLQBXC6P5AKDQABPUVA5CNFSM4GU6TNGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2IKRJQ#issuecomment-512796838, or mute the thread https://github.com/notifications/unsubscribe-auth/AH3EBQZ7A2UFFLWDG5AD4DLQABPUVANCNFSM4GU6TNGA .

-- NecroManceR

JadrankaStefanovic-dev commented 11 months ago

I'm having an issue with refreshing this plug-in. If I add a parameter, I want the dynamic action, when that page item changes, to refresh the chart generated by this plug-in.