Support » Plugin: Gravity Forms Entries in Excel » Add a row in excel export at the top with the form name in it

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hi @shrutisolanki,

    This is possible by hooking into the getrows and prepending that value.

    I’ll try to give some code later today.

    • This reply was modified 1 month, 3 weeks ago by Doeke Norg. Reason: Typo

    Hey @doekenorg

    That would be a great help.
    Thanks alot

    Hey @doekenorg

    I tried hooking the code in the getrows but it adds the row below the labels and the text is also not appropriate.
    I need the row to be above the labels like title formate of the form

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi @shrutisolanki,

    Ah just saw your message. You are correct. I thought it had all the rows, but it only has the data rows. But I did manage to add the title in the first row, but also the first column.

    As of this moment the plugin has no way of actually merging columns. So I’ve just added this as a feature for the future. Maybe this helps you out for now. Otherwise you’ll have to wait a bit unfortunately.

    add_filter('gfexcel_renderer_matrix', static function (array $rows) {
        // Retrieve the form from one of the field.
        $row = reset($rows); // get the first row
        $field = reset($row); // get the first field
        $gf_field = $field->getField(); // get the form id of that field
        $form = GFAPI::get_form($gf_field['formId']);
    
        // Make up the title
        $title = new GFExcel\Values\StringValue($form['title'], $gf_field);
        $title->setBold(true);
    
        // Wrap in array to become a row.
        $title = [$title];
        array_unshift($rows, $title);
    
        return $rows;
    });

    Please let me know if this helps you out for now. Sorry I can’t do anything more for now.

    Hey @doekenorg

    This works, for now.
    Thanks for the feedback.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.