#16 Added reportName to ExecuteReportAction

closed-accepted
nobody
None
5
2005-09-25
2005-07-12
No

This allows for the query string passed to
executeReport.action to conditioinally refer to the
report by the unique value stored in REPORT.NAME rather
than REPORT.REPORT_ID. This is useful in our
environments (Development, QA, Production) because it
does not manditate that the reports are created in the
exact same order in each environment, or that the
environments need be identical. This is particularly
useful in the development of drill down reports which
need to call consistantly named child reports

Modified the following files as indicated below:
ExecuteReportAction.java
ReportProvider.java
ReportProviderImpl.java
ReportPersistenceProvider.java

ExecuteReportAction.java
--------------------------------------

private String reportName;

public String execute()
{
try
{
.....
//Report report =
reportProvider.getReport(new Integer(reportId));
Report report = null;
if ((reportName != null) &&
(reportName.length() > 0))
{
report =
reportProvider.getReport(reportName);
}
else
{
report = reportProvider.getReport(new
Integer(reportId));
}
.....
}
....
}

public String getReportName()
{
return reportName;
}

public void setReportName(String reportName)
{
this.reportName = reportName;
}

ReportProvider.java
----------------------------

public Report getReport(String name) throws
ProviderException;

ReportProviderImpl.java
----------------------------------

public Report getReport(String name) throws
ProviderException
{
return reportPersistenceProvider.getReport(name);
}

ReportPersistenceProvider.java
---------------------------------------------

public Report getReport(String name) throws
ProviderException
{
Session session = null;
try
{
session = openSession();
Criteria crit =
session.createCriteria(Report.class);
crit.add( Expression.eq("name", name) );
return (Report)crit.uniqueResult();
}
catch (HibernateException he)
{
throw new ProviderException(he);
}
finally
{
closeSession(session);
}
}

Discussion

  • Erik Swenson

    Erik Swenson - 2005-09-25
    • status: open --> closed-accepted
     
  • Erik Swenson

    Erik Swenson - 2005-09-25

    Logged In: YES
    user_id=477376

    this patch has been committed to CVS

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks