Thread

Posted on Tue Apr 26 21:36:03 2005 by marfolarfo
Error Messages and Mangled sheet name
I am generating a spreadsheet with 4 data sheets and 4 chart sheets. When first creating a new excel xls file, I encounter the following error message 4 times when opening the spreadsheet. "File error: data may have been lost." The spreeadsheet looks OK once it is open except that the name of the first sheet generated is mangled. For instance, instead of being "download" it is, "#@$#awnload." At this point the only way I can change the name is to save the spreadsheet and exit excel. It will core dump with some nasty message when you do this. Then open the spreadsheet again. This time the error messages will not present and, once up, I can change the name of the managled sheet by right clicking on it and using the rename capability of excel.
Direct Responses: 389 | 390 | Write a response
Posted on Tue Apr 26 22:51:05 2005 by marfolarfo in response to 388
Re: Error Messages and Mangled sheet name
For more clarification. I am running Activestate perl 5.8 on windows 2000. The mangles characters are not in the ascii character set.
Write a response
Posted on Wed Apr 27 02:04:48 2005 by jmcnamara in response to 388
Re: Error Messages and Mangled sheet name

> "File error: data may have been lost."

This error is explained in Step 11 of the Methodology in the Chart documentation. You can also see how it is dealt with in the example files. The charting documentation isn't exhaustive but it is important to try to follow it as closely as possible.

> For instance, instead of being "download" it is, "#@$#awnload."

I can't reproduce this. Upgrade to the latest version of Spreadsheet::WriteExcel and see if the problem persists. If it does, see if you can post an example based on the bug_report.pl program in the examples directory of the distro.

John.
--
Direct Responses: 392 | Write a response
Posted on Wed Apr 27 15:15:56 2005 by marfolarfo in response to 390
Re: Error Messages and Mangled sheet name
These two problems are related, or so it would seem. When I fixed the "File error: data may have been lost." problem by adding more formats, the mangled name of the first sheet problem also corrected itself.
Direct Responses: 2524 | Write a response
Posted on Fri Jun 23 17:55:49 2006 by lz in response to 392
Re: Error Messages and Mangled sheet name
Could you provide what formats have you add to solve this problem? Thanks!
Direct Responses: 2525 | Write a response
Posted on Fri Jun 23 18:07:18 2006 by jmcnamara in response to 2524
Re: Error Messages and Mangled sheet name

You can just add a number of unique formats as suggested in the methodology section of the Charts documentation.

$workbook->add_format(color => $_, bold => 1) for 1 .. 5; # Increase as necessary


John.
--

Direct Responses: 2537 | Write a response
Posted on Mon Jun 26 16:51:46 2006 by lz in response to 2525
Re: Error Messages and Mangled sheet name
Thanks John! How to set Excel chart axis labels or set the title with bold in perl? where should I find these functions or methods? Is there any documentation? Thanks!
Direct Responses: 2538 | Write a response
Posted on Mon Jun 26 17:06:10 2006 by jmcnamara in response to 2537
Re: Error Messages and Mangled sheet name

How to set Excel chart axis labels or set the title with bold in perl?

Spreadsheet::WriteExcel uses a template mechanism to add charts. You have to create the type of chart that you want in Excel, extract that data and then add it to a Spreadsheet::WriteExcel file.

For more information see the Charts documentation and the example files in the charts directory of the distro.

John.
--

Write a response