В проекте Scala для создания Power Point и получил ошибку импорта. импорт org.apache.poi.ss.usermodel. Пробовал импорт сс работает - PullRequest
0 голосов
/ 10 октября 2019

Может ли Apache Poi поддерживать генерацию Power Point с использованием языка Scala.

Я пытался добавить версию 3.15-бета и 3.17, но ни одна из них не работает

Ничего из импорта org.apache.poi.xslf._ и импорта org.apache.poi.sl._ не может бытьрешена. Но работает одна форма импорта org.apache.poi.ss._, которая предназначена только для таблиц Excel. Мне нужна банка, чтобы создать точку силы.

файл sbt, как показано ниже:

libraryDependencies ++= Seq(
    "org.apache.poi" % "poi" % "4.0+",
    "org.apache.poi" % "poi-ooxml" % "4.0+",
    "org.apache.poi" % "poi-ooxml-schemas" % "4.0+",
    "org.apache.poi" % "ooxml-schemas" % "1.3",
    "org.apache.xmlbeans" % "xmlbeans" % "2.6.0",
    "org.apache.commons" % "commons-collections4" % "4.0"
)

код в проекте, как показано ниже:

import org.apache.poi.xslf.usermodel.XSLFPictureShape
import org.apache.poi.xslf.usermodel.XSLFShape
import org.apache.poi.xslf.usermodel.XSLFSlide
import org.apache.poi.xslf.usermodel.XSLFSlideLayout
import org.apache.poi.xslf.usermodel.XSLFSlideMaster
import org.apache.poi.xslf.usermodel.XSLFTable
import org.apache.poi.xslf.usermodel.XSLFTableCell
import org.apache.poi.xslf.usermodel.XSLFTableRow
import org.apache.poi.xslf.usermodel.XSLFTextParagraph
import org.apache.poi.xslf.usermodel.XSLFTextRun
import org.apache.poi.xslf.usermodel.XSLFTextShape



  object PPTProcessHelper {

    def getTemplateTblStyle(
      ntable:          XSLFTable,
      textColList:     ArrayList[Integer],
      emptyRowList:    List[Integer],
      templateCellMap: Map[Integer, TemplateCell],
      tblCol:          Int,
      tblRow:          Int): Double = {
      var tblCell: XSLFTableCell = null
      var hasText: Boolean = false
      var maxHeight: Double = 0d
      var templateCell: TemplateCell = new TemplateCell()
      var rowHeight: Double = 0d
      var tableRowCount: Int = 0
}
...