• Radhika pawar 5
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 35
    Questions
  • 13
    Replies
Hi Frnds Plz Guide me for Exporting  Google Chart to excel From Vf Page .


<script type="text/javascript"> // google.load("visualization", "1", {packages:["corechart"]}); // google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['X', '{!lstwrap1Sub[lstwrap1Sub.size-1].grouper}'], ['Govt Official', {!lstwrap1Sub[lstwrap1Sub.size-1].Govt_Official}], ['state_head', {!lstwrap1Sub[lstwrap1Sub.size-1].state_head}], ['SRG', {!lstwrap1Sub[lstwrap1Sub.size-1].SRG}], ['BC_DRL', {!lstwrap1Sub[lstwrap1Sub.size-1].BC_DRL}], ['MME_TEAM', {!lstwrap1Sub[lstwrap1Sub.size-1].MME_Team}], ['Other_Visits', {!lstwrap1Sub[lstwrap1Sub.size-1].other_visit}] ]); var options = { title: 'Monitoring Visits' }; var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } </script>
 
Please Guide me Only use controller as soon as possible.
I have one Error for Illegal assignment from Decimal to Integer at line 178 column 13

List<Integer> total = new List<Integer>();

table in that SR.No(Serial No) ,Number of villages reached,Govt Schools,Pvt Schools,Other Schools,Avg other schools in the Pratham intervention areas  columns.
Example:                  this are Column
SRNO.   (Number of villages reached)   (Govt Schools )    (Pvt Schools)  (Other Schools)    (Avg other schools in the Pratham intervention areas)
1                             4                                               1                               2                   3                               3+2+1/4=1.5

I want 1.5 values in last column name is Other Schools  Avg other schools in the Pratham intervention areas.
but my out put comes 1  in integer .

please guide me.

My code is this:


public with sharing class ctrl_RI14_other_school_trends {

public List<SelectOption> lstNational {get;set;}
  public List<SelectOption> lstPhase {get;set;}
  //public List<SelectOption> lstDonor = new List<SelectOption>();


  public List<RI_School_Report_Cards__c> lstSchool = new List<RI_School_Report_Cards__c>();
  public List<Report> lstwrap1Sub {get;set;}
  public String strState {get;set;}
  public String strBlocks {get;set;}
  public String strNational {get;set;}
  public String strSchool {get;set;}
  public String strPhase {get;set;}
// public String strDonor {get;set;}
  
  public ctrl_RI14_other_school_trends()
{
    strState = '';
     strBlocks = '';
     strNational = '' ;
     strSchool = '';
     strPhase = '';
// strDonor = '';

    lstPhase = new List<SelectOption>();
    lstPhase.add(new SelectOption('', '- - None - -'));
    Schema.DescribeFieldResult F = RI_School_Report_Cards__c.BCI_CP_P_NO__c.getDescribe();
    for (Schema.PicklistEntry temp : F.getPicklistValues())
     {
      lstPhase.add(new SelectOption(temp.getValue(), temp.getLabel()));
}
    lstNational = new List<SelectOption>();
    lstNational.add(new SelectOption('', '- - None - -'));
    F = RI_School_List__c.National__c.getDescribe();
    for (Schema.PicklistEntry temp : F.getPicklistValues())
    {
      lstNational.add(new SelectOption(temp.getValue(), temp.getLabel()));
    }
  

      lstwrap1Sub = new List<Report>();
  
}

public List<SelectOption> getAttStates() {
    List<SelectOption>lstSchoolStates = new List<SelectOption>();
    AggregateResult []ar = [Select School_List__r.State__c State from RI_School_Report_Cards__c where Submission_No__c != null AND School_List__r.National__c =: strNational GROUP BY School_List__r.State__c];
    lstSchoolStates .add(new SelectOption('','-None-'));
    for(AggregateResult temp: ar) {
      lstSchoolStates.add(new SelectOption(String.valueOf(temp.get('State')),String.valueOf(temp.get('State'))));
    }
    return lstSchoolStates ;
  }

  public List<SelectOption> getAttBlocks() {
    List<SelectOption> lstSchoolBlocks = new List<SelectOption>();
    AggregateResult []ar = [Select School_List__r.block__c block from RI_School_Report_Cards__c where Submission_No__c != null AND School_List__r.state__c =: strState AND School_List__r.National__c =: strNational GROUP BY School_List__r.block__c ];
    lstSchoolBlocks.add(new SelectOption('','-None-'));
    for(AggregateResult temp: ar) {
      lstSchoolBlocks.add(new SelectOption(String.valueOf(temp.get('block')),String.valueOf(temp.get('block'))));
    }
    return lstSchoolBlocks;
  }

public List<SelectOption> getAttSchool() {
    List<SelectOption> lstSchools = new List<SelectOption>();
    List<RI_School_Report_Cards__c> lst = [Select School_List__r.Name, school_list__c, school_list__r.School__c from RI_School_Report_Cards__c where Submission_No__c != null AND Submit_Camp_4__c = true AND School_List__r.state__c =: strState AND School_List__r.National__c =: strNational AND school_list__r.block__c =: strBlocks];
    lstSchools.add(new SelectOption('','-None-'));
    for(RI_School_Report_Cards__c temp: lst) {
      lstSchools.add(new SelectOption(temp.school_list__c, temp.school_list__r.school__c + ' : ' + temp.school_list__r.Name));
    }
    return lstSchools;
  }

public pagereference loadReport()
{
    lstwrap1Sub.clear();
    String query = 'SELECT COUNT(School_List__r.Village__c) reached,SUM(MI_TL_Gov_SL__c) GOV_SL, SUM(MI_TL_Pvt_SL__c) PVT_SL, SUM(MI_TL_Other_SL__c) Other_SL';

    
      if (strState == '' || strState == null)
    {
      query += ', School_List__r.State__c grouper';    
    }
  
    else if(strBlocks == '' || strBlocks == null)
    {
      query += ', School_List__r.block__c grouper';
    }
    else
       {
     if(strSchool == '' || strSchool == null)
     {
     query += ', School_List__r.block__c grouper';
     }
     else
     {
     query += ', School_List__r.Name grouper';
     }
     }

query += ' FROM RI_School_Report_Cards__c WHERE School_List__r.National__c =: strNational AND Submission_No__c != null ';
  
  if (strState != '' && strState != null) {
       query += ' AND school_list__r.state__c =: strState';    
     }
  
  if(strBlocks != '' && strBlocks != null) {
      query += ' AND school_list__r.block__c =: strBlocks';
    }
  
   if(strSchool != '' && strSchool != null) {
    query += ' AND school_list__c =: strSchool';
    }

   if(strPhase != '' && strPhase != null) {
     query += ' AND BCI_CP_P_NO__c =: strPhase';
    }

    if (strState == '' || strState == null) {
      query += ' GROUP BY School_List__r.State__c';
      }
     else if (strBlocks == '' || strBlocks == null)
     {
      query += ' GROUP BY School_List__r.block__c';
         }
         else
       {
       if(strSchool == '' || strSchool == null)
       {query += ' GROUP BY School_List__r.block__c';}
       else
       {query += ' GROUP BY School_List__r.Name ';}
      
        }
     

     AggregateResult []ar = Database.query(query);
    Map <String, Integer> reach = new Map<String, Integer>();
    Map <String, Integer> GOV = new Map<String, Integer>();
    Map <String, Integer> PVT = new Map<String, Integer>();
     Map <String, Integer> Other = new Map<String, Integer>();
  
      for (AggregateResult temp : ar)
      {
      if(Integer.valueOf(temp.get('reached')) !=0)
      {
      reach.put(String.valueOf(temp.get('grouper')), Integer.valueOf(temp.get('reached')));
      }
      GOV.put(String.valueOf(temp.get('grouper')), Integer.valueOf(temp.get('GOV_SL')));
      PVT.put(String.valueOf(temp.get('grouper')), Integer.valueOf(temp.get('PVT_SL')));
      Other.put(String.valueOf(temp.get('grouper')), Integer.valueOf(temp.get('Other_SL')));
    }

  Integer i = 1;
    for(AggregateResult temp : ar)
     {
         lstwrap1Sub.add(new Report(i, String.valueOf(temp.get('grouper')), reach.get(String.valueOf(temp.get('grouper'))), GOV.get(String.valueOf(temp.get('grouper'))), PVT.get(String.valueOf(temp.get('grouper'))),Other.get(String.valueOf(temp.get('grouper'))),
      ((GOV.get(String.valueOf(temp.get('grouper')))+ PVT.get(String.valueOf(temp.get('grouper')))+ Other.get(String.valueOf(temp.get('grouper'))) )/reach.get(String.valueOf(temp.get('grouper'))))  ));
       i++;
    }

     List<Integer> total = new List<Integer>();
    total.add(0);
    total.add(0);
    total.add(0);
    total.add(0);
    total.add(0);
    if (strBlocks == '' || strBlocks == null) {
     for(Report temp : lstwrap1Sub)
     {
      total[0] += temp.reached;
      total[1] += temp.GOV_SL;
      total[2] += temp.PVT_SL;
      total[3] += temp.Other_SL;
      total[4] += temp.avg;
   
    }
  
       lstwrap1Sub.add(new Report(null, 'Total', total[0], total[1], total[2], total[3], total[4]));
       }
    return null;
}

class Report
{
public Integer reached {get;set;}
public String grouper {get;set;}
public Integer sr_no {get;set;}
public Integer GOV_SL{get;set;}
public Integer PVT_SL{get;set;}
public Integer Other_SL{get;set;}
public Integer avg {get;set;}  
   
public Report(Integer sr_no,String grouper,Integer reached,Integer GOVSL,Integer PVTSL,Integer other,Integer avg_gpo )
{
    
      this.grouper = grouper;
      this.sr_no = sr_no;
      this.reached = reached == null ? 0 : reached;
      this.GOV_SL = GOVSL == null ? 0 : GOVSL;
      this.PVT_SL = PVTSL== null ? 0 : PVTSL;
      this.Other_SL = other== null ? 0 : other;
      this.avg  = avg_gpo == null ? 0 :avg_gpo;

   
}
}
}
I have one Error for Illegal assignment from Decimal to Integer at line 178 column 13

List<Integer> total = new List<Integer>();

 table in that SR.No(Serial No) ,Number of villages reached,Govt Schools,Pvt Schools,Other Schools,Avg other schools in the Pratham intervention areas  columns.
Example:                  this are Column
SRNO.   (Number of villages reached)   (Govt Schools )    (Pvt Schools)  (Other Schools)    (Avg other schools in the Pratham intervention areas)
1                             4                                               1                               2                   3                               3+2+1/4=1.5
 
I want 1.5 values in last column name is Other Schools  Avg other schools in the Pratham intervention areas.
but my out put comes 1  in integer .

please guide me.

My code is this:


public with sharing class ctrl_RI14_other_school_trends {

public List<SelectOption> lstNational {get;set;}
  public List<SelectOption> lstPhase {get;set;}
  //public List<SelectOption> lstDonor = new List<SelectOption>();
 
 
  public List<RI_School_Report_Cards__c> lstSchool = new List<RI_School_Report_Cards__c>();
  public List<Report> lstwrap1Sub {get;set;}
  public String strState {get;set;}
  public String strBlocks {get;set;}
  public String strNational {get;set;}
  public String strSchool {get;set;}
  public String strPhase {get;set;}
// public String strDonor {get;set;}
   
  public ctrl_RI14_other_school_trends()
{
    strState = '';
     strBlocks = '';
     strNational = '' ;
     strSchool = '';
     strPhase = '';
// strDonor = '';

    lstPhase = new List<SelectOption>();
    lstPhase.add(new SelectOption('', '- - None - -'));
    Schema.DescribeFieldResult F = RI_School_Report_Cards__c.BCI_CP_P_NO__c.getDescribe();
    for (Schema.PicklistEntry temp : F.getPicklistValues())
     {
      lstPhase.add(new SelectOption(temp.getValue(), temp.getLabel()));
}
    lstNational = new List<SelectOption>();
    lstNational.add(new SelectOption('', '- - None - -'));
    F = RI_School_List__c.National__c.getDescribe();
    for (Schema.PicklistEntry temp : F.getPicklistValues())
    {
      lstNational.add(new SelectOption(temp.getValue(), temp.getLabel()));
    }
   

      lstwrap1Sub = new List<Report>();
   
}

public List<SelectOption> getAttStates() {
    List<SelectOption>lstSchoolStates = new List<SelectOption>();
    AggregateResult []ar = [Select School_List__r.State__c State from RI_School_Report_Cards__c where Submission_No__c != null AND School_List__r.National__c =: strNational GROUP BY School_List__r.State__c];
    lstSchoolStates .add(new SelectOption('','-None-'));
    for(AggregateResult temp: ar) {
      lstSchoolStates.add(new SelectOption(String.valueOf(temp.get('State')),String.valueOf(temp.get('State'))));
    }
    return lstSchoolStates ;
  }
 
  public List<SelectOption> getAttBlocks() {
    List<SelectOption> lstSchoolBlocks = new List<SelectOption>();
    AggregateResult []ar = [Select School_List__r.block__c block from RI_School_Report_Cards__c where Submission_No__c != null AND School_List__r.state__c =: strState AND School_List__r.National__c =: strNational GROUP BY School_List__r.block__c ];
    lstSchoolBlocks.add(new SelectOption('','-None-'));
    for(AggregateResult temp: ar) {
      lstSchoolBlocks.add(new SelectOption(String.valueOf(temp.get('block')),String.valueOf(temp.get('block'))));
    }
    return lstSchoolBlocks;
  }

public List<SelectOption> getAttSchool() {
    List<SelectOption> lstSchools = new List<SelectOption>();
    List<RI_School_Report_Cards__c> lst = [Select School_List__r.Name, school_list__c, school_list__r.School__c from RI_School_Report_Cards__c where Submission_No__c != null AND Submit_Camp_4__c = true AND School_List__r.state__c =: strState AND School_List__r.National__c =: strNational AND school_list__r.block__c =: strBlocks];
    lstSchools.add(new SelectOption('','-None-'));
    for(RI_School_Report_Cards__c temp: lst) {
      lstSchools.add(new SelectOption(temp.school_list__c, temp.school_list__r.school__c + ' : ' + temp.school_list__r.Name));
    }
    return lstSchools;
  }

public pagereference loadReport()
{
    lstwrap1Sub.clear();
    String query = 'SELECT COUNT(School_List__r.Village__c) reached,SUM(MI_TL_Gov_SL__c) GOV_SL, SUM(MI_TL_Pvt_SL__c) PVT_SL, SUM(MI_TL_Other_SL__c) Other_SL';
 
     
      if (strState == '' || strState == null)
    {
      query += ', School_List__r.State__c grouper';     
    }
   
    else if(strBlocks == '' || strBlocks == null)
    {
      query += ', School_List__r.block__c grouper';
    }
    else
       {
     if(strSchool == '' || strSchool == null)
     {
     query += ', School_List__r.block__c grouper';
     }
     else
     {
     query += ', School_List__r.Name grouper';
     }
     }

query += ' FROM RI_School_Report_Cards__c WHERE School_List__r.National__c =: strNational AND Submission_No__c != null ';
   
  if (strState != '' && strState != null) {
       query += ' AND school_list__r.state__c =: strState';     
     }
   
  if(strBlocks != '' && strBlocks != null) {
      query += ' AND school_list__r.block__c =: strBlocks';
    }
   
   if(strSchool != '' && strSchool != null) {
    query += ' AND school_list__c =: strSchool';
    }

   if(strPhase != '' && strPhase != null) {
     query += ' AND BCI_CP_P_NO__c =: strPhase';
    }

    if (strState == '' || strState == null) {
      query += ' GROUP BY School_List__r.State__c';
      }
     else if (strBlocks == '' || strBlocks == null)
     {
      query += ' GROUP BY School_List__r.block__c';
         }
         else
       {
       if(strSchool == '' || strSchool == null)
       {query += ' GROUP BY School_List__r.block__c';}
       else
       {query += ' GROUP BY School_List__r.Name ';}
       
        }
      
 
     AggregateResult []ar = Database.query(query);
    Map <String, Integer> reach = new Map<String, Integer>();
    Map <String, Integer> GOV = new Map<String, Integer>();
    Map <String, Integer> PVT = new Map<String, Integer>();
     Map <String, Integer> Other = new Map<String, Integer>();
   
      for (AggregateResult temp : ar)
      {
      if(Integer.valueOf(temp.get('reached')) !=0)
      {
      reach.put(String.valueOf(temp.get('grouper')), Integer.valueOf(temp.get('reached')));
      }
      GOV.put(String.valueOf(temp.get('grouper')), Integer.valueOf(temp.get('GOV_SL')));
      PVT.put(String.valueOf(temp.get('grouper')), Integer.valueOf(temp.get('PVT_SL')));
      Other.put(String.valueOf(temp.get('grouper')), Integer.valueOf(temp.get('Other_SL')));
    }

  Integer i = 1;
    for(AggregateResult temp : ar)
     {
         lstwrap1Sub.add(new Report(i, String.valueOf(temp.get('grouper')), reach.get(String.valueOf(temp.get('grouper'))), GOV.get(String.valueOf(temp.get('grouper'))), PVT.get(String.valueOf(temp.get('grouper'))),Other.get(String.valueOf(temp.get('grouper'))),
      ((GOV.get(String.valueOf(temp.get('grouper')))+ PVT.get(String.valueOf(temp.get('grouper')))+ Other.get(String.valueOf(temp.get('grouper'))) )/reach.get(String.valueOf(temp.get('grouper'))))  ));
       i++;
    }

     List<Integer> total = new List<Integer>();
    total.add(0);
    total.add(0);
    total.add(0);
    total.add(0);
    total.add(0);
    if (strBlocks == '' || strBlocks == null) {
     for(Report temp : lstwrap1Sub)
     {
      total[0] += temp.reached;
      total[1] += temp.GOV_SL;
      total[2] += temp.PVT_SL;
      total[3] += temp.Other_SL;
      total[4] += temp.avg;
    
    }
   
       lstwrap1Sub.add(new Report(null, 'Total', total[0], total[1], total[2], total[3], total[4]));
       }
    return null;
}

class Report
{
public Integer reached {get;set;}
public String grouper {get;set;}
public Integer sr_no {get;set;}
public Integer GOV_SL{get;set;}
public Integer PVT_SL{get;set;}
public Integer Other_SL{get;set;}
public Integer avg {get;set;}   
    
public Report(Integer sr_no,String grouper,Integer reached,Integer GOVSL,Integer PVTSL,Integer other,Integer avg_gpo )
{
     
      this.grouper = grouper;
      this.sr_no = sr_no;
      this.reached = reached == null ? 0 : reached;
      this.GOV_SL = GOVSL == null ? 0 : GOVSL;
      this.PVT_SL = PVTSL== null ? 0 : PVTSL;
      this.Other_SL = other== null ? 0 : other;
      this.avg  = avg_gpo == null ? 0 :avg_gpo;

    
}
}
}
Hi friend,
I m using jquery for auomatically set check box is true .
In that i want page reloaded for saved in database so 
plz reply me as soon as possible.

Thank you .
Hi Group,

I have one requirement once i m  clicking on checkbox then  same Page automatically refreshed the Page or reload the Page or it will automatically saved on backend .

using jquey.
My Code Is :-
if (confirm("Does the School Have 1 Camp OR 2 Camps  !") == true)
               {
                   x = "Camp 2!";
                   alert("This School has 2 follow Up Camps :"+x);
                    $("[id$=submit3]").attr("checked", false);
                  var p= $("[id$=submit2yes]").attr("checked", true);
                   
                   
                   
                   }
             else
              {
                x ="Camp 1!";
                alert("This School has 1 Follow Up Camp :"+x);
               $("[id$=submit3]").attr("checked", true);
              
               }


Thanks you,
Rad.

I want to change button name which is presented in popupbox.
If ok and cancel button presented in popupbox then i wan to rename yes and no using jquery.

please guid me

Hi Friends...
I have 3 checkboxes.
name like:- submit1 ,submit2, and submit 3.
When i select  submit1 (mean submit1 is selected  ) and click on saved button .
then After saved button it will show Popup Box Msg :- your submit1 is checked  and Do you want to Proceeds submit2 ??
Condition :-IF YES, Then I want 2nd submission again It will show  Pupup Box Msg your Submit2 is checked.
If No, Then Submission 3 is Automattically Checked.
Again submit2 is checked and clicked in saved button ,It will show message your Submission done Successfully.


Please Help me for this topic.....
Hey Friend,

I wanted to assign different page layout to user and System Adminisrator after getting mail Process?
I m Creating three Email template for sending mail once creating it.Then After i m assigned workflow .
Eg.sumitted issues
1) Email-your issues that has been Submitted
2)Email-your issues handled by user.
3)Your issus that has been solved.
Now next what i can do for assign page layout once get submitted issues mail?similarly next
hey Friends .
                      I want to serch person name with its information in Visualforce page .can you suggest me How is it possible.
I m to export one particular Export Excel File from VF page
School report card is a parent
teacher is a child
please guide me for this error Field is not writeable: RI_VOL_THR_INFO__c.RI_School_Card__c
Controller: