{"id":32932922,"url":"https://github.com/gordonbisnor/active_record_to_xls","last_synced_at":"2025-11-11T18:40:28.358Z","repository":{"id":62552879,"uuid":"137377018","full_name":"gordonbisnor/active_record_to_xls","owner":"gordonbisnor","description":"Export Rails ActiveRecord data to Excel XLS data","archived":false,"fork":false,"pushed_at":"2018-06-14T16:30:13.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-16T03:12:44.871Z","etag":null,"topics":["activerecord","excel","ruby","ruby-on-rails","xls"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gordonbisnor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-14T15:33:01.000Z","updated_at":"2018-06-14T16:30:14.000Z","dependencies_parsed_at":"2022-11-03T04:15:18.103Z","dependency_job_id":null,"html_url":"https://github.com/gordonbisnor/active_record_to_xls","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gordonbisnor/active_record_to_xls","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gordonbisnor%2Factive_record_to_xls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gordonbisnor%2Factive_record_to_xls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gordonbisnor%2Factive_record_to_xls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gordonbisnor%2Factive_record_to_xls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gordonbisnor","download_url":"https://codeload.github.com/gordonbisnor/active_record_to_xls/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gordonbisnor%2Factive_record_to_xls/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283910127,"owners_count":26915128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activerecord","excel","ruby","ruby-on-rails","xls"],"created_at":"2025-11-11T18:40:27.627Z","updated_at":"2025-11-11T18:40:28.349Z","avatar_url":"https://github.com/gordonbisnor.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActiveRecordToXls\n\nThis gem will generate XLS data for a collection of ActiveRecord models.\n\nIt was forked from the [to_xls-rails gem](https://github.com/liangwenke/to_xls-rails).\n\n## Installation\n\n**Gemfile**:\n\n```ruby\ngem 'active_record_to_xls'\n```\n\n**config/initializers/mime_types.rb**:\n\n```ruby\nMime::Type.register_alias \"text/excel\", :xls\n```\n\n## Usage\n\n**controller**: \n\n```ruby\nformat.xls {\n  filename = “my_export.xls”\n  send_data ActiveRecordToXls.call(Widget.all)\n}\n```\n\n**view:**  \n\n```ruby  \nlink_to 'Export Excel', my_action_path(format: :xls)\n```\n\n### Options  \n\n#### client_encoding\n\n- **Type:** String  \n- **Default**: UTF-8\n\n#### only \n\n- **Type:** Array\n\nWill only include the columns specified in this array:\n\n```ruby\nsend_data ActiveRecordToXls.call( Widget.all, only: [:title, :body] )\n```\n\n#### except \n\n- **Type:** Array\n\nWill omit the columns specified in this array, eg:\n\n```ruby\nsend_data ActiveRecordToXls.call( Widget.all, omit: [:id] )\n```\n\n#### prepend\n  \n- **Type:** Array of row arrays\n\nWill prepend above header:\n\n```ruby\nsend_data ActiveRecordToXls.call( Widget.all, prepend: [[\"Col 0, Row 0\", \"Col 1, Row 0\"], [\"Col 0, Row 1\"]] )\n```\n\n#### header\n\n- **Type:** true or false\n- **Default:** false\n\nWill omit the header row:\n\n```ruby\nsend_data ActiveRecordToXls.call( Widget.all, header: false )\n```\n\n#### header_columns\n\n- **Type**: Array\n\nSpecify header column names:\n\n```ruby\nsend_data ActiveRecordToXls.call( Widget.all, header: false , header_columns: ['Title', 'Description])\n```\n\n#### column_width\n\n- **Type:** Array of integers\n\nSet column widths:\n\n```ruby\nsend_data ActiveRecordToXls.call( Widget.all, column_width: [17,15,15,40,25,37] )\n```\n\n#### append\n\n- **Type:** Array of row arrays\n\nWill append this row at end, eg:\n\n```ruby\nsend_data ActiveRecordToXls.call( Widget.all, append: [[\"Col 0, Row 0\", \"Col 1, Row 0\"], [\"Col 0, Row 1\"]] )\n```\n\n  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgordonbisnor%2Factive_record_to_xls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgordonbisnor%2Factive_record_to_xls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgordonbisnor%2Factive_record_to_xls/lists"}