|
Posted
almost 11 years
ago
by
MarkBaker
I am using the method toRichTextObject to convert html to excel formatted cell.The html is valid but the <sup> is not closed in the resulting cell in excel even though it does have a </sup> closing tag in HTML.I have tested with the
... [More]
example file 42richText.php and added a ```<sup>test</sup>```But it still result in the rest of the sentence in superscript.```$html2='<p><font color="#ff0000"> 100°C is a hot temperature</font><br><font color="#0080ff"> 10°F <sup>is</sup> cold</font></p>';```See attachment for result. The world cold should not be super script.Note that <sub> works properly.I am using PHPExcel v1.8.0Comments: Thanks for highlighting the issue, and providing the solution - fixed in the develop branch on github [Less]
|
|
Posted
almost 11 years
ago
by
amsterq
I am using the method toRichTextObject to convert html to excel formatted cell.The html is valid but the <sup> is not closed in the resulting cell in excel even though it does have a </sup> closing tag in HTML.I have tested with the
... [More]
example file 42richText.php and added a ```<sup>test</sup>```But it still result in the rest of the sentence in superscript.```$html2='<p><font color="#ff0000"> 100°C is a hot temperature</font><br><font color="#0080ff"> 10°F <sup>is</sup> cold</font></p>';```See attachment for result. The world cold should not be super script.Note that <sub> works properly.I am using PHPExcel v1.8.0Comments: ** Comment from web user: amsterq ** I am answering myself in case others run into the issue.There is a small bug in the file /Classes/PHPExcel/Helper/HTML.phpOn line 709 the function name should be:endSuperscriptTaginstead ofendSupercriptTagIt is missing an S at Script. [Less]
|
|
Posted
almost 11 years
ago
by
amsterq
I am using the method toRichTextObject to convert html to excel formatted cell.The html is valid but the <sup> is not closed in the resulting cell in excel even though it does have a </sup> closing tag in HTML.I have tested with the
... [More]
example file 42richText.php and added a ```<sup>test</sup>```But it still result in the rest of the sentence in superscript.```$html2='<p><font color="#ff0000"> 100°C is a hot temperature</font><br><font color="#0080ff"> 10°F <sup>is</sup> cold</font></p>';```See attachment for result. The world cold should not be super script.Note that <sub> works properly.I am using PHPExcel v1.8.0 [Less]
|
|
Posted
almost 11 years
ago
by
tgibson87
Alright doing further investigations. I executed the same process on two different servers with identical processes and files. Works fine on one but not the other.
What would cause it just to die out with no exceptions, no errors, nothing at all.
|
|
Posted
almost 11 years
ago
by
tgibson87
Hello,
Couldn't find much in my searching online. My issue is occurring when I attempt to load xlsx files into PHPExcel. Extension xls works fine. It is not a memory issue. Please see code below:
try {
$objReader =
... [More]
PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load($file);
} catch (Exception $e) {
die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME)
. '": ' . $e->getMessage());
}
echo 'Post load data';
I do not get an error from the catch and do not get to 'Post load data'.
When attempting to perform:
PHPExcel_IOFactory::identify($file);
I encounter the same problem. Any ideas?
[Less]
|
|
Posted
almost 11 years
ago
by
segovius
Trying to install the PhpExcel module into Export It as per instructions on Eric Lamb’s site here The Excel file downloads ok but cannot be opened giving the error “the file may be damaged or modified from its original format”. I can open it in
... [More]
BBEDIT or a text editor and I see this:```A PHP Error was encounteredSeverity: Warning Message: ZipArchive::open() [<a href='ziparchive.open'>ziparchive.open</a>]: Unable to access php://outputFilename: Writer/Excel2007.phpLine Number: 239A PHP Error was encounteredSeverity: Warning Message: ZipArchive::open() [<a href='ziparchive.open'>ziparchive.open</a>]: Unable to access php://outputFilename: Writer/Excel2007.phpLine Number: 240Fatal error: Uncaught exception 'PHPExcel_Writer_Exception' with message 'Could not open php://output for writing.' in /home/xxxxx/public_html/cms/expressionengine/third_party/export_it/libraries/Export_data/PHPExcel/PHPExcel/Writer/Excel2007.php:241Stack trace:#0 /home/xxxxx/public_html/cms/expressionengine/third_party/export_it/libraries/Export_data/Export_data.php(429): PHPExcel_Writer_Excel2007->save('php://output')#1 /home/xxxxx/public_html/cms/expressionengine/third_party/export_it/libraries/Export_data/Export_data.php(56): Export_data->download_array(Array, true, 'channel_entry_e...')#2 /home/xxxx/public_html/cms/expressionengine/third_party/export_it/mod.export_it.php(275): Export_data->export_channel_entries(Array, 'xls')#3 /home/xxxx/public_html/cms/expressionengine/libraries/Template.php(1559): Export_it->channel_entries()#4 /home/xxxxx/public_html/cms/expressionengine/libraries/Template.php(1178): EE_Template->process_tags()#5 /home/xxxx/public_html/cms/expressionengine/libraries/Template.php( in /home/xxxxx/public_html/cms/expressionengine/third_party/export_it/libraries/Export_data/PHPExcel/PHPExcel/Writer/Excel2007.php</b> on line 241 ```Anyone any ideas? Do I need to do something else to install it? [Less]
|
|
Posted
almost 11 years
ago
by
nbravo
This is what I'm doing:
1- Open the file-> write a single sheet (charts and tables)->save
2- same thing, but now in the "second save", only charts are missing
Using same and different filenames
|
|
Posted
almost 11 years
ago
by
nbravo
Ok, I know it will overwrite the existing file, but the only thing that it's missing it's the charts, the data written before is fine.
|
|
Posted
almost 11 years
ago
by
MarkBaker
If you save several files with the same filename, then each save will overwrite the previous file with that filename.
If you save with different filenames, then it won't overwrite, because it's a different filename.
|
|
Posted
almost 11 years
ago
by
Kernle32DLL
Hi there,
We are in the process of switching our office code at work from LibreOffice (trough a com connection) to PHPExcel. We load existing xls and ods files as templates, and fill it with data. The xls/ods export part works great (after fiddling
... [More]
around a bit in low memory scenarios). One problem that persists for month now tho is the conversion to pdf files.
Plainly - non of the PDF renderer work. They output garbage in various ways, with no help in sight. Neither the last official release of PHPExcel nor the current github code change this much.
So I began to write my own converter which works directly with TCPDF (inspired by how this was done before the change to the html sub-step). However, this works only "okay-ish". Sizes are always a few mm off (not critical, but it bugs me a lot - personally). This could be either a rounding problem (I am aware of the column width problematics), or me using the wrong formula. I wil come to this later.
Secondly, I struggle with page fitting and scaling. There are 4 values (fitWidth, fitHeight, fitPage and scale) in PHPExcel that reflect different states, but I can't seem to get it right (sizing is always noticeably off). The only scenario that works is with no fitting and 100% scale, or simply width fitting.
As for how I calculate sizes:
I use TCPDF in "mm" mode (as pt and px only produced garbage). Page Margins are easily calculated via a multiplication with 25.4, and are precise. As for column widths: I calculate the size of the letter "0" via PHPExcel_Shared_Font::getTextWidthPixelsExact in the default font, and multiply this by the width PHPExcel gives me. This result is then multiplied with 25.4, and divided trough 72 (PDI conversion?). As I stated, this results in "okay-ish" result, e.g. with a table which is around 4mm to wide (24 columns).
As for page fitting: I take the width of the actual page (e.h. 297mm for a A4 landscape page), and subtract the margin. This value it than divided trough the width sum of all columns (calculated to mm as in above formula). This scale is then applied to all cells. This creates a nice width-fitting. PHPExcel still outputs a page scale tho (e.g. 71), and I'm not sure what to do with it. There are scenarios where it is needed, and some where it is not. From my understanding of a graphic I found on the net this scale should only be used if fitPage is false, but I couldn't confirm this (as it is sometimes needed with fitPage true).
So bottom line: I hit a dead end, and don't know how to proceed. Also, I'm under a lot of pressure from work. Any suggestions? :/
So long,
Kernle
[Less]
|