Commit f33b2098 authored by sbade's avatar sbade

updated code to view filter if grid is to be shown in frame


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97677 ce508802-f39f-4f6c-b175-0d175dae99d5
parent dff21fab
package ibase.client; package ibase.client;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -989,28 +993,31 @@ public class FilterCreator extends Composite ...@@ -989,28 +993,31 @@ public class FilterCreator extends Composite
public void setTitleOnFilterSubmit(ArrayList<String> parameterList,JSONObject metaDataJsnObj) public void setTitleOnFilterSubmit(ArrayList<String> parameterList,JSONObject metaDataJsnObj)
{ {
if(GWTDashBoardReport.flag) if(GWTDashBoardReport.flag)
{ {
subTitle= Window.Location.getParameter("titleName"); subTitle= Window.Location.getParameter("titleName");
} }
title = new MetaDataDtl().getTitle(metaDataJsnObj); title = new MetaDataDtl().getTitle(metaDataJsnObj);
if (title.size() > 1)
{
label.setText(title.get(0) + " : " + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2)));
}
else if (title.size() == 1 && (subTitle=="undefined") || (subTitle.equals("undefined")) || (subTitle.equalsIgnoreCase("undefined")))
{
label.setText(title.get(0) + " : " + getMonth(parameterList.get(1)));
}
//if(subTitle.trim().length()>0)
else if( (title.size() == 1 && (subTitle!="") || (!subTitle.equals("")) || (!subTitle.equalsIgnoreCase(""))))
{
label.setText( subTitle + " : " + getMonth(parameterList.get(1)) );
}
else
{
label.setText(title.get(0)+ " : " +getMonth( parameterList.get(1)));//+ "-" + parameterList.get(2));
}
if (title.size() > 1)
{
label.setText(title.get(0) + " : " + getMonth(parameterList.get(1)) + title.get(1) + getMonth(parameterList.get(2)));
}
else if (title.size() == 1 && (subTitle=="undefined") || (subTitle.equals("undefined")) || (subTitle.equalsIgnoreCase("undefined")))
{
label.setText(title.get(0) + " : " + getMonth(parameterList.get(1)));
}
//if(subTitle.trim().length()>0)
else if( (title.size() == 1 && (subTitle!="") || (!subTitle.equals("")) || (!subTitle.equalsIgnoreCase(""))))
{
label.setText( subTitle + " : " + getMonth(parameterList.get(1)) );
}
else
{
label.setText(title.get(0)+ " : " +getMonth( parameterList.get(1)));//+ "-" + parameterList.get(2));
}
} }
} }
\ No newline at end of file
...@@ -19,13 +19,14 @@ import com.google.gwt.xml.client.XMLParser; ...@@ -19,13 +19,14 @@ import com.google.gwt.xml.client.XMLParser;
public class GWTDashBoardReport implements EntryPoint public class GWTDashBoardReport implements EntryPoint
{ {
ArrayList<String> parameterList = new ArrayList<String>(); ArrayList<String> parameterList = new ArrayList<String>();
ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>(); public static ArrayList<FilterInfo> filterList = new ArrayList<FilterInfo>();
HorizontalPanel hpanel= new HorizontalPanel(); HorizontalPanel hpanel= new HorizontalPanel();
String metadataname = ""; String metadataname = "";
// added by swati 30 dec 2014 for subtitle // added by swati 30 dec 2014 for subtitle
public static String subTitle=""; public static String subTitle="";
public static boolean flag= false; public static boolean flag= false;
public static String prdFilterName= "";
// ended by swati 30 dec 2014 for subtitle // ended by swati 30 dec 2014 for subtitle
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void onModuleLoad() public void onModuleLoad()
...@@ -85,12 +86,15 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -85,12 +86,15 @@ public class GWTDashBoardReport implements EntryPoint
month="0"+month; month="0"+month;
} }
monthYear=year+month; monthYear=year+month;
int count =0;
if(filterList.size()>0) if(filterList.size()>0)
{ {
for (FilterInfo filterInfo : filterList) for (FilterInfo filterInfo : filterList)
{ {
if(filterInfo.getColNameId().equals("PRD_SALESDASH")) count++;
if(count==1)//if(filterInfo.getColNameId().equals("LAST_MONTH"))
{ {
prdFilterName=filterInfo.getColNameId();
parameterList.add(Window.Location.getParameter(filterInfo.getColNameId()) == null ? monthYear : Window.Location.getParameter(filterInfo.getColNameId())); parameterList.add(Window.Location.getParameter(filterInfo.getColNameId()) == null ? monthYear : Window.Location.getParameter(filterInfo.getColNameId()));
} }
else else
......
...@@ -63,10 +63,13 @@ public class GraphComponent extends Composite ...@@ -63,10 +63,13 @@ public class GraphComponent extends Composite
/*End code for progess bar to data building- Dhanendra 17Nov2014*/ /*End code for progess bar to data building- Dhanendra 17Nov2014*/
public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj) public GraphComponent(ArrayList<String> parameterList, JSONObject metaDataJsnObj)
{ {
String isShowfilter= Window.Location.getParameter("FLAG");
this.jsonObjMetaData = metaDataJsnObj; this.jsonObjMetaData = metaDataJsnObj;
this.parameterList = parameterList; this.parameterList = parameterList;
mainContainer.setWidth("100%"); mainContainer.setWidth("100%");
if(! ("N").equalsIgnoreCase(isShowfilter)){
mainContainer.add(new FilterCreator(parameterList, metaDataJsnObj)); mainContainer.add(new FilterCreator(parameterList, metaDataJsnObj));
}
initWidget(mainContainer); initWidget(mainContainer);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -160,7 +163,7 @@ public class GraphComponent extends Composite ...@@ -160,7 +163,7 @@ public class GraphComponent extends Composite
// end- added empty json chartdata to display no data found message by swati on 7jan2015 // end- added empty json chartdata to display no data found message by swati on 7jan2015
if (graphJson != null && graphJson.size() > 0) if (graphJson != null && graphJson.size() > 0)
{ {
this.createChart(graphJson.toString().replace('$', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName); this.createChart(graphJson.toString().replace('@', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName);
} }
} }
} }
...@@ -195,7 +198,7 @@ public class GraphComponent extends Composite ...@@ -195,7 +198,7 @@ public class GraphComponent extends Composite
} else if("DataGrid".equalsIgnoreCase(component)) } else if("DataGrid".equalsIgnoreCase(component))
{ {
flexTable = new FlexTable(); flexTable = new FlexTable();
CustomGrid data = new CustomGrid(10); CustomGrid data = new CustomGrid(8);
flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId); flexTable = data.jsonToArrayList(gridNGraphMeataDataMap, jsonObjFrGraph,dtSrouce,componentId);
Button excelBtn = new Button("Export To Excel"); Button excelBtn = new Button("Export To Excel");
excelBtn.setTitle("Excel"); excelBtn.setTitle("Excel");
...@@ -247,7 +250,7 @@ public class GraphComponent extends Composite ...@@ -247,7 +250,7 @@ public class GraphComponent extends Composite
// end- added empty json chartdata to display no data found message by swati on 7jan2015 // end- added empty json chartdata to display no data found message by swati on 7jan2015
if (graphJson != null && graphJson.size() > 0) if (graphJson != null && graphJson.size() > 0)
{ {
this.createChart(graphJson.toString().replace('$', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName); this.createChart(graphJson.toString().replace('@', '='), "chartContainer" + componentId, "chartContainer" + componentId, width, height, imageName);
} }
} }
} }
...@@ -310,7 +313,6 @@ public class GraphComponent extends Composite ...@@ -310,7 +313,6 @@ public class GraphComponent extends Composite
if(i==0) if(i==0)
{ {
objActionPath=objActionPath + "?" + filterInfo.getName()+"="+parameterList.get(cnt); objActionPath=objActionPath + "?" + filterInfo.getName()+"="+parameterList.get(cnt);
}else }else
{ {
objActionPath=objActionPath + "&" + filterInfo.getName()+"="+parameterList.get(cnt); objActionPath=objActionPath + "&" + filterInfo.getName()+"="+parameterList.get(cnt);
...@@ -400,7 +402,6 @@ public class GraphComponent extends Composite ...@@ -400,7 +402,6 @@ public class GraphComponent extends Composite
{ {
if (STATUS_CODE_OK == response.getStatusCode()) if (STATUS_CODE_OK == response.getStatusCode())
{ {
if (response.getText().trim().length() > 2) //if code is relese to OTC then Comment this if condition Dhanendra 07Nov2014 if (response.getText().trim().length() > 2) //if code is relese to OTC then Comment this if condition Dhanendra 07Nov2014
{ {
JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(response.getText()); JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(response.getText());
...@@ -411,7 +412,6 @@ public class GraphComponent extends Composite ...@@ -411,7 +412,6 @@ public class GraphComponent extends Composite
{ {
componentDataMap.put(key, null); componentDataMap.put(key, null);
RootPanel.get("chartContainer"+key).clear(); RootPanel.get("chartContainer"+key).clear();
} }
if (componentDataMap.size() == datsSourceDtlMap.size()) if (componentDataMap.size() == datsSourceDtlMap.size())
{ {
...@@ -422,7 +422,6 @@ public class GraphComponent extends Composite ...@@ -422,7 +422,6 @@ public class GraphComponent extends Composite
Window.alert("Responce for getData null"); Window.alert("Responce for getData null");
} }
} }
@Override @Override
public void onError(com.google.gwt.http.client.Request request, Throwable exception) public void onError(com.google.gwt.http.client.Request request, Throwable exception)
{ {
...@@ -434,7 +433,6 @@ public class GraphComponent extends Composite ...@@ -434,7 +433,6 @@ public class GraphComponent extends Composite
e.printStackTrace(); e.printStackTrace();
e12LoadImg.setLoading(false); e12LoadImg.setLoading(false);
} }
} }
} }
public boolean isNumeric(String s) { public boolean isNumeric(String s) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment