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


    DROP PROCEDURE IF EXISTS sp_DBR_automatic_parameters
    $$
    CREATE PROCEDURE `sp_DBR_automatic_parameters`(
    inLogin varchar(30),
    inIPAddress varchar(30),
    inLocale varchar(30),
    inUseragent varchar(500),
    inExportFormat varchar(30),
    inAutoexecute varchar(30),
    inHTTP_ACCEPT_LANGUAGE varchar(100),
    inHTTP_REFERER varchar(400),
    inAutoReportURL varchar(400),
    inAutoTheme varchar(30),
    inImportFilename varchar(30)
    )
    BEGIN select 'inLogin', inLogin -- username
    union select 'inIPAddress', inIPAddress -- Users IP address as reported by user's browser
    union select 'inLocale', inLocale -- Users locale when report is run (en_US, de_DE etc.)
    union select 'inUseragent', inUseragent -- Browsers user agent
    union select 'inExportFormat', inExportFormat -- URL's export parameter value
    union select 'inAutoexecute', inAutoexecute -- Makes myDBR accept default parameters and not wait for user confirmation.
    union select 'inHTTP_ACCEPT_LANGUAGE', inHTTP_ACCEPT_LANGUAGE -- User's default browser language
    union select 'inHTTP_REFERER', inHTTP_REFERER -- HTTP_REFERER, IP address of linked web page
    union select 'inAutoReportURL', inAutoReportURL -- Report's execution URL
    union select 'inAutoTheme', inAutoTheme -- User's theme
    union select 'inImportFilename', inImportFilename -- Filename chosen in dbr.import
    ;
    END
    $$

  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.