Call a popup, have it return to a different report

(2 posts) (2 voices)
  1. cris, Member

    I have a report where I call a popup report to add a new record. After all of the selections are made, I would like the 'Run Report' button to go to a different report than the calling report. I would like the calling report replaced with a different report for further processing. Is this possible?

    I tried:
    Call sp_DBR_EditRec(vRecLID);
    but this appends the EditRec report to the bottom of the calling report
    I also tried:
    select 'dbr.report', 'sp_DBR_EditRec', 'new_window', 'inRecID=RecID';
    but this also appends a table with the arrow at the bottom of the calling report.

    I think I'm missing something obvious.

    Thanks,

    Cris

  2. myDBR Team, Key Master

    The syntax:

    call sp_DBR_EditRec(vRecLID);

    would be the same as you would include the content of the procedure to the original report. It is treated like a normal query, not as a report.

    The syntax:

    select 'dbr.report', 'sp_DBR_EditRec', 'new_window', 'inRecID=RecID';

    when clicked the linked report, would open the sp_DBR_EditRec-report to new window and if the report has other parameters, asks them and the output of the editing report would be the final content of the new report.

    So the use case you are looking for is:

    - You have a main report with link to editing report sp_DBR_EditRec which has parameters user needs to fill
    - User clicks the link and is presented the parameters and a "Run report"-button (you can change the name of the button)
    - The editing report is executed and after that you want run another reporting automatically so user moves from original main report to the new one

    What is the reason for asking the parameters in a popup if you still will move away from the main report after editing?

    However, to do this, you would need to make the editing report to do two thing: 1) edit the data according to parameters and 2) move to new report.

    So a simplified main report would look like this:

    select 'dbr.button', 'Click here to edit';
    select 'dbr.report', 'sp_DBR_EditRec', 'linked_output[].whatever.noshow', 'inRecID=RecID';

    select 1 as 'dummy';

    select 'dbr.embed_object', 'linked_output';
    [/sql]

    This would indicate that the output of the sp_DBR_EditRec report would be put into a DIV 'linked_output' and the content would be hidden (using CSS class 'noshow' which has definition of 'display:none'.

    The sp_DBR_EditRec-report would do the editing and it would create a link to the final report to be shown and it would click the link with JavaScript.

    /* Make the update */
    update mytable
    set col = in_col
    where id = in_id; /* Go to final report, create link */
    select 'dbr.report', 'sp_DBR_final_report', '[data]';
    select 'dbr.colclass', 'data', 'clickme'; select 1 as 'data'; /* Go to final report, click the link */
    select 'dbr.javascript', '$(".clickme a")[0].click();';

    --
    myDBR Team


Reply

You must log in to post.