Extending/customising the menu

(7 posts) (2 voices)
  1. elb98rm, Member

    Hi,

    Is there a way of adding things to the export menu?

    Here's the background:
    I have a module I have written that takes the stored procedure of a report and uses it to parse through the data it returns. Using some basic php and regex I've developed this into an email generator, so emails can be customised to each results set. As each row is checked, whatever columns are returned by the SP are being used in the email.... which is nice! :)

    To feed this to my program, I need to let my module know what SP is... I'm using a form to activate this (could easily be a url as well). I've been using 'dbr.purehtml' to add a button underneath each report but we have a lot of reports and it's not ideal.

    I'd like to add this to all forms, preferably in the export menu (export excel csv etc). Can this be done? A link would need to be of the form:

    http://myserver.com/the specific SP]/[variables] etc...

    Cheers
    Rick

  2. myDBR Team, Key Master

    Rick,
    you lost us somewhere in the middle of the first paragraph. Could you rephrase the question? Not the export menu part but what would you like for myDBR to do?

    --
    myDBR Team

  3. elb98rm, Member

    I would like to be able to add to the export menu...

    I've written a module that extends from myDBR.

    I want to be able to click the export menu, so you get:

    * Excel
    * PDF
    * CSV

    ...

    and I want to be able to add:

    * Emailer

    ...which would be a link/submit to another url.
    I'd need to include the name of the SP. So for example:

    http://mysite.com/sp_DBR_whatever_the_SP_is_called

    Cheers.

  4. myDBR Team, Key Master

    Do you already know how to construct the URL, hence the only problem being how to add an item to the menu?

    There is no direct command to access the export menu, but you can do it quite easily using dbr.javascript and jQuery.

    select 'dbr.javascript', "$('.dbrReportHeader .exportmenu').removeClass('lastchild');
    $('.dbrReportHeader .exportmenu').append('<li class=\"email lastchild\">
    Email');", 'onload';

    There are two calls. First one removes the lastchild class from the last menu item and the second one adds an item to the menu.

    P.S Note that our forum sw is messing up escape characters around the URL.

    --
    myDBR Team

  5. elb98rm, Member

    I presume you mean "in a report".. I was asking if it was possible to amend this globally?
    I want this to apply to all reports I have, not just individual reports.

    Also I want to generate the URL dynamically: "http://mysite.com/sp_DBR_whatever_the_SP_is_called"

    I want the "sp_DBR_..." to be the stored procedure that the current report uses.

  6. myDBR Team, Key Master

    There is no such functionality. Defining the "current report" is bit loose term as reports (and procedures) may call eachother so it is really only you who knows which is the correct one.

    Just make it a procedure call which takes the sp name as parameter.

    What was the functionality/logic behing the emailer-script? To whom is the email sent to? Just asking if the email-option could be a standard feature.

    --
    myDBR Team

  7. elb98rm, Member

    Basically - it's not to email the report.

    Here's a use case:

    A report generates a table of 300 people. My (half finished, but functional) add-on/code then does the following:

    * myDBR user clicks a form button added under the report (using 'dbr.purehtml').
    * This submits the current SP, and redirects to my separately implemented code.
    * Here I run the SP again, and use it to get the report into php.
    * I let the user select from pre written emails.
    * The code then sends an email to every user who has an entry in the "email" field.
    * Using some cool regex, it also substitutes any marked field names in the email with those from the table. So %%name%% and %%phone%% are picked up and replaced with the columns "name" and "phone".

    It's not a simple mailer of report. From here I can send every person from a report a customised email depending on the report I've written.

    That's what I'm doing...

    In answer to the question - it looks like I'll have to add these buttons manually to each report. It's not a massive deal. I just wanted to know if it could be done globally.

    I have another question... but I'll open a new forum thread.

    :)


Reply

You must log in to post.