Try to run a report using html form in a report

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

    Hello,
    I need your help, I try to integrate two datepickers (vStartDate and vEndDate) in a report in order to allow my users to select the period they want to analyze and re-run the report with these new parameters. I've tried to let the default report parameter fields using the dbr.parameters.show command but it doesn't fit our graphics requirements.

    So I try now to run this report using an html form into the report himself. The display is good, but as soon as I change the date in the input box and clic on submit, I'm immediately redirected to the myDBR home page instead of our report.
    Does someone can help me please ?

    My code is :

    CREATE PROCEDURE `sp_DBR_period_counter`( vStartDate date, vEndDate date ) BEGIN

    select 'dbr.title',concat('COUNTERS between ',vStartDate,' and ',vEndDate); select 'dbr.html', concat('<FORM action="report.php" method="get"><input id="r" type="hidden" value="62"><DIV class="title">COUNTERS between <input id="u1" name="u1" type="date" value="',vStartDate,'"> and <input id="u2" name="u2" type="date" value="',vEndDate,'"><input type="submit" class="runreport button sub_button"><input id="m" type="hidden" value="19"><input id="h" type="hidden" value="e6f4aa0483ce543739c141e162446cf0510ac0a9"></FORM>');

    select * from mytable when mydate >=vStartDate and mydate <= vEndDate;

  2. myDBR Team, Key Master

    What part of the normal parameter form does not fit your graphics requirements? See sample formatted close to yours (plus date pickers, plus date range picker, plus input verification):

    Date parameter form in demo

    You can make your own form, you just need to define GET-parameters with 'name'-attribute rather than 'id'. Creating own forms makes the report maintenance bit harder, so you decide if the customization is really worth it.

    --
    myDBR Team


Reply

You must log in to post.