-2

I have face sum of column value

//////////////visualforce page///////

<apex:page controller="importDataFromCSVController" sidebar="false" standardStylesheets="false"  cache="true" applyBodyTag="true" 
           applyHtmlTag="true" showHeader="true" contentType="{!IF(isExport = true, 'application/vnd.ms-excel#report.xls', '')}">


      <!--------https://salesforce.stackexchange.com/questions/232314/aggregateresult-grand-total-on-vf-page?rq=1---------->
      <!---------------------https://salesforce.stackexchange.com/questions/17204/getting-count-of-records-in-vf-page----------------------->




    <style>
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  text-align: center;
  padding: 8px;
}

tr:nth-child(even){background-color: #f2f2f2}

th {
  background-color: #4CAF50;
  color: white;
}

p.two {
  border-style: solid;
  border-width: medium;
</style>



   <!---   <style>

      style {        
            border:0.8px solid black;
    }

    th {
           border:0.8px solid black;
    }

.h1 
{ 
    display: block;font-size: 1.2em;
    font-weight: bold;
}
.rules_form2 * {
   background-color:#00cc00;
           color: white; 

    font-size:13px;

}
</style> --->

<style>
        .mikoclass
        {
            border: 1px solid black;
        }
    </style>


 <script>
        function refersh(){
            var url = window.location.href;
            window.location = url;
        }
    </script> 
    <!---------Headecolor------#F0F8FF---->
    <style>
  .headerRow .TableTitle {
    background-color: #FFFF00 !important;
    background-image: none !important; //This is needed if you want to overwrite the header background
    color: #00cc00 !important; 
    font-size:100% !important; 

  }
  .headerRow .TableTitle1 {
    background-color: #ADFF2F !important;
    background-image: none !important; //This is needed if you want to overwrite the header background
    color: #00cc00 !important; 
    font-size:100% !important; 
  }
  </style>
    <!-----headercolor------------>

    <apex:form >
        <apex:pagemessages />

         <apex:pageBlock >


       <apex:pageBlockSection columns="8"  > 
              <apex:outputPanel rendered="{!(isExport = false)}">
                <apex:inputFile value="{!csvFileBody}"  filename="{!csvAsString}"/>
               <apex:commandButton value="Import CAMT File" action="{!importCSVFile}" rendered="{!camtlist.size!=Null}" disabled="{!IF((camtlist.size>0 ), true, false)}"/>  <!-------->
                 </apex:outputPanel> 

                 <apex:outputPanel rendered="{!(isExport = false)}">
                    <apex:commandButton value="Download Excel" action="{!ExcelFileDownload}"  rendered="{!camtlist.size>0}"/>   <!---- rendered="{!camtlist.size>0}"----->
                    <input type="button" class="btn" value="Clear" onclick="refersh();" style="{!IF((camtlist.size>0 ), '', 'display:none')}"/>
                 </apex:outputPanel>              
        </apex:pageBlockSection> 

        </apex:pageBlock> 


        <apex:pageBlock rendered="{!camtlist.size>0}">
           <apex:pageblocktable value="{!camtlist}" var="cam"  style="border:1px solid black">
                <table border="1">
                <!--- CAMT File Uploaded --->
             <!---  <apex:column value="{!cam.Name}" headerValue="ESR Number"/>
               <apex:column value="{!cam.CAMT_ESRNumber_optional__c}" headerValue="CAMT ESR Number"/>
               <apex:column value="{!cam.Status__c}" headerValue="CAMT Status"/>  -style="text-align: center"-->



         <apex:column value="{!cam.CAMT_IDNUMBER__c  }" headerValue="CAMT ESR ID" style="border:1px solid black" Headerclass="TableTitle">

                   <apex:facet name="footer">
                    <apex:outputText value="Total:" style="float: left;"/> 
                                        </apex:facet>


                    </apex:column>
           <!--- <apex:column value="{!cam.CAMT_ESR_Numberformula_del__c}" headerValue="CAMT ESR ID"/> --->
            <apex:column value="{!cam.CAMT_ESRNumber__c}" headerValue="CAMT ESRNUmber" style="border:1px solid black" Headerclass="TableTitle"/>


            <!---  <apex:column value="{!cam.CAMT_TotalAmount__c}" headerValue="CAMT Total Amount"> --->

                 <apex:column headerValue="camt Amount" styleClass="txt" headerClass="rules_form2" style="border:1px solid black" Headerclass="TableTitle">

                     <apex:outputField value="{!cam.CAMT_TotalAmount__c}"/>
                   <apex:facet name="footer">
                    <!---<apex:outputText value="Total:" style="float: left;"/> --->

                 <apex:repeat value="{!QuoteTotal}" var="ar" >

                    <apex:outputText value="{!ar['ca']}"/>

                 </apex:repeat>
                </apex:facet> 



                </apex:column> 




              <apex:column value="{!cam.CAMT_Customer_Name__c}" headerValue="CAMT Customer Name" headerClass="rules_form2" style="border:1px solid black" Headerclass="TableTitle"/>
              <apex:column value="{!cam.CAMT_CustomerAddress__c}" headerValue="CAMT Customer Address" headerClass="rules_form2" style="border:1px solid black" Headerclass="TableTitle"/> 
               <apex:column value="{!cam.CAMT_Payment_Date__c}" headerValue="CAMT Payment Date" headerClass="rules_form2" style="border:1px solid black" Headerclass="TableTitle"/>

             <!--- <apex:column value="{!cam.CAMT_Upload_Date_File__c}" headerValue="CAMT:Upload Date File" />--------->
             <!---<apex:column value="{!cam.CAMT_Payment__c}" headerValue="CAMT:CAMT Payment" />--->
             <!--- <apex:column value="{!cam.CAMT_CustomerAddress__c}" headerValue="CAMT Customer Address" /> --->

                <!-------------------------------------------->
                <apex:column headerValue="Process Match" style="background:#90EE90;"  >

                      <apex:outputField value="{!cam.ESR_Status__c}"/>
                       <apex:facet name="footer"> 
                    <!---<apex:outputText value="Total:" style="float: left;"/> --->

                     <apex:repeat value="{!QuoteTotal}" var="ar"  > 

                    <apex:outputText value="{!ar['pa']}"/>
                 </apex:repeat>
                </apex:facet> 


             <!----   <apex:repeat value="{!ansalpha }" var="c">
           <apex:outputField value="{!cam.ESR_Status__c}"/>
          <apex:outputText value="{!Floor(camtlist.Size)}"/>
         </apex:repeat>  --->

                </apex:column>

                <!---------------------------------------------->


              <!---- Fetch Data From Data Base --->

            <!--- <apex:column value="{!cam.ESR_Status__c}" headerValue="Process Match" />---->
              <apex:column value="{!cam.Name}"  headerValue="ESRNumber" style="border:1px solid black" Headerclass="TableTitle1"/>
            <!---  <apex:column value="{!cam.Total_Amount__c}" headerValue="Total Amount"/> --->

            <apex:column headerValue="Total Amount" styleClass="txt" headerClass="col" style="border:1px solid black" Headerclass="TableTitle1">
                    <apex:outputField value="{!cam.Total_Amount__c}"/>

                   <apex:facet name="footer">
                    <apex:outputText value="Total:" style="float: left;"/> 

                     <apex:repeat value="{!QuoteTotal}" var="ar" > 
                 <apex:outputText value="{!ar[ 'cy' ]}" />

                </apex:repeat>
                </apex:facet>
                </apex:column>

              <apex:column value="{!cam.ThreShold__c}" headerValue="Threshold Value" style="border:1px solid black" Headerclass="TableTitle1"/>
              <apex:column value="{!cam.Customer_Name__c}" headerValue="Customer Name" style="border:1px solid black" Headerclass="TableTitle1"/>
              <apex:column value="{!cam.Customer_Street__c}" headerValue="Customer street" style="border:1px solid black" Headerclass="TableTitle1"/>
              <apex:column value="{!cam.Customer_City_del__c}" headerValue="Customer City" style="border:1px solid black" Headerclass="TableTitle1" />
              <apex:column value="{!cam.Customer_State__c}" headerValue="Customer State" style="border:1px solid black" Headerclass="TableTitle1" />
              <apex:column value="{!cam.Customer_Country_del__c}" headerValue="Customer Country"  style="border:1px solid black" Headerclass="TableTitle1"/>
              <apex:column value="{!cam.Customer_Pincode_del__c}" headerValue="Customer Pincode"  style="border:1px solid black" Headerclass="TableTitle1"/>
             <apex:column value="{!cam.Company_Name__c}" headerValue="Company Name" style="border:1px solid black" Headerclass="TableTitle1"/>
             <apex:column value="{!cam.Payment__c}" headerValue="Payment" style="border:1px solid black" Headerclass="TableTitle1"/> 
              <apex:column value="{!cam.Payment_Date__c}" headerValue="Payment Date" style="border:1px solid black" Headerclass="TableTitle1"/> 


            <!---<apex:column value="{!cam.Difference__c}" headerValue="Difference" />--->
             <apex:column headerValue="Difference" styleClass="txt" headerClass="col" style="border:1px solid black">
                    <apex:outputField value="{!cam.Difference__c}"/>

                   <apex:facet name="footer">
                    <apex:outputText value="Total:" style="float: left;"/> 

                     <apex:repeat value="{!QuoteTotal}" var="ar" > 
                 <apex:outputText value="{!ar[ 'df' ]}" />

                </apex:repeat>
                </apex:facet>
                </apex:column>

         </table>
        </apex:pageblocktable>


     </apex:pageBlock>

   <!---  <style type="text/css">
        .SectHeader {
            font-weight: bold;
            font-size:10pt;
            background: #288fb0;
            color: white;
            width:100%;
            border:1px solid black;
            padding:8px;
            border-radius:5px;
            }
        .col{
            text-align:center;
            }
        .txt{
            text-align:center;
            }
    </style> --->

   </apex:form>
</apex:page>

/////////////////////controlller///////

public with sharing class importDataFromCSVController {

   // public String QuoteTotal { get; set; }

   /////////////////////
   public  Map<string, integer> ansalpha {get ;
   /*{

   AggregateResult[] groupedResults = [select count(ESR_Status__c) from ESR_Assignment__c where id in:camtlist];

  Map<string,integer> mapCntIdByapplicationCount=new Map<string,integer>();

     for(AggregateResult a:groupedResults){
         mapCntIdByapplicationCount.put(String.valueof(a.get('ESR_Status__c')),integer.valueof(string.valueof(a.get('expr0'))));
  }

   return mapCntIdByapplicationCount; 
  } */
 set;}

   ///////////


    public List<AggregateResult> QuoteTotal{


        get{
            List<AggregateResult> qt = [SELECT  sum(Total_Amount__c)cy,sum(CAMT_TotalAmount__c)ca,sum(Difference__c)df ,count(ESR_Status__c)pa from ESR_Assignment__c where id in:camtlist];
            return qt;

            }
        set;

    }     




    public integer total1 { get; set; }

 public Blob csvFileBody {get;set;}
 public String csvAsString {get;set;}
 public String[] CsvFileLines {get;set;}
 public List < ESR_Assignment__c > camtlist {get;set;}
 public Boolean isExport{get;set;}
 public Boolean Isexprots {get;set;}
 public Boolean exprots {get;set;}

 public Map < String, ESR_Assignment__c > esrNoByESR;

 public list<AggregateResult> totalsum {get;set;}
 public integer totalsum1{get;set;}

 public decimal trno {get;set;}
 public String xmlheader {get;set;}
 public String endfile{get;set;}

 public importDataFromCSVController() {


 ////////////////aggregate/////////////
 /* totalsum1=[Select count() From ESR_Assignment__c ];
totalsum=new list<AggregateResult>(); */

//totalsize.add(totalsum);
 totalsum1=[Select count() From ESR_Assignment__c ];
totalsum=new list<AggregateResult>();
 //////////
 isExport = False;
  CsvFileLines = new string[] {};
  camtlist = new list < ESR_Assignment__c > ();
  esrNoByESR = new Map < String, ESR_Assignment__c > ();

  for (ESR_Assignment__c objesrs: [select id, Name, ESR_Status__c, Payment__c, Payment_Date__c, Company_Name__c, Difference__c, Customer_Street__c,Customer_City_del__c,Customer_State__c,
                                    Customer_Country_del__c,Customer_Pincode_del__c,CAMT_Payment_Date__c,CAMT_IDNUMBER__c,Threshold__c,
                                    CAMT_ESRNumber__c, Total_Amount__c, CAMT_TotalAmount__c, Customer_Name__c,
                                    CAMT_Customer_Name__c, CAMT_CustomerAddress__c,
                                    CAMT_Upload_Date_File__c from ESR_Assignment__c
                                   ]) {

        esrNoByESR.put(objesrs.Name, objesrs);
        esrNoByESR.put(objesrs.CAMT_ESRNumber__c, objesrs);
  }
    system.debug('==33==' + esrNoByESR);
 }

 public void importCSVFile() {
  csvAsString = csvFileBody.toString();
  CsvFileLines = csvAsString.split('\n');
  system.debug('====' + esrNoByESR);
  List < ESR_Assignment__c > upertToList = new List < ESR_Assignment__c > ();

  for (Integer i = 1; i < CsvFileLines.size(); i++) {

   String[] CsvRecordData = CsvFileLines[i].split(',');
   ESR_Assignment__c objesrs = new ESR_Assignment__c();


    String esrnum = (CsvRecordData[1]).trim();

   //String esrnum = (CsvRecordData[0]).trim();
   system.debug('==='+(CsvRecordData[1]).trim());


   Decimal camttotalAmount =0.00;
   if(!String.isEmpty((CsvRecordData[2]).trim())){
       camttotalAmount = decimal.valueof((CsvRecordData[2]).trim());
   }

 // Decimal thr=0.00;
 // thr=decimal.valueof(Threshold__c); 


   ///////////////////////scenario3/////////////

  if (esrNoByESR.keySet() !=Null && esrNoByESR.containsKey(esrnum)){
     objesrs.id = esrNoByESR.get(esrnum).id;
     objesrs.Name = (CsvRecordData[1]);
   //  objesrs.Payment__c=(CsvRecordData[1]);
     //String de = String.valueof(CsvRecordData[0]);
     //system.debug('dedded=' + de);
   // objesrs.CAMT_ESRNumber__c = Decimal.valueof(de.trim());

   /*  objesrs.CAMT_ESRNumber__c =(CsvRecordData[0]);
     objesrs.CAMT_IDNUMBER__c=(CsvRecordData[4]);
     objesrs.CAMT_Payment_Date__c=mydate; */

     //objesrs.Name=objesrs.CAMT_ESRNumber__c;
       // if( objesrs.Status__c == ''){
    // objesrs.Status__c = 'Match';
    // upertToList.add(objesrs);
    // }
         } 

    /*if there is ESR Number is not matched to csv file number this else part will create new esr recordaccordingly */
     else{    
        // objesrs.Name = (CsvRecordData[0]);
        // String de = String.valueof(CsvRecordData[0]);
         //system.debug('dedded=' + de);
        // objesrs.CAMT_ESRNumber_optional__c = Decimal.valueof(de.trim());
       // objesrs.CAMT_ESR_Numberformula_del__c=(CsvRecordData[0]);
          objesrs.CAMT_IDNUMBER__c=(CsvRecordData[0]);
         objesrs.CAMT_ESRNumber__c =(CsvRecordData[1]);
         objesrs.CAMT_TotalAmount__c = camttotalAmount ;
         objesrs.CAMT_Customer_Name__c=(CsvRecordData[3]);
         objesrs.CAMT_CustomerAddress__c=(CsvRecordData[4]);
         objesrs.CAMT_Payment_Date__c=Date.valueof((CsvRecordData[5])); 


         objesrs.ESR_Status__c= 'No Match';
         objesrs.Name='0';
         objesrs.Total_Amount__c=0;
         objesrs.Company_Name__c='Null';
         objesrs.Customer_Name__c='Null';
         objesrs.Customer_Street__c='Null';
         objesrs.Customer_City_del__c='Null';
         objesrs.Customer_State__c='Null';
         objesrs.Customer_Country_del__c='Null';
         objesrs.Customer_Pincode_del__c='Null';
         objesrs.Threshold__c=0;


         objesrs.Payment__c=Null;
         objesrs.Difference__c=0; 
       //  upertToList.add(objesrs);
         }

   ////////////////////////secanrio4///////////////////

   if (esrNoByESR.keySet() != Null && esrNoByESR.containsKey(esrnum) && esrNoByESR.get(esrnum).Payment__c == 'Not Paid' &&
    esrNoByESR.get(esrnum).Total_Amount__c == camttotalAmount && esrNoByESR.get(esrnum).Total_Amount__c < = esrNoByESR.get(esrnum).Threshold__c) {


 //  if (esrNoByESR.keySet() != Null && esrNoByESR.containsKey(esrnum) && esrNoByESR.get(esrnum).Payment__c == 'Not Paid' && esrNoByESR.get(esrnum).Total_Amount__c == camttotalAmount ) {
    objesrs.id = esrNoByESR.get(esrnum).id;
    objesrs.Name = (CsvRecordData[1]);
    //objesrs.CAMT_ESR_Numberformula__c= camtesrnumber;
    objesrs.CAMT_IDNUMBER__c=(CsvRecordData[0]);
    objesrs.CAMT_ESRNumber__c =(CsvRecordData[1]);
    objesrs.CAMT_TotalAmount__c = camttotalAmount ;
    objesrs.CAMT_Customer_Name__c=(CsvRecordData[3]);
    objesrs.CAMT_CustomerAddress__c=(CsvRecordData[4]);
    objesrs.CAMT_Payment_Date__c=Date.valueof((CsvRecordData[5])); 


    system.debug('esrNoByESR.get(esrnum).Total_Amount__c=' + esrNoByESR.get(esrnum).Total_Amount__c);
    objesrs.Total_Amount__c = esrNoByESR.get(esrnum).Total_Amount__c;
    objesrs.Customer_Name__c = esrNoByESR.get(esrnum).Customer_Name__c;
    objesrs.Difference__c = esrNoByESR.get(esrnum).Difference__c;
    objesrs.Payment__c = esrNoByESR.get(esrnum).Payment__c;
    objesrs.Payment_Date__c = esrNoByESR.get(esrnum).Payment_Date__c;
    objesrs.Company_Name__c = esrNoByESR.get(esrnum).Company_Name__c;
    objesrs.Customer_Street__c=esrNoByESR.get(esrnum).Customer_Street__c;
    objesrs.Customer_City_del__c=esrNoByESR.get(esrnum).Customer_City_del__c;
    objesrs.Customer_State__c=esrNoByESR.get(esrnum).Customer_State__c;
    objesrs.Customer_Country_del__c=esrNoByESR.get(esrnum).Customer_Country_del__c;
    objesrs.Customer_Pincode_del__c=esrNoByESR.get(esrnum).Customer_Pincode_del__c;
    objesrs.Threshold__c=esrNoByESR.get(esrnum).Threshold__c;


 //   objesrs.Test__c = Integer.valueof((CsvRecordData[0]).trim());

    objesrs.Payment__c ='Paid';
    objesrs.ESR_Status__c= 'Match';
    objesrs.Difference__c=0;
    upertToList.add(objesrs);
   }

   //////////////////////////secanrio 5//////////
   else if (esrNoByESR.keySet() != Null && esrNoByESR.containsKey(esrnum) && esrNoByESR.get(esrnum).Payment__c == 'Not Paid' &&
    esrNoByESR.get(esrnum).Total_Amount__c != camttotalAmount && esrNoByESR.get(esrnum).Total_Amount__c < = esrNoByESR.get(esrnum).Threshold__c) {


 //  else if (esrNoByESR.keySet() != Null && esrNoByESR.containsKey(esrnum) && esrNoByESR.get(esrnum).Payment__c == 'Not Paid' && esrNoByESR.get(esrnum).Total_Amount__c != camttotalAmount  ) {


     objesrs.id = esrNoByESR.get(esrnum).id;
     objesrs.Name = (CsvRecordData[1]);
   //  objesrs.Test__c = Integer.valueof((CsvRecordData[0]).trim());

    //objesrs.CAMT_ESR_Numberformula__c= camtesrnumber;
    objesrs.CAMT_IDNUMBER__c=(CsvRecordData[0]);
    objesrs.CAMT_ESRNumber__c =(CsvRecordData[1]);
    objesrs.CAMT_TotalAmount__c = camttotalAmount ;
    objesrs.CAMT_Customer_Name__c=(CsvRecordData[3]);
    objesrs.CAMT_CustomerAddress__c=(CsvRecordData[4]);
    objesrs.CAMT_Payment_Date__c=Date.valueof((CsvRecordData[5])); 

    system.debug('esrNoByESR.get(esrnum).Total_Amount__c=' + esrNoByESR.get(esrnum).Total_Amount__c);
    objesrs.Total_Amount__c = esrNoByESR.get(esrnum).Total_Amount__c;
    objesrs.Customer_Name__c = esrNoByESR.get(esrnum).Customer_Name__c;
    objesrs.Difference__c = esrNoByESR.get(esrnum).Difference__c;
    objesrs.Payment__c = esrNoByESR.get(esrnum).Payment__c;
    objesrs.Payment_Date__c = esrNoByESR.get(esrnum).Payment_Date__c;
    objesrs.Company_Name__c = esrNoByESR.get(esrnum).Company_Name__c;
    system.debug(camttotalAmount+'==='+esrNoByESR.get(esrnum).Total_Amount__c+'===='+(camttotalAmount-esrNoByESR.get(esrnum).Total_Amount__c).toPlainString());
    objesrs.Difference__c=camttotalAmount-esrNoByESR.get(esrnum).Total_Amount__c;
    objesrs.Customer_Street__c=esrNoByESR.get(esrnum).Customer_Street__c;
    objesrs.Customer_City_del__c=esrNoByESR.get(esrnum).Customer_City_del__c;
    objesrs.Customer_State__c=esrNoByESR.get(esrnum).Customer_State__c;
    objesrs.Customer_Country_del__c=esrNoByESR.get(esrnum).Customer_Country_del__c;
    objesrs.Customer_Pincode_del__c=esrNoByESR.get(esrnum).Customer_Pincode_del__c;
    objesrs.Threshold__c=esrNoByESR.get(esrnum).Threshold__c;

    objesrs.ESR_Status__c= 'Difference';
  //  objesrs.Test__c = Integer.valueof((CsvRecordData[0]).trim());

    upertToList.add(objesrs);

   }

   //////////////////////secanrio 6////////////////////
   /*if there is ESR Number is not matched to csv file number this else part will create new esr recordaccordingly */
   else if (esrNoByESR.keySet() != Null && esrNoByESR.containsKey(esrnum) && esrNoByESR.get(esrnum).Payment__c == 'Paid') {
    objesrs.id = esrNoByESR.get(esrnum).id;
    objesrs.Name = (CsvRecordData[1]);
    //objesrs.CAMT_ESR_Numberformula__c= camtesrnumber;//objesrs.Test__c = Integer.valueof((CsvRecordData[0]).trim());
    objesrs.CAMT_IDNUMBER__c=(CsvRecordData[0]);
    objesrs.CAMT_ESRNumber__c =(CsvRecordData[1]);
    objesrs.CAMT_TotalAmount__c = camttotalAmount;
    objesrs.CAMT_Customer_Name__c=(CsvRecordData[3]);
    objesrs.CAMT_CustomerAddress__c=(CsvRecordData[4]);
    objesrs.CAMT_Payment_Date__c=Date.valueof((CsvRecordData[5]));  


    system.debug('esrNoByESR.get(esrnum).Total_Amount__c=' + esrNoByESR.get(esrnum).Total_Amount__c);
    objesrs.Total_Amount__c = esrNoByESR.get(esrnum).Total_Amount__c;
    objesrs.Customer_Name__c = esrNoByESR.get(esrnum).Customer_Name__c;
    objesrs.Difference__c = esrNoByESR.get(esrnum).Difference__c;
    objesrs.Payment__c = esrNoByESR.get(esrnum).Payment__c;
    objesrs.Payment_Date__c = esrNoByESR.get(esrnum).Payment_Date__c;
    objesrs.Company_Name__c = esrNoByESR.get(esrnum).Company_Name__c;
    objesrs.Customer_Street__c=esrNoByESR.get(esrnum).Customer_Street__c;
    objesrs.Customer_City_del__c=esrNoByESR.get(esrnum).Customer_City_del__c;
    objesrs.Customer_State__c=esrNoByESR.get(esrnum).Customer_State__c;
    objesrs.Customer_Country_del__c=esrNoByESR.get(esrnum).Customer_Country_del__c;
    objesrs.Customer_Pincode_del__c=esrNoByESR.get(esrnum).Customer_Pincode_del__c;
    objesrs.Threshold__c=esrNoByESR.get(esrnum).Threshold__c;

    objesrs.ESR_Status__c= 'Already Match';
    objesrs.Difference__c=0;
    upertToList.add(objesrs);
   }



   camtlist.add(objesrs);
  }


  system.debug('list==' + camtlist);
 // try{
  system.debug('coming' + upertToList);
  if (camtlist.size() > 0)
   update upertToList;
  system.debug('going out ' + upertToList);
 //  }     
  /* Catch(Exception e){

    Apexpages.Message errorMessage =new Apexpages.Message(Apexpages.severity.ERROR,'An error is occured when importing data Please make sure input csv file is correct');

   Apexpages.AddMessage(errorMessage );
   }
   */
  // return null;
 }


 public PageReference ExcelFileDownload() {


 ////////////////

 //xmlheader ='<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?>';
   // endfile = '</Workbook>';
   // opportunities = [SELECT Id, Name, StageName, Amount FROM Opportunity LIMIT 10];
   // oppSize = opportunities.size();

 ////////////


  isExport = true;



  return null;
 }


 /*
 public Void gettotalsum1(){
AggregateResult[] groupedresult=[Select sum(Total_Amount__c) From ESR_Assignment__c ];
object totalsum1=groupedresult[0].get('total');
//return totalsum;

} */

}

/*   CHF////https://stackoverflow.com/questions/23867934/culture-currency-format-de-ch-gives-fr-instead-of-chf-how-to-get-chf//////////https://salesforce.stackexchange.com/questions/227549/swiss-currency-by-using-culture-code/227638

<script runat="server">

protected void Application_BeginRequest()
{
    System.Globalization.CultureInfo cInf = new System.Globalization.CultureInfo("de-CH", false);

    cInf.NumberFormat.CurrencySymbol = "CHF";

    System.Threading.Thread.CurrentThread.CurrentCulture = cInf;
    System.Threading.Thread.CurrentThread.CurrentUICulture = cInf;
}

</script>

*/
  • 3
    Please format your code. – Reshma Jan 11 at 7:05
  • This is far too much code. Please cut your question down to a minimal example and add a detailed description of what you're trying to do and what is not working. – David Reed Jan 11 at 12:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.