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

wps表格无法写入数据的解决方案 #7

Open
Ryzin opened this issue Nov 20, 2019 · 1 comment
Open

wps表格无法写入数据的解决方案 #7

Ryzin opened this issue Nov 20, 2019 · 1 comment

Comments

@Ryzin
Copy link

Ryzin commented Nov 20, 2019

  • 问题
    可能在wps 2013以上版本,会遇到无法向xls写入数据的问题。

  • 解决方案

//excelbase.cpp
void ExcelBasePrivate::construct() {
   ...
   if (excel->isNull()) {
        excel->setControl("ket.Application"); //连接WPS2013以上控件
   }
   ...
}

void ExcelBase::writeCurrentSheet(const QList<QList<QVariant> > &cells) {
   ...
   //将range->setProperty("Value", var); 替换为 range->dynamicCall("SetValue(const QVariant&)", var);
  //wps不支持setProperty方式写入,而office都支持
  //其它地方也要修改...
   ...
}


@Ryzin Ryzin changed the title wps表格无法写入数据的问题 wps表格无法写入数据的解决方案 Nov 20, 2019
@czyt1988
Copy link
Owner

这个是基于office的com组件的wps是否支持我也不清楚

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