How do i hide a query from showing on the report?

(7 posts) (3 voices)

Tags:

  1. JMitchell, Member

    I have a calculation query and i dont want it to show up on the report.

    <<i need to hide this query>>
    select SQL_CALC_FOUND_ROWS count(1) as 'Unsuccessful WC Attempts'
    from dm.table cc;

    <<this query shows the results i need>>
    SELECT FOUND_ROWS() as 'Unsuccessful WC Attempts';

    ALSO
    I tried to use
    select 'dbr.hidecolumns', 1;
    but a little piece of header still holds the spot on the report.

    After I posted this i tried this:

    select 'dbr.hidecolumns', 1;
    select 'dbr.hideheader';
    <<query I wanted to hide>>

    and the query is now hidden!

  2. myDBR Team, Key Master

    It is usually easier just to use "select count(*) from table" than the SQL_CALC_FOUND_ROWS.

    --
    myDBR Team

  3. dharkness, Member

    While hiding the columns and the header works, it leaves an empty space which pushes the actual report down the page from the title. Is there any real solution to this yet?

    This would be great:

    select 'dbr.hidequery';
    [query to hide]

  4. myDBR Team, Key Master

    Could you show example code / screenshot that would show show what you are trying to hide?

    --
    myDBR Team

  5. dharkness, Member

    Ah ha! The problem was that I was using

    select @var := 'foo' ... ;

    which tricked MyDBR into thinking it was report data. Changing this to

    select ... into @var ;

    got rid of the blank space between the title and header.

  6. myDBR Team, Key Master

    You should not use @var variables in MySQL as these are shared in the connection. This may lead you into trouble when you call other procedures / functions. Use normal variables declared with declare instead.

    So do not use:

    select 1 into @var;

    but instead use:

    declare vVar int;
    select 1 into vVar;

    --
    myDBR

  7. dharkness, Member

    Yes, thanks. I made that change already but had been using @ before because local variables weren't working with the set var := ... form. :)


Reply

You must log in to post.