Sparkline Invalid column name '$('.spark')!

(3 posts) (2 voices)

Tags:

No tags yet.

  1. vannc, Member

    Dear Team!

    I copied the code from the Sparkline demo, but in the JavaScript section, it returned an error:
    Invalid column name '$('.spark').sparkline('html', { type: 'line', height: '30px', width: '220px' });'.

    https://mydbr.com/demo/mydbr/report.php?r=3&p1=sp_DBR_sparkline_simple&m=4&h=286d3febd35cdc33c7dbfb40abe3ebf307ffe779&i=1
    -------------------------------------------------------
    select 'dbr.css', '.spark {padding:0}';

    select 'dbr.colclass', 'Sparkline', 'spark';

    select 'Line' as 'Type', '8,4,1,0,6,0,1,4,4,10,10,8,10,0,2,0,4,6,5,9,10' as 'Sparkline'; select 'dbr.javascript', "$('.spark').sparkline('html', { type: 'line', height: '30px', width: '220px' });", 'onload';
    -------------------------------------------------------
    Thanks!

  2. myDBR Team, Key Master

    This is a database configuration issue.

    If you have the QUOTED_IDENTIFIER setting in SQL Server set to ON, a string in SELECT enclosed in double quotation marks (like "text") is considered to be a column name. If the setting is turned off, it is treated as a string (behaves the same as the single quotation mark).

    In your server, the setting is ON by default, and hence the JavaScript parameter is treated as a column name.

    You can change the setting if you add the following line to user/defaults.php:

    $mydbr_defaults['db_connection']['sqlsrv_server_init'] = 'SET ANSI_WARNINGS OFF;SET ARITHABORT OFF;SET ANSI_NULLS ON;SET QUOTED_IDENTIFIER OFF';

    --
    myDBR Team

  3. vannc, Member

    Thanks Team!
    Best regards:
    Vannc


Reply

You must log in to post.