yes u r absolutely right
this is my debug values
=====SplitList======(WasteSplitt:[WasteName=General, wastetype=80], WasteSplitt:
[WasteName=Dry Mixed Recycling, wastetype=45],
WasteSplitt:[WasteName=Cardboard Stickers, wastetype=7],
WasteSplitt:[WasteName=Sanitary, wastetype=1],
WasteSplitt:[WasteName=Glass, wastetype=2],
WasteSplitt:*[WasteName=No Waste, wastetype=1])*
and it is showing me last value of no waste=1
This is my page on which i am redirecting
public with sharing class googleChartsCSV2Controller {
public String strValues { get; set; }
public String strHeaders { get; set; }
public googleChartsCSV2Controller()
{
String wasName =
ApexPages.currentPage().getParameters().get('name');
String wasType =
ApexPages.currentPage().getParameters().get('type');
strHeaders = 'Waste Name, Waste Type';
strValues = wasName + ',' + wasType;
}
}
can u help me in this
Copyright © 2000-2012 salesforce.com, inc. All rights reserved. | Privacy
Statement <http://www.salesforce.com/company/privacy.jsp> | Security
Statement <http://www.salesforce.com/company/security.jsp> | Terms of
Use<http://www.salesforce.com/company/msa.jsp>
| 508
Compliance<https://cs13.salesforce.com/help/doc/user_ed.jsp?loc=help&target=accessibility_overview.htm§ion=accessibility>
On Monday, September 24, 2012 11:56:26 AM UTC+5:30, asgallant wrote:
>
> I don't know what your server-side code does to handle this on the back
> end, but I suspect that the problem is that you are only passing one name
> (whichever is the last in the result array) to the server-side CSV script.
>
> On Monday, September 24, 2012 12:38:01 AM UTC-4, nishh wrote:
>>
>> i have created an export to csv file in google charts but the problem is
>> it is showing me 1 value instead of all the value which are coming in
>> arraylist.
>>
>> <apex:page controller="WasteSplit" sidebar="false">
>> <!-- Google API inclusion -->
>> <apex:includeScript id="a" value="https://www.google.com/jsapi" />
>> <apex:sectionHeader title="Google Charts" subtitle="Chart 2"/>
>>
>> <apex:form >
>> <table align="center">
>> <td><b>Date From:</b>
>> <input id="t" name="datee"
>> onfocus="DatePicker.pickDate(false,'t', false);"
>> size="12" tabindex="28" type="date" />
>> </td><td></td>
>> <td></td>
>> <td></td>
>> <td></td>
>> <td><b>Date To:</b>
>> <apex:outputText value="{0,date,dd/MM/yyyy}">
>> <apex:param value="{!NOW()}" />
>> </apex:outputText></td>
>> <td><input type="button" onclick="initCharts()"
>> value="Go"></input></td>
>> *<td><input id="exportCSV" type="button" onclick="
>> window.open('/apex/CSVWasteSplit?name=' + Name + '&type=' + Type);"
>> value="Export to CSV" style="display: none;"></input></td>*
>> </table>
>> </apex:form>
>> <div id="chartBlock" style="width: 600px; height: 500px;"/>
>>
>> <script type="text/javascript">
>> // Load the Visualization API and the piechart package.
>> google.load('visualization', '1', {'packages':['corechart']});
>> // Set a callback to run when the Google Visualization API is
>> loaded.
>> google.setOnLoadCallback(initCharts);
>>
>>
>> function initCharts() {
>> var dateFrom= $('#t').val();
>> document.getElementById('chartBlock').innerHTML = '';
>> document.getElementById('exportCSV').style.display = 'none';
>> Name = '';
>> Type = '';
>> if(dateFrom != null && dateFrom != '')
>> {
>> WasteSplit.WasteSource(
>> dateFrom,function(result, event){
>> // load Column chart
>> if (event.status && event.result)
>> {
>> var visualization = new
>> google.visualization.PieChart(document.getElementById('chartBlock'));
>> // Prepare table model for chart with columns
>> var data = new google.visualization.DataTable();
>> data.addColumn('string', 'Waste Name');
>> data.addColumn('number', 'Waste Type');
>>
>> // add rows from the remoting results
>> for(var i=0; i<result.length;i++){
>> * var finalBean= result[i];*
>>
>> data.addRow([finalBean.WasteName,finalBean.wastetype]);
>> }
>> *//here m passing the the value of array list for exporting it to csv*
>> *if(finalBean.WasteName != null &&
>> finalBean.wastetype != null)*
>> * {*
>> * Name = finalBean.WasteName;*
>> * Type = finalBean.wastetype;*
>> *
>> document.getElementById('exportCSV').style.display = 'block'; *
>> * }*
>>
>> } else {
>> alert(event.message);
>> }
>>
>> visualization.draw(data,{title:'Waste Service
>> Split at Source',legend : {position: 'bottom', textStyle: {color: 'blue',
>> fontSize: 10}}, width:window.innerWidth,vAxis:{textStyle:{color:'red',
>> fontSize: 15}},hAxis:{title: 'Record Count',textStyle:{fontSize:
>> 10},showTextEvery:1,slantedText:true}} );
>> }, {escape:true});
>> }
>> }
>> </script>
>> </apex:page>
>>
>>
>>
>> the values are
>>
>>
>> *waste name* *waste Type*
>>
>> General 35
>>
>> Dry Mixed 20
>>
>> No waste 1
>>
>> cardboard 56
>>
>>
>>
>> must be like this when exporting
>>
>>
>>
>> but it is showing only 1 value
>>
>> *Waste Name Waste Type*
>>
>> No Waste 1
>>
>>
>>
>> can anyone help me in that
>>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/EKImfq9qBS8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.