How to restrict the first parameter String

(9 posts) (2 voices)

Tags:

No tags yet.

  1. wsasteam, Member

    Dear MyDbrTeam,

    I created the stored procedure with one parameter.

    CREATE PROCEDURE sp_DBR_my_Report(user int) BEGIN

    END$$

    Also I have create a parameter query for user parameter like this

    Input Type = Select list
    Query = Select id,name From tbl_users Where super_admin = mydbr_param1

    But its not working. Could you please help for this. How can I do this.

    Thanks,
    ws

  2. myDBR Team, Key Master

    Which "id,name" pairs to you want to show to the user?

    What is the meaning of tbl_users.super_admin-field?

    --
    myDBR Team

  3. wsasteam, Member

    Thanks for quick reply

    I need to list group of users details only other groups may not show.

    Thanks,
    ws

  4. myDBR Team, Key Master

    Could you please clarify the logic how do you want to determine which users to show to whom?

    What is the meaning of tbl_users.super_admin-field? What is it? A user-id, a 1/0 or what?

    --
    myDBR Team

  5. wsasteam, Member

    Thanks for your quick reply

    super_admin have integer value which I have send to i-frame url u1=10 like this

    Thanks,
    WS

  6. myDBR Team, Key Master

    WS,
    can you elaborate on this "I need to list group of users details only other groups may not show."

    1) What is that you want to do?
    2) What is the logic behind this in the database?

    --
    myDBR Team

  7. myDBR Team, Key Master

    WS,
    can you elaborate on this "I need to list group of users details only other groups may not show."

    1) What is that you want to do?
    2) What is the logic behind this in the database?

    --
    myDBR Team

  8. wsasteam, Member

    Dear Mydbrteam,

    My requirement is I need to list the user based daily sales report

    Every user have super admin id in tbl_user table

    tbl_user table have id,uname,password,super_admin.. etc fields

    When login as a super admin in the report page I need to show only the list of users which are belongs to the current super admin user as in the above table structure.

    Please clarify the for generation report based on the scenario it will be helpful for me.

    <iframe id="sales_rport" src="https://www.wsasteam.com/mydbr/report.php?r=1&u1=<?php echo $_SESSION['super_admin'];?>&m=1&h=ssss233435ddsds45454543gfdgfd4543dff&i=1"
    width="100%" height="500px"></iframe>

    waiting for your response.

    Thanks,
    ws

  9. myDBR Team, Key Master

    ws,
    you can use inLogin-automatic parameter which contains the user's ID. In case of super-admin, it would contain the userID for him

    You can create the parameter query as:

    select sp_ADBR_admins_users ( inLogin varchar(30) )
    begin
    select id,name
    from tbl_users
    where super_admin = cast( inLogin as int );
    end

    Then attach the query to the sp_DBR_my_Report's first parameter. You do not need to pass the parameter to the report at all as myDBR already know who the user running the report is.

    Please see manual and demos for examples.

    --
    myDBR Team


Reply

You must log in to post.