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

Problem with Is and = only when convert solution #71

Closed
Whismeril opened this issue Feb 16, 2021 · 2 comments
Closed

Problem with Is and = only when convert solution #71

Whismeril opened this issue Feb 16, 2021 · 2 comments

Comments

@Whismeril
Copy link

Whismeril commented Feb 16, 2021

With the same project than issue #70

In file ExcelOpenXml.cs, at SupprimerFeuille method

        public void SupprimerFeuille(string Nom)
        {

            //suppression des pivots
            Dictionary<PivotTableCacheDefinitionPart, string> tablePivots = new Dictionary<PivotTableCacheDefinitionPart, string>();

            foreach(PivotTableCacheDefinitionPart pivot in document.WorkbookPart.PivotTableCacheDefinitionParts)
            {
                if (pivot.PivotCacheDefinition.Descendants<CacheSource>().Where(s => s.WorksheetSource.Sheet == Nom).Count() > 0) //Sheet is a property, conversion of == must be =
                    tablePivots.Add(pivot,pivot.ToString());
            }

Conversion returns

        Public Sub SupprimerFeuille(Nom As String)

            'suppression des pivots
            Dim tablePivots As New Dictionary(Of PivotTableCacheDefinitionPart, String)

            For Each pivot As PivotTableCacheDefinitionPart In document.WorkbookPart.PivotTableCacheDefinitionParts
                If pivot.PivotCacheDefinition.Descendants(Of CacheSource)().Where(Function(s) s.WorksheetSource.Sheet Is Nom).Count() > 0 Then '== has been converted by is
                    tablePivots.Add(pivot, pivot.ToString())
                End If
            Next

But if I paste the code in the richtextbox SourceCode and convert the snippet, conversion is correct.

@paul1956
Copy link
Owner

Fixed

@Whismeril
Copy link
Author

thanks

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

No branches or pull requests

2 participants