Implementing new Summary flag in Report View

- Replace use of context variable with API change to fixed that the summary flag value is global to all report windows.
Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2011569
This commit is contained in:
Heng Sin Low 2010-03-18 05:18:02 +00:00
parent 8c1813b408
commit b75ad04ac7
3 changed files with 23 additions and 4 deletions

View File

@ -118,10 +118,24 @@ public class DataEngine
* @return PrintData or null
*/
public PrintData getPrintData (Properties ctx, MPrintFormat format, MQuery query)
{
return getPrintData(ctx, format, query, false);
}
/**************************************************************************
* Load Data
*
* @param format print format
* @param query query
* @param ctx context
* @param summary
* @return PrintData or null
*/
public PrintData getPrintData (Properties ctx, MPrintFormat format, MQuery query, boolean summary)
{
/** Report Summary FR [ 2011569 ]**/
m_summary = "Y".equals(Env.getContext(Env.getCtx(),0, "IsReportSummary"));
m_summary = summary;
if (format == null)
throw new IllegalStateException ("No print format");

View File

@ -165,6 +165,8 @@ public class ReportEngine implements PrintServiceAttributeListener
/** Window */
private int m_windowNo = 0;
private boolean m_summary = false;
/**
* Set PrintFormat.
* If Layout was created, re-create layout
@ -221,7 +223,7 @@ public class ReportEngine implements PrintServiceAttributeListener
return;
DataEngine de = new DataEngine(m_printFormat.getLanguage(),m_trxName);
setPrintData(de.getPrintData (m_ctx, m_printFormat, m_query));
setPrintData(de.getPrintData (m_ctx, m_printFormat, m_query, m_summary));
// m_printData.dump();
} // setPrintData
@ -1595,5 +1597,8 @@ queued-job-count = 0 (class javax.print.attribute.standard.QueuedJobCount)
return m_windowNo;
}
public void setSummary(boolean summary)
{
m_summary = summary;
}
} // ReportEngine

View File

@ -662,7 +662,7 @@ public class Viewer extends CFrame
cmd_drill();
else if (e.getSource() == summary) //FR 201156
{
Env.setContext(Env.getCtx(), 0, "IsReportSummary", (Boolean)summary.getValue() ? "Y" : "N" );
m_reportEngine.setSummary(summary.isSelected());
cmd_report();
}
else if (cmd.equals("First"))