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

Export Excel fixes for issues #92, #52, #41, #33. #101

Closed
wants to merge 1 commit into from
Closed

Export Excel fixes for issues #92, #52, #41, #33. #101

wants to merge 1 commit into from

Conversation

W1M0R
Copy link

@W1M0R W1M0R commented May 1, 2016

These changes fix issues #92, #52, #41, #33.

Export-Excel.Impl.ps1: Implementation details for the new Export-Excel contributions.
Export-Excel.Impl.Tests.ps1: Tests for the implementation details.
Export-Excel.ps1: Export-Excel is now a Cmdlet (supports -Verbose parameter). Added -DateTimeFormat and -ColumnOptions parameters. Extracted value and format code into New-CellData function.
Export-Excel.Tests.ps1: Updated module import.
Issues.Tests.ps1: Contains a test for every issue fixed.

These changes fix issues #92, #52, #41, #33.

Export-Excel.Impl.ps1: Implementation details for the new Export-Excel contributions.
Export-Excel.Impl.Tests.ps1: Tests for the implementation details.
Export-Excel.ps1: Export-Excel is now a Cmdlet (supports -Verbose parameter). Added -DateTimeFormat and -ColumnOptions parameters. Extracted value and format code into New-CellData function.
Export-Excel.Tests.ps1: Updated module import.
Issues.Tests.ps1: Contains a test for every issue fixed.
@W1M0R W1M0R changed the title Export Excel fixes for issues #92, #52, #41, #33. (#5) Export Excel fixes for issues #92, #52, #41, #33. May 1, 2016
@dfinke
Copy link
Owner

dfinke commented May 1, 2016

Wow!

I'd prefer not to have Impl in the file name. ExcelHelpers.ps1 might work.

Any chance you could add ps1 files in the Examples folder showing this off?
Then we could point to those in the README.md. Also, The standalone ps1 example files can be used in short gif videos.

Thanks again

@W1M0R
Copy link
Author

W1M0R commented May 3, 2016

No problem, as soon as I get a chance, I'll do that. I don't know how to make the gif videos. What app do you use?

@dfinke
Copy link
Owner

dfinke commented May 3, 2016

No rush. If you want to do the animations that'd be cool, was just mentioning it so I'd remember to do it.

I use gifcam

@W1M0R
Copy link
Author

W1M0R commented May 4, 2016

I have detected a few conversion issues when using my own excel datasets, so I'll continue to work on this functionality in my number_formats branch. My 'experimental' branch is a merge of everything I need in ImportExcel. I'll let you know when I feel more confident about the changes. But at least this gives you an opportunity to inspect the code and offer suggestions. Thanks dfinke!

@Cirzen
Copy link

Cirzen commented May 20, 2016

Some very good stuff in here, great job Willie. Looking forward to seeing some of this merged.
Glad I could help with one of the tests!
David

@dfinke
Copy link
Owner

dfinke commented May 20, 2016

OK. I think I misread @W1M0R last comment. So this PR can be merged? And he is doing more checking on code in his branch?

@W1M0R
Copy link
Author

W1M0R commented May 20, 2016

Thanks @Cirzen

@dfinke It is not ready to merge yet. Some of my test cases are failing. Should I close it for now?

@dfinke
Copy link
Owner

dfinke commented May 20, 2016

Let's leave it open. No need to set it up again later.

@cpolydorou
Copy link

Hello,

Has this been merged?

@dfinke
Copy link
Owner

dfinke commented Jan 17, 2017

No. The person working it through didn't pick it break up. What were you looking for?

@Cirzen
Copy link

Cirzen commented Jan 17, 2017

Hi doug, also chiming in here, the leading zero issue was my primary concern. Was that fixed in the main stream?

@dfinke
Copy link
Owner

dfinke commented Jan 17, 2017 via email

@cpolydorou
Copy link

Hi Doug,

My issue is that long numbers are imported with scientific format. (#92).

@DarkLite1
Copy link
Contributor

This is actually already done with my previous pull request that is already accepted and merged. This one could be closed as duplicate and implemented.

@cpolydorou
Copy link

Hi DarkLite1,

Could you please describe in short how to import numbers without getting the scientific format?

Chris

@DarkLite1
Copy link
Contributor

DarkLite1 commented Aug 8, 2017

I think you misunderstood something. This pull request is about Export-Excel and you are looking for an extra feature in Import-Excel if I'm not mistaken?

@dfinke , we could use the same function used in Export-Excel, I think I called it Add-CellValue, in Import-Excel to accommodate the user's needs?

@cpolydorou
Copy link

Yes, you are correct. However, it would be very helpful if you could describe the way to export just in case.

@DarkLite1
Copy link
Contributor

DarkLite1 commented Aug 16, 2017

You can find the way to export the numbers when doing Get-Help Export-Excel -Examples.
@dfinke , this PR can be closed.

@dfinke
Copy link
Owner

dfinke commented Aug 16, 2017

-------------------------- EXAMPLE 3 --------------------------

$ExcelParams = @{

Path    = $env:TEMP + '\Excel.xlsx'
    Show    = $true
    Verbose = $true
}
Remove-Item -Path $ExcelParams.Path -Force -EA Ignore
[PSCustOmobject][Ordered]@{
    Date      = Get-Date
    Formula1  = '=SUM(F2:G2)'
    String1   = 'My String'
    String2   = 'a'
    IPAddress = '10.10.25.5'
    Number1   = '07670'
    Number2   = '0,26'
    Number3   = '1.555,83'
    Number4   = '1.2'
    Number5   = '-31'
    PhoneNr1  = '+32 44'
    PhoneNr2  = '+32 4 4444 444'
    PhoneNr3  =  '+3244444444'
} | Export-Excel @ExcelParams -NoNumberConversion IPAddress, Number1

Exports all data to the Excel file 'Excel.xslx' and tries to convert all values to numbers where possible except
for 'IPAddress' and 'Number1'. These are stored in the sheet 'as is', without being converted to a number.

@cpolydorou
Copy link

Thanks!

@DarkLite1
Copy link
Contributor

@dfinke I think this can be closed now.

@dfinke dfinke closed this Sep 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants