How to use DBR user login in my report?

(5 posts) (3 voices)

Tags:

No tags yet.

  1. chadwickhung, Member

    I have several entity in my db tables. Every user belongs to 1 entity. The user can only retrieve data from the entity it belongs to. Therefore, I need to somehow know who is the current mydbr login user in my stored procedure to retrieve records for it's entity only. Is there any way I can do in mydbr?

    Thanks a lot.
    Chadwick

  2. myDBR Team, Key Master

    Take a look at Automatic parameters from myDBR documentation.

    --
    myDBR Team

  3. myDBR Team, Key Master

    Take a look at Automatic parameters from myDBR documentation.

    --
    myDBR Team

  4. Mark Tetrode, Member

    Example SP

    01.DROP PROCEDURE IF EXISTS sp_DBR_automatic_parameters
    02.$$
    03.CREATE PROCEDURE `sp_DBR_automatic_parameters`(
    04.inLogin varchar(30),
    05.inIPAddress varchar(30),
    06.inLocale varchar(30),
    07.inUseragent varchar(500),
    08.inExportFormat varchar(30),
    09.inAutoexecute varchar(30),
    10.inHTTP_ACCEPT_LANGUAGE varchar(100),
    11.inHTTP_REFERER varchar(400),
    12.inAutoReportURL varchar(400),
    13.inAutoTheme varchar(30),
    14.inImportFilename varchar(30)
    15.)
    16.BEGIN
    17. 
    18.      select 'inLogin',                inLogin                 -- username
    19.union select 'inIPAddress',            inIPAddress             -- Users IP address as reported by user's browser
    20.union select 'inLocale',               inLocale                -- Users locale when report is run (en_US, de_DE etc.)
    21.union select 'inUseragent',            inUseragent             -- Browsers user agent
    22.union select 'inExportFormat',         inExportFormat          -- URL's export parameter value
    23.union select 'inAutoexecute',          inAutoexecute           -- Makes myDBR accept default parameters and not wait for user confirmation.
    24.union select 'inHTTP_ACCEPT_LANGUAGE', inHTTP_ACCEPT_LANGUAGE  -- User's default browser language
    25.union select 'inHTTP_REFERER',         inHTTP_REFERER          -- HTTP_REFERER, IP address of linked web page
    26.union select 'inAutoReportURL',        inAutoReportURL         -- Report's execution URL
    27.union select 'inAutoTheme',            inAutoTheme             -- User's theme
    28.union select 'inImportFilename',       inImportFilename        -- Filename chosen in dbr.import
    29.;
    30.END
    31.$$

  5. myDBR Team, Key Master

    There is also a inSessionIDHash, which, as name suggests, gives you a hashed value from user's session ID.

    --
    myDBR Team


Reply

You must log in to post.