/**
 * 
 */
package ibase.dashboard.mfg.bean;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.List;
import ibase.dashboard.mfg.ejb.BSRTransferReportRemote;
import ibase.system.config.AppConnectParm;
import ibase.webitm.utility.ITMException;
import javax.naming.InitialContext;

/**
 * @author base
 *
 */
public class BSRTransferReportBean

{
	BSRTransferReportRemote  bSRTrnsfrRmt=null;

	/**
	 * 
	 */
	public BSRTransferReportBean()
	{
		AppConnectParm appConnectParm=new AppConnectParm();
		try
        {
	        InitialContext context=new InitialContext(appConnectParm.getProperty());
	        System.out.println(" in BSRTransferReportBean method");
	        bSRTrnsfrRmt =(BSRTransferReportRemote)context.lookup("ibase/BSRTransferReport/remote");
	        System.out.println(" after in BSRTransferReportBean method"+bSRTrnsfrRmt);
        }
		catch (Exception e)
        {
			System.out.println(" ibase.dashboard.mfg.bean :BSRTransferReportBean "+e.getMessage());
	        e.printStackTrace();
        }
	}
	public String getBSRTransfer(String frmDate,String toDate,String geoLoc,String unitForm) throws RemoteException, ITMException
    {
		String xmlString="";
		try
		{
		xmlString= bSRTrnsfrRmt.getBSRTransfer(frmDate, toDate,geoLoc,unitForm);
		}
		catch (Exception e)
		{
			System.out.println("ibase.dashboard.mfg.bean :BSRTransferReportBean "+e.getMessage());
	        e.printStackTrace();
		}
		
		return xmlString;
    }
	
	public String getGeoLoCodeXmlData() throws RemoteException, ITMException
    {
		String xmlDataString="";
		try
		{
			xmlDataString= bSRTrnsfrRmt.getGeoLoCodeXmlData();
		}
		catch (Exception e)
		{
			System.out.println("ibase.dashboard.mfg.bean :BSRTransferReportBean "+e.getMessage());
	        e.printStackTrace();
		}
		
		return xmlDataString;
    }
	
	public String getUnitFormXmlData() throws RemoteException, ITMException
    {
		String xmlDataString="";
		try
		{
			xmlDataString= bSRTrnsfrRmt.getUnitFormXmlData();
		}
		catch (Exception e)
		{
			System.out.println("ibase.dashboard.mfg.bean :BSRTransferReportBean "+e.getMessage());
	        e.printStackTrace();
		}
		
		return xmlDataString;
    }
	
	
	
	public String generatePDF(HashMap<String, List<String>> hashMap ,String exportPDFPath,String exportImagePath,String preyearMonth,String rptTitle,String userID) throws RemoteException, ITMException
       {
		String resultString="false";
		try
		{
			
			
		  resultString= bSRTrnsfrRmt.generatePDF(hashMap,exportPDFPath,exportImagePath,preyearMonth,rptTitle,userID);
		}
		catch (Exception e)
		{
			System.out.println("ibase.dashboard.mfg.bean :ProductionVsBudgetReportBean "+e.getMessage());
	        e.printStackTrace();
		}
		
		return resultString;
    }
	
	
}

