Hide columns in detail table only when exporting

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

Hide columns in detail table only when exporting

Post by philmills »

I need to hide some columns in my detail table when exporting (pdf and print).
Alternatively if there's a way to remove links in the detail table when exporting that would also be OK.
I tried using this in Page_Load of the Preview page and List page of the detail table:

    if (IsExport("pdf")){
        $this->myField->Exportable = false; 
    } 

but it doesn't seem to do anything...


mobhar
User
Posts: 11745

Post by mobhar »

Simply change Exportable to Visible, and try again.


philmills
User
Posts: 564

Post by philmills »

Tried that, it didn't work
I have this in List page

public function pageLoad()
    {
        //Log("Page Load");
    if (IsExport("pdf") || IsExport("print")){
        $this->fk_IncidentID->Visible = false;
        $this->Filename->Visible = false;    
    }		
    }

philmills
User
Posts: 564

Post by philmills »

Strange - I added this to Page_Load of the generated Grid page and the fields are now correctly hidden from print export, but they are still there in pdf export...


mobhar
User
Posts: 11745

Post by mobhar »

For Export to PDF, you should use isExport() method that belongs to the current page, instead of IsExport() global function.

So, your code should be:

public function pageLoad()
{
    //Log("Page Load");
    if ($this->isExport("pdf") || IsExport("print")){
        $this->fk_IncidentID->Visible = false;
        $this->Filename->Visible = false;    
    }		
}

Post Reply