Exclude record from export to Excel (v2018)

Hi,In a table I have the following code in Table specific → Common → Row_rendered event in order to exclude certain rows from being shown:

	 if ($this->pf_medlemsnummer->CurrentValue == null) {
	     $this->RowAttrs["style"] = "display:none";
	 }

But when exporting to Excel the rows are still being exported.
I have placed this code in List page → Row_Export event:

	    if ($this->pf_medlemsnummer->ViewValue == null) {
	        $this->RowAttrs["style"] = "display:none";
	    }

What am I doing wrong?
PhpMaker 2018Cheers
/Poul

Make sure you have already returned FALSE in “Page_Exporting” server event in order to run your code in that “Row_Export” server event.Please read “Server Events and Client Scripts” topic from PHPMaker Help menu for more info and example.

Thanks.
I do have FALSE set in “Page_Exporting” but the use of any if/then clause in “Row_Export” gives this error:
Parse error: syntax error, unexpected ‘if’ (T_IF)


	    $brugernavn=$this->pf_brugernavn->ViewValue;
	    $pos1 = strpos($brugernavn, '-');
	    $ExportThisRow=1
	    if ($pos1 === false) {        // Error on this line
	        $ExportThisRow=0
	    }
		    if $ExportThisRow=1 {
  		         $this->ExportDoc->Text .= "my content: " . $this->pf_medlemsnummer->ViewValue ;
		    }

Secondly what am I supposed to build for export.
Ideally I would like to use something like this, since I would like to export the whole row if it meets the criteria above:

		    if $ExportThisRow=1 {
                   	  		         $this->ExportDoc->Text .= $rs ;
		    }

tia/Poul

Double check your code. This part:
$ExportThisRow=1should be:
$ExportThisRow=1;This part also:
$ExportThisRow=0should be:
$ExportThisRow=0;This part:
if $ExportThisRow=1 {should be:
if ($ExportThisRow==1) {

Thanks.
So basic :-(But revised code below now giver this error:
Parse error: syntax error, unexpected ‘$ExportThisRow’ (T_VARIABLE), expecting

	$brugernavn=$this->pf_brugernavn->ViewValue;
	$pos1 = strpos($brugernavn, '-');
	$ExportThisRow=1;
	if ($pos1 === false) { // Error on this line
		$ExportThisRow=0;
	}
	if ($this->pf_udmeldt->ViewValue <> null) {
		    $ExportThisRow=0;
	}
	if $ExportThisRow==1 {       <<<<< Error here
		$this->ExportDoc->Text .= "my content: " . $this->pf_medlemsnummer->ViewValue ;
	}

/Poul

mobhar wrote:
should be:
if ($ExportThisRow==1) {

Hi,Thanks. Error is gone now but I get nothing in the Excel file.
Removing all if/then logic and having this code only, also produces a blank Excel file:$this->ExportDoc->Text .= "my content: " . $this->pf_medlemsnummer->ViewValue ;??Cheers
/Poul

Nobody has any idea how to get anything to show in the Excel file using Row_export event ?tia
/Poul