Download it now!
Bug 31999 - "Expression is faulty" in texttables exported to PDF by API/Delphi code
Summary: "Expression is faulty" in texttables exported to PDF by API/Delphi code
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Cédric Bosdonnat
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-30 05:27 UTC by Gustavo Pacheco
Modified: 2011-03-07 06:30 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Original ODT file with textable formulas (38.92 KB, application/vnd.oasis.opendocument.text)
2010-11-30 06:29 UTC, Gustavo Pacheco
Details
Result: PDF file with "Expression is faulty" in texttables (210.81 KB, application/x-real)
2010-11-30 06:30 UTC, Gustavo Pacheco
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Pacheco 2010-11-30 05:27:29 UTC
I have a Delphi code to export text documents to PDF. The text documents contains texttables with formulas like =SUM(<A1:A4>):

1) open a text document with hidden property = true;
            
  fileProp:= CreateProperties(['Hidden', True]);
  myDoc:= StarDesktop.LoadComponentFromURL(myFile, '_blank', 0, fileProp);

2) export the document to PDF:

  fileProp2:= CreateProperties(['FilterName', 'writer_pdf_Export']);
  myFile2:= convertToURL('c:\teste10.pdf');
  myDoc.storeToURL(myfile2, fileProp2);

In PDF file, the texttable formulas hasn't been calculated and the texttable cells show "Expression is faulty".

This code uses Delphi OOo Library:
http://www.ooomacros.org/dev.php#133853

I suppose that issue is reproducible in Java, Visual Basic and others.

Thanks!
Comment 1 Gustavo Pacheco 2010-11-30 06:29:06 UTC
Created attachment 40671 [details]
Original ODT file with textable formulas
Comment 2 Gustavo Pacheco 2010-11-30 06:30:06 UTC
Created attachment 40672 [details]
Result: PDF file with "Expression is faulty" in texttables
Comment 3 Gustavo Pacheco 2010-11-30 06:32:59 UTC
I sent an example of an original ODT file with texttable formulas and the final PDF with the "Expression is faulty" in texttables.

Additionally, I found a related issue in OOo Issuezilla: 

'There is currently no api to force a recalculation of a texttable'
http://www.openoffice.org/issues/show_bug.cgi?id=52787
Comment 4 Cédric Bosdonnat 2011-02-22 07:33:12 UTC
I'm wondering if this isn't the same than
https://bugzilla.novell.com/show_bug.cgi?id=664516
Comment 5 Cédric Bosdonnat 2011-02-25 05:13:28 UTC
Could you try with 3.3.1 as the bug I'm thinking about is fixed in it?
Comment 6 Cédric Bosdonnat 2011-03-03 01:12:45 UTC

*** This bug has been marked as a duplicate of bug 34466 ***
Comment 7 Gustavo Pacheco 2011-03-03 12:49:06 UTC
Thanks in advance, Cédric!

I updated to 3.3.1 but, unfortunately, my issue remains.

I tested with my Delphi code posted in my first comment and I have the same result in the final PDF file: "Expression is faulty" in cells with formulas (using the same ODT file in attachment).
Comment 8 Don't use this account, use tml@iki.fi 2011-03-04 02:36:53 UTC
Reopening then and assigning to Cedric. Please assign back to the list if you feel it isn't for you.
Comment 9 Cédric Bosdonnat 2011-03-07 06:30:38 UTC
I can't reproduce with the recent commits on master with the following basic macro:

Sub Main

	oDoc = StarDesktop.LoadComponentFromURL( _
			ConvertToURL( "/path/to/some/file-with-formulas.odt" ), _
			"_blank", 0, array() )
	
	Dim aExportProps(1) as new com.sun.star.beans.PropertyValue
	aExportProps(0).Name = "FilterName"
	aExportProps(0).Value = "writer_pdf_Export"
	
	oDoc.storeToUrl( ConvertToURL( "/path/to/some/file-with-formulas.pdf" ), aExportProps )

End Sub