how to export image to xls or doc file? is there a solution ?

Comments

kanani’s picture

http://drupal.org/node/1494450 will partially export images (although the aspect ratio is not always maintained)

kristofferrom’s picture

Issue summary: View changes

I've got a file field with images that displays fine in the export when set to 'renderes file' in the views field formatter.

achton’s picture

@kristofferrom: Can you elaborate, possibly include an export of your view? I cannot get this to work when setting to "Rendered file" in the field settings for my image field. What about the view mode? There must be more to it than this :)

kristofferrom’s picture

Sorry about the wait @Acton.

The view is set to show full content.

Here's an export, there's an exposed filter in there, dunno if that makes it difficult to read;

$view = new view();
$view->name = 'clippings_word';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Clippings word';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Reports';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
  3 => '3',
);
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['row_options']['view_mode'] = 'full';
$handler->display->display_options['row_options']['links'] = FALSE;
/* Field: Content: Rendered Content */
$handler->display->display_options['fields']['rendered_entity']['id'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['table'] = 'views_entity_node';
$handler->display->display_options['fields']['rendered_entity']['field'] = 'rendered_entity';
$handler->display->display_options['fields']['rendered_entity']['link_to_entity'] = 0;
$handler->display->display_options['fields']['rendered_entity']['display'] = 'view';
$handler->display->display_options['fields']['rendered_entity']['view_mode'] = 'full';
$handler->display->display_options['fields']['rendered_entity']['bypass_access'] = 0;
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'press_clipping' => 'press_clipping',
);
/* Filter criterion: Content: Project (field_project) */
$handler->display->display_options['filters']['field_project_target_id']['id'] = 'field_project_target_id';
$handler->display->display_options['filters']['field_project_target_id']['table'] = 'field_data_field_project';
$handler->display->display_options['filters']['field_project_target_id']['field'] = 'field_project_target_id';
$handler->display->display_options['filters']['field_project_target_id']['value'] = array(
  9 => '9',
  10 => '10',
  11 => '11',
  16 => '16',
  17 => '17',
  18 => '18',
  19 => '19',
  20 => '20',
  21 => '21',
  22 => '22',
  23 => '23',
  24 => '24',
  25 => '25',
  26 => '26',
  27 => '27',
  28 => '28',
  29 => '29',
  30 => '30',
  31 => '31',
  32 => '32',
  33 => '33',
  34 => '34',
  35 => '35',
  36 => '36',
  37 => '37',
  39 => '39',
  40 => '40',
  41 => '41',
  42 => '42',
  43 => '43',
  44 => '44',
  45 => '45',
  2700 => '2700',
  2701 => '2701',
  2749 => '2749',
  2770 => '2770',
  2781 => '2781',
  2782 => '2782',
  2783 => '2783',
  2784 => '2784',
  2785 => '2785',
  2786 => '2786',
  2787 => '2787',
  2788 => '2788',
  2789 => '2789',
  2790 => '2790',
  2791 => '2791',
  2792 => '2792',
  2793 => '2793',
  2794 => '2794',
  2795 => '2795',
  2796 => '2796',
  2797 => '2797',
  2798 => '2798',
  2799 => '2799',
  2800 => '2800',
  2801 => '2801',
  2802 => '2802',
  2803 => '2803',
  2804 => '2804',
  2805 => '2805',
  8362 => '8362',
  8429 => '8429',
  8444 => '8444',
  8497 => '8497',
  8525 => '8525',
  8638 => '8638',
);
$handler->display->display_options['filters']['field_project_target_id']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_project_target_id']['expose']['operator_id'] = 'field_project_target_id_op';
$handler->display->display_options['filters']['field_project_target_id']['expose']['label'] = 'Filter by project';
$handler->display->display_options['filters']['field_project_target_id']['expose']['operator'] = 'field_project_target_id_op';
$handler->display->display_options['filters']['field_project_target_id']['expose']['identifier'] = 'field_project_target_id';
$handler->display->display_options['filters']['field_project_target_id']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
);

/* Display: Reports */
$handler = $view->new_display('page', 'Reports', 'page');
$handler->display->display_options['path'] = 'reports';

/* Display: Data export */
$handler = $view->new_display('views_data_export', 'Data export', 'views_data_export_1');
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'views_data_export_doc';
$handler->display->display_options['style_options']['provide_file'] = 1;
$handler->display->display_options['style_options']['parent_sort'] = 0;
$handler->display->display_options['path'] = 'reports/export';
$handler->display->display_options['displays'] = array(
  'page' => 'page',
  'default' => 0,
);
b.anas’s picture

Anything new about exporting image into .xls file ?
my issue is that the exported images aren't fit to cells width and height.

Thanks

solideogloria’s picture

Assigned: shoufeng.xi » Unassigned
Category: Feature request » Support request
Priority: Critical » Normal
solideogloria’s picture

Version: 7.x-3.0-beta6 » 7.x-3.x-dev
solideogloria’s picture

Title: how to export image to xls or doc file » how to export image to xls or doc file