Page 1 of 1

csv generation options

Posted: Tue Sep 11, 2018 6:04 pm
by danielebrambilla

1) the possibility of removing the header
2) the possibility of changing the character of separation between fields


Re: csv generation options

Posted: Mon Sep 17, 2018 9:38 am
by Webmaster

Use Page_Importing server event, see Server Events and Client Scripts in help file.


Re: csv generation options

Posted: Thu Oct 11, 2018 5:03 pm
by danielebrambilla

Thank you
I used Page Exporting event for 1 and Row Export event for 2
Examples:
1)
// Page Exporting event
// $this->ExportDoc = export document object
function Page_Exporting() {
//$this->ExportDoc->Text = "my header";
// Export header
//return FALSE; // Return FALSE to skip default export and use Row_Export event
return FALSE; // Return TRUE to use default export and skip Row_Export event
}

2)
// Row Export event
// $this->ExportDoc = export document object
function Row_Export($rs) {
$this->ExportDoc->Text .= $this->id1->ViewValue . "," . $this->parola->ViewValue . "," . $this->traduzione->ViewValue . "\r\n"; // Build HTML with field value: $rs["MyField"] or $this->MyField->ViewValue

}

now the csv is exported in this way:
1,disk ,disco
2,happy,felice
3,true,vero
4,false,falso
5,big,grande
6,small,piccolo
7,mouse,topo
8,dog,cane
9,cat,gatto
10,phone,telefono
11,new,nuovo