Issue 32899

Summary: PDF Export of a chart selection in calc is empty
Product: Calc Reporter: caolanm
Component: codeAssignee: oc
Status: CLOSED FIXED QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P3 CC: IngridvdM, issues, tony.galmiche.ooo, weizhao
Version: OOo 1.1.2Keywords: oooqa
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 72764    
Attachments:
Description Flags
.sxc to export to .pdf chart by selection
none
patch_sc_080430
none
patch_080604 none

Description caolanm 2004-08-12 14:25:38 UTC
Load the simple .sxc,
select the chart and use export as pdf and export this selected chart on its
own, i.e. not the full spreadsheet just the little chart

Problem:
error dialog reports...
General Error
General input/output error.

Expected behaviour:
Exported .pdf containing chart alone

Extra information:
copying and pasting the chart into writer and selecting it and using writers
export to PDF does the right thing.
Comment 1 caolanm 2004-08-12 14:27:05 UTC
Created attachment 17098 [details]
.sxc to export to .pdf chart by selection
Comment 2 caolanm 2004-08-12 14:28:12 UTC
This occurs with SRC680_m49 as well as 1.1.2
Comment 3 frank 2004-08-13 10:46:12 UTC
Hi Caolan,

this is not a bug.

A chart in writer has its own datarange contained in itself. A chart in Calc has
a datarange conected to the calc sheet. As we do not have a standalne chart,
exporting such docs is not possible. So the given Error message is correct.
Nevertheless I think we should support exporting Charts directly to PDF. So I
assign this as Enhancement to Bjoern to keep an eye on it for the new Chart model.

It may be a double to internal #95885#.

Frank
Comment 4 caolanm 2004-08-13 11:05:51 UTC
Even an improved error message that pointed at a workaround would be an
improvement :-)
Comment 5 IngridvdM 2007-07-27 14:44:30 UTC
In the latest developer snapshot SRC680m222 exporting a selected chart to pdf in
calc gives no error message but instead exports nothing when you choose to
export the 'selection' as Range as General PDF Options.
In writer and impress this works fine, so I think this is a defect in calc.
->Niklas, please have a look.
Comment 6 bjoern.milcke 2007-07-27 14:54:27 UTC
Just checked with chart07 (based on m219, checked on Windows) and the chart is
exported together with the cells, so it looks like "selection" has been ignored,
instead everything was exported.

In m222 (checked on Linux), indeed, the pdf is empty. When doing a cell
selection including the chart, it works, however.
Comment 7 bjoern.milcke 2007-07-27 14:57:17 UTC
Also happens with selected shapes in the drawing layer of Calc.

->NN: Ok, now I have checked enough, now it's your turn ;-)
Comment 8 Martin Hollmichel 2007-11-09 16:51:44 UTC
change target from 2.x to 3.x according to
http://wiki.services.openoffice.org/wiki/Target_3x
Comment 9 IngridvdM 2008-02-28 15:52:21 UTC
*** Issue 81797 has been marked as a duplicate of this issue. ***
Comment 10 weiz 2008-04-30 09:51:40 UTC
->iha: the patch is finished, please find the attachment. I am not sure whether 
it's the most suitable way to fix this issue, so please let me know your 
suggestions. Thank you!
Comment 11 weiz 2008-04-30 09:52:40 UTC
Created attachment 53281 [details]
patch_sc_080430
Comment 12 IngridvdM 2008-05-05 17:16:02 UTC
->weiz: When exporting a selected chart now more than the chart is exported. If
the cells that are partly covered by the chart do contain values these values
are now printed in addition. So you export the chart and some rubbish. Maybe you
can try to do a more correct fix? I could imagine to expand the structure
ScMarkData maybe by a list of Page Number, Position And Size for each selected
shape. This additional information has to be handled at several places of course
(e.g. ScPrintFunc::DoPrint ) which is much more effort than the current solution.
If you think that it is too much effort for you even the current solution could
be enhanced: It is possible to select more than one OLE object, but only the
first one gets exported right now. Then it is possible to make a multiselection
of OLE objects and some cellranges (select a chart, press ctrl+shift on the
keyboard and select some additional cellranges with the mouse). So the new code
should not be  if( chart selected ) else (cell range selected) .
Comment 13 weiz 2008-06-04 03:04:33 UTC
->iha: the attached is the patch that for export multi-selection of OLE objects.
Thank you!
Comment 14 weiz 2008-06-04 03:05:14 UTC
Created attachment 54221 [details]
patch_080604
Comment 15 IngridvdM 2008-06-16 15:30:25 UTC
Fixed in CWS dr62.
@weiz, thanks for the patch. I found that the export of a multi selection is
also not  supported for simple cell ranges. So it is ok in the first step to
have no multi selection export for charts. I extended the patch in a way that no
cell content is exported when a selected object is exported.
Comment 16 niklas.nebel 2008-06-18 19:58:28 UTC
Reassigning to QA for verification
Comment 17 oc 2008-06-25 14:10:57 UTC
verified in internal build cws_dr62
Comment 18 thackert 2008-08-05 17:41:51 UTC
Hello @ll, 
I have tested it under Debian SID AMD64 with DEVm28 and the export of the chart
to PDF alone works :) No more sheet inside :) So I close this bug as resolved.