Question on open .xls file by Calligra API

tien dh tiendh11986 at gmail.com
Tue Mar 8 11:21:08 GMT 2011


Hi everyone,
I'm developing my own program that allows to open xls files. However, one
thing appears that seems to be impossibe overcome.
*Following are functions I used:*

      m_document =
KParts::ComponentFactory::createPartInstanceFromQuery<KoDocument>(
               mimetype, QString(),
               0, 0, QStringList(),
               &errorCode);

     m_document->openUrl(url)
*
*    spreadView =
qobject_cast<Calligra::Tables::View*>m_document.createView();

*And after opening this file, I convert to tables:*

    KSpread::Doc *spreadDoc = qobject_cast<KSpread::Doc*> (document());
//Function document() return m_document above.
       if (!spreadDoc)
           return NULL;
       KSpread::Sheet *sheet = spreadDoc->map()->sheet(pageIndex);
       if (!sheet)
           return NULL;

       QSize sheetSize = getContentSize(pageIndex);
       //set active current sheet
       spreadView->setActiveSheet(sheet);
       spreadView->setFixedSize(sheetSize);
       spreadView->canvasController()->setDocumentSize(sheetSize);
       controller()->setFixedSize(sheetSize);

*When I call show() function, a widget appears, however, only scroolbars
showed, but no sheets can be seen*.* Sheet area has white color. How can I
solve this?*

-- 
Do Huu Tien
Handphone No: 0972471786
Email: tiendh11986 at gmail.com
Y!M: dohuu_tien86
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110308/7d6075d5/attachment.htm>


More information about the calligra-devel mailing list