Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

#7293 closed enhancement (fixed)

support for dynamic variables in the report_view page

Reported by: andrei2102@… Owned by: Remy Blank
Priority: normal Milestone: 0.12
Component: report system Version:
Severity: normal Keywords: dynamicvar patch
Cc: scratcher@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

After the discussion on this trac-dev thread I made a patch that displays a list of filters for every variable in a query.

The problem this patch resolves is encountered when a sql report has a variable defined and no values is passed in the URL. The patch allows the user to enter values for this variables.

Attachments (4)

dynamic_variables.diff (4.7 KB ) - added by andrei2102@… 16 years ago.
7293-report-argument-editor-r7493.patch (5.8 KB ) - added by Remy Blank 16 years ago.
Patch against 0.11-stable adding editable fields for report arguments
trac-report_args.diff (605 bytes ) - added by catalin.balan@… 15 years ago.
Enabling dynamic report arguments form for reports with only one argument
trac-report_args.2.diff (624 bytes ) - added by catalin.balan@… 15 years ago.
hidding the form for args.keys()==USER

Download all attachments as: .zip

Change History (12)

by andrei2102@…, 16 years ago

Attachment: dynamic_variables.diff added

by Remy Blank, 16 years ago

Patch against 0.11-stable adding editable fields for report arguments

comment:1 by Remy Blank, 16 years ago

Keywords: patch added
Owner: changed from Matthew Good to Remy Blank

The patch above is a rework of the first patch attached (which was already very good):

  • The layout of the argument fieldset was adapted to be as close to the custom query as possible.
  • A warning lists missing arguments (if any).
  • The folding JavaScript is not called if there are no arguments.

Fields are considered missing if they don't appear in the request at all. Empty arguments are considered present.

Comments?

comment:2 by anonymous, 16 years ago

Cc: scratcher@… added

comment:3 by Remy Blank, 16 years ago

Milestone: 0.12
Resolution: fixed
Status: newclosed

Patch applied in [7555], with a few fixes to report test cases, and an additional test case for missing arguments.

by catalin.balan@…, 15 years ago

Attachment: trac-report_args.diff added

Enabling dynamic report arguments form for reports with only one argument

comment:4 by catalin.balan@…, 15 years ago

Hi,

Is there a reason why only reports with len(args)>1 should have the dynamic arguments form ? Check out the previous attached patch.

Sorry for the double post

Thank you, Catalin Balan

in reply to:  4 comment:5 by Remy Blank, 15 years ago

Replying to catalin.balan@…:

Is there a reason why only reports with len(args)>1 should have the dynamic arguments form ?

IIRC, there is always at least one argument, for the automatic $USER variable. So len(args) is always at least 1. It is >1 only when there are custom arguments.

Do you actually observe that the form is missing for a report with a single custom argument? I may have missed something.

by catalin.balan@…, 15 years ago

Attachment: trac-report_args.2.diff added

hidding the form for args.keys()==USER

comment:6 by catalin.balan@…, 15 years ago

Hey rblank,

AFAIK, there is also a method that clear args that are not used in the sql, so for queries that are using only one var, other then USER, the form is not showed.

Thank you, Catalin Balan

comment:7 by Remy Blank, 15 years ago

Resolution: fixed
Status: closedreopened

Ok, I'll check that.

comment:8 by Remy Blank, 15 years ago

Resolution: fixed
Status: reopenedclosed

Right, I wasn't careful enough. Fixed in [7756]. Thanks for reporting the issue.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.