Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added function SetSheetCol to replicate SetSheetRow behavior for columns #1320

Merged
merged 3 commits into from
Aug 25, 2022

Conversation

cdenicola
Copy link
Contributor

PR Details

Added the function SetSheetCol to replicate SetSheetRow behavior for columns.

Description

Added function SetSheetCol to make it easy

Related Issue

N/A

Motivation and Context

Currently, there is an easy function SetSheetRow to set a list of values in a row. But there was no easy function to set a list of values in a column. This means users who want to set a list of columns have to do it manually or write their own helper function.

How Has This Been Tested

Added test cases that mirror SetSheetRow.

Tested manually with Go script and got desired output

package main

import (
	"github.com/xuri/excelize/v2"
)

func main() {
	f := excelize.NewFile()
	defer f.SaveAs("testSetSheetCol.xlsx")
	f.NewSheet("Results")
	f.SetSheetCol("Results", "A1", &[]interface{}{"A", "B", "C", "D"})
	return 
}

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@xuri xuri added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 17, 2022
@xuri
Copy link
Member

xuri commented Aug 23, 2022

Thanks for your contribution, I made some changes based on your branch.

@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2022

Codecov Report

Merging #1320 (fca4360) into master (551fb8a) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1320      +/-   ##
==========================================
- Coverage   98.47%   98.43%   -0.04%     
==========================================
  Files          31       31              
  Lines       23482    23315     -167     
==========================================
- Hits        23124    22951     -173     
- Misses        239      242       +3     
- Partials      119      122       +3     
Flag Coverage Δ
unittests 98.43% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cell.go 97.57% <100.00%> (+0.02%) ⬆️
crypt.go 87.00% <0.00%> (-3.65%) ⬇️
rows.go 97.39% <0.00%> (ø)
errors.go 100.00% <0.00%> (ø)
comment.go 100.00% <0.00%> (ø)
drawing.go 99.65% <0.00%> (ø)
picture.go 98.36% <0.00%> (ø)
docProps.go 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@xuri xuri linked an issue Aug 24, 2022 that may be closed by this pull request
@xuri xuri merged commit 0e9378f into qax-os:master Aug 25, 2022
rodoard pushed a commit to sheetrocks/excelize that referenced this pull request Aug 26, 2022
…heet column values (qax-os#1320)

Signed-off-by: cdenicola <[email protected]>
Co-authored-by: cdenicola <[email protected]>
@xuri xuri linked an issue Aug 29, 2022 that may be closed by this pull request
xuri pushed a commit to carbin-gun/excelize that referenced this pull request Oct 9, 2022
…heet column values (qax-os#1320)

Signed-off-by: cdenicola <[email protected]>
Co-authored-by: cdenicola <[email protected]>
xuri pushed a commit to JDavidVR/excelize that referenced this pull request Jul 11, 2023
…heet column values (qax-os#1320)

Signed-off-by: cdenicola <[email protected]>
Co-authored-by: cdenicola <[email protected]>
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this pull request Oct 22, 2023
…heet column values (qax-os#1320)

Signed-off-by: cdenicola <[email protected]>
Co-authored-by: cdenicola <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SetSheetCol feature Set cell value by column
3 participants