Export Date Type to openoffice/libreoffice Delphi

Asked

Viewed 259 times

2

How can I export a Date type to openoffice/libreoffice when I need to export a String type.

 SheetOpenOffice.GetCellByPosition(vCont,vlinha).SetString(Q_Assoc.Fields[i].AsString);

How can I do when the type that comes in the query is a Date type?

1 answer

2


Try to do it this way:

if ((DateToStr(Q_Assoc.Fields[i].Value) <> Null) and (DateToStr(Q_Assoc.Fields[i].Value) <> '')) then
    SheetOpenOffice.GetCellByPosition(vCont,vlinha).SetString(Q_Assoc.Fields[i].Value);
  • Gave this error: Interfaceolewrapper_impl::Invoke : [Automation bridge]Unoconversionutilities<T>::variantToAny Cannot Convert the value of vartype :"8" to the expected UNO type of type class: 11

  • 1

    @Rodrigo.oliveira, I edited the answer instead of Setvalue put Setstring

  • @Rodrigo.oliveira, it worked?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.