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

WorksheetToImage Error #53

Open
shahkarraza001 opened this issue Jan 1, 2021 · 6 comments
Open

WorksheetToImage Error #53

shahkarraza001 opened this issue Jan 1, 2021 · 6 comments

Comments

@shahkarraza001
Copy link

shahkarraza001 commented Jan 1, 2021

While Converting the excel file to Image I get the error com.aspose.cells.CellsException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed. Below is my Code

                val workBook = Workbook(fileOptions.filePath)
                val imgOptions = ImageOrPrintOptions()
                imgOptions.imageType = ImageType.PNG
                imgOptions.allColumnsInOnePagePerSheet = true
                imgOptions.outputBlankPageWhenNothingToPrint = false
                val sheet: Worksheet =
                    workBook.worksheets.get(workBook.worksheets.activeSheetIndex)
                val sr = SheetRender(sheet, imgOptions)
                for (j in 0 until sr.pageCount) {
                    // Generate an image for the worksheet
                    val imageFilePath = getPngFileName(fileOptions.filePath!!, j)
                    sr.toImage(j, imageFilePath)
                    mOutputFilePaths.add(imageFilePath)

Below is the excel file attached

rase.zip

@amjad-sahi
Copy link
Collaborator

I tested using latest Aspose.Cells for Java v20.12.x to render sheet (in your provided file) to image file(s) and it works fine, I do not get any exception. It looks you are using Aspose.Cells for Python via Java API, is not it? Which version of the API you are using?

@shahkarraza001
Copy link
Author

shahkarraza001 commented Jan 1, 2021

I have implemented following version in gradle file
implementation ( group: 'com.aspose', name: 'aspose-cells', version: '20.9', classifier: 'android.via.java')
maven {
url "https://repository.aspose.com/repo/" }

@shahkarraza001
Copy link
Author

shahkarraza001 commented Jan 1, 2021

can you please tell me exact version to implement in gradle in Android Studio Project.

@amjad-sahi
Copy link
Collaborator

please try '20.12' and let us know your feedback.

@shahkarraza001
Copy link
Author

shahkarraza001 commented Jan 5, 2021

After updating the library to 20.12 I have tested the Application on many devices. Below is the list of devices with same problem.

  • Device: Samsung j6: Andriod Version: 9
  • Device: Huawei Mate 10 lite Andriod Version: 8.1
  • Device: Oppo a37 Andriod Version:5
  • Device: Oppo A3s Andriod Version: 8.1
  • Device: Infinix Note 7 Andriod Version:10
  • Device: Real me c2 Andriod Version:9
  • Device: Samsung A10 Andriod Version:9
  • Device: Samsung J7 Andriod Version :8.1

I have tested on almost 10 devices and only 2 had success. Other 8 gave the same Error Invalid Region.Op - only INTERSECT and DIFFERENCES are allowed
error

@amjad-sahi
Copy link
Collaborator

We will evaluate the issue soon. But, could you also provide details about those two devices where it works fine? Moreover, tell us if the exception occurred only for a specific Excel file (please attach the file in a zipped archive) or for all the files?

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