在scala项目中创建power point时出现导入错误。导入org.apache.poi.ss.usermodel。尝试导入ss作品

在scala项目中创建power point时出现导入错误。导入org.apache.poi.ss.usermodel。尝试导入ss作品,scala,apache-poi,powerpoint,Scala,Apache Poi,Powerpoint,ApachePOI能否支持使用scala语言生成电源点 我尝试添加了3.15-beta版和3.17版,但都不起作用 无法解析import org.apache.poi.xslf.u和import org.apache.poi.sl.u中的任何内容。但是只有一个表单import org.apache.poi.ss.uu可以工作,它只用于excel工作表。我需要jar来创建电源点 sbt文件如下所示: libraryDependencies ++= Seq( "org.apache.poi"

ApachePOI能否支持使用scala语言生成电源点

我尝试添加了3.15-beta版和3.17版,但都不起作用

无法解析import org.apache.poi.xslf.u和import org.apache.poi.sl.u中的任何内容。但是只有一个表单import org.apache.poi.ss.uu可以工作,它只用于excel工作表。我需要jar来创建电源点

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
}
项目中的代码如下所示:

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
}

请看和。如果您根据这些指导原则编辑您的问题,其他人可以更好地帮助您。1-确保您包含所有正确的JAR,请参阅。2-使用最新支持的版本@我编辑我的问题并发布代码。然而,这只是简单的导入jar问题。问题是我无法从import org.apache.poi.sl导入任何内容,并且无法从import org.apache.poi.xslf导入任何内容resolved@Gagravarr谢谢你的回复。我尝试了不同的版本3.17、4.0+和4.1+,它们都不起作用。我唯一没有更改的是scala版本是2.11.11,因为这是整个项目所必需的。请看我已经链接到的组件页面,您可能缺少一些Apache POI JAR或它们的依赖项