Couple of questions.

(4 posts) (2 voices)
  1. ajdjackson, Member

    Hi

    I have a couple of questions/wishes:

    dbr.pager

    1) When using dbr.pager is it possible to place the page navigation at the bottom of the result set?
    2) Is there a fix or workaround for using dbr.column.filter with dbr.pager?

    dbr.upload

    I've created a report that has a linked report which uses dbr.upload. I have this working except for 1 thing:

    1) How can I refresh the parent report when the file upload is finished? I've tries the following:

    select 'dbr.report','sp_DBR_Upload_Test','popup','inComp=scomp','inTran=tnum',"callpopupclose=mycallback()";

    select 'dbr.javascript',' function mycallback() {Location.reload();} ';

    I've also put this into the sp_DBR_Upload_Test sp:

    select 'dbr.javascript','window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); }';

    2) This is more of a wish. Is there anyway I can prepend parameters to the file name before saving? In the parent report I have the company id and transaction number and I pass these onto sp_DBR_Upload_Test sp and these get stored in a table along with the filename. As the company id and transaction is a unique combination prepending these to the filename would result in a unique file eg 01-1234-filename.pdf.

    Thanks

    Jake

  2. myDBR Team, Key Master

    dbr.pager

    The dbr.pager and the dbr.column.filter are not designed to work together.

    How can I refresh the parent report when the file upload is finished? I've tries the following:

    You can add:

    select '<script>location.reload();</script>';

    at the end of the upload routine.

    --
    myDBR Team

  3. ajdjackson, Member

    Hi

    Thanks for getting back.

    I tried adding select '<script>location.reload();</script>';

    To each of the 'upload' sps but it didn't work.

    From Parent report:

    select 'dbr.report','sp_DBR_Upload_Test','popup','inComp=scomp','inTran=tnum';

    The sp_DBR_Upload_Test

    CREATE PROCEDURE `sp_DBR_Upload_Test`(inComp int,inTran int) BEGIN

    declare in_comp,in_tran int;

    set in_comp=inComp,in_tran=inTran;

    select 'dbr.upload.options', 'noreplace', 0; select 'dbr.upload.options', 'accepted_files', '.pdf,.xlsx';

    select 'dbr.upload', 'C:\\inetpub\\wwwroot\\user\\SageDocs\\','sp_DBR_Upload_Test2',in_comp,in_tran; select 'dummy';

    END $$

    and the sp_DBR_Upload_Test2 sp:

    CREATE PROCEDURE `sp_DBR_Upload_Test2`(in_path varchar(255), in_file varchar(255), in_size int, in_comp int, in_tran int) BEGIN

    insert into tblsage_atts select in_comp,in_tran,in_file on duplicate key update satt=values(satt);

    select concat('File ', in_file, ' uploaded!'); select '<script>location.reload();</script>';

    END $$

    I did try adding the reload line in the `sp_DBR_Upload_Test sp but again nothing.

    Thanks

    Jake

  4. myDBR Team, Key Master

    The upload routine returns one result set. You have two.

    The message makes sense when you do not refresh the main page and the main page will show the file uploaded:
    select concat('File ', in_file, ' uploaded!');

    This one makes sense if you intend to refresh the page:
    select '<script>location.reload();</script>';

    Just remove the first result set.
    --
    myDBR Team


Reply

You must log in to post.