Export filename field as value not as link

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
adim
User
Posts: 12

Export filename field as value not as link

Post by adim »

(PHPMaker v2018) When i'm trying to export in excel, word, html or email the filename field will export as a link. Please anybody can guide me how to proceed to export a filename field as value not as link. In previous versions we can modify values of exported fields from Row_Rendered() event, but now is not working anymore.

for example i have tried following code in Row_Rendered()

if ($this->Export <> "") {

$this->myFilenameField->ViewValue = $this->myFilenameField->CurrentValue

OR i have tried this:

$this->myFilenameField->ViewValue = $this->myFilenameField->Upload->DbValue

}

But the filename field will be exported as a html Link not as a name of file.


kirondedshem
User
Posts: 642

Post by kirondedshem »

I can also confirm this, my fields with edit tage as upload and view tage as image are all doint this, when I look at teh generated php code I see for example on the list page they rrender somethi g like ListViewValue and only way I found to override it was to set DbValue to null, but it still wont accept my custom ViewValue or CurrentValue.

You can try these quick fixes as you wait for possible solution (you might want to submit this to support as well coz it looks serious)

create another custom field whose sql expression = "filedWithFileName" (leave its view tag to text), so you can disable the original field and enable export for this instead which gives pure filename and nothing else


arbei
User
Posts: 9292

Post by arbei »

Try below code in Row_Rendered Server Event and try again.

	if ($this->Export<>""){
		$this->ImageToFolder->FldViewTag = "TEXT";  // change the view tag to text
		$this->ImageToFolder->HrefValue2 = "";  // remove the link.
	}

adim
User
Posts: 12

Post by adim »

@arbei, thank you so much. That was intended behavior. Your code works like a charm. God bless you! You saved my day.


Post Reply