Does anyone knows how to save a pre-set layout

Resolved

I’ve been successful in the installation of this tool I’m my website, but i want to be able to save the layout for future use on order to avoid having to configure every time i open the report

4 answers

Ben Gorde November 12, 2018

I think the following tutorial nails this case: https://www.webdatarocks.com/doc/saving-and-opening-reports/ 

Actually i think that your suggestion isn’t what i was looking for…
 
I want updated data with saved layout.
 
This was the way i figured out:
 
 

<script>
 
var dados_chart = [ <?php echo $my_chart;?> ];
var pivot = new WebDataRocks({
 
container: "#wdr-component",
toolbar: true,
height: "900",
report: {
 
  
dataSource: {
data: dados_chart
},
 
//PARA PRE_SET DA TABELA
slice: {
       "rows": [
           {
               "uniqueName": "Local"
           },
           {
               "uniqueName": "Fracção"
           },
           {
               "uniqueName": "Inquilino"
           }
       ],
       "columns": [
           {
               "uniqueName": "Mes.Year"
           },
           {
               "uniqueName": "Mes.Month"
           },
           {
               "uniqueName": "Measures"
           }
       ],
       "measures": [
           {
               "uniqueName": "Renda",
               "aggregation": "sum"
           }
       ],
       
                },
}
});
</script>

 

Actually i think that your suggestion isn’t what i was looking for…
 
I want updated data with saved layout.
 
This was the way i figured out:
 
 

Start your code here

<script>
 
var dados_chart = [ <?php echo $my_chart;?> ];
var pivot = new WebDataRocks({
 
container: “#wdr-component”,
toolbar: true,
height: “900”,
report: {
 
  
dataSource: {
data: dados_chart
},
 
//PARA PRE_SET DA TABELA
slice: {
       “rows”: [
           {
               “uniqueName”: “Local”
           },
           {
               “uniqueName”: “Fracção”
           },
           {
               “uniqueName”: “Inquilino”
           }
       ],
       “columns”: [
           {
               “uniqueName”: “Mes.Year”
           },
           {
               “uniqueName”: “Mes.Month”
           },
           {
               “uniqueName”: “Measures”
           }
       ],
       “measures”: [
           {
               “uniqueName”: “Renda”,
               “aggregation”: “sum”
           }
       ],
       
                },
}
});
</script>

Ben Gorde November 12, 2018

Oh, I see
updateData call might be useful to update only the data: https://www.webdatarocks.com/doc/updatedata/