none
Report exported to RTF format and opened in MS Word 2007, shift the report logo to the right RRS feed

  • Question

  • When using Crystal Reports to export a report, that contains a logo in the Report Header section, to RTF or MS Word format,

    and opening it in MS Word 2007, the report logo is shift to the right, if the next section contains text formatted to display from right to left. ( Hebrew or Arabic language causes the issue )

    The issue only occurs when the exported report is open in MS Word 2007.

    The report displays as expected when open in MS Word 2003.

     

    Through our investigation, we found:

    1.       When there is a RTL paragraph object under picture object in Word 2007, picture object will be shifted. Word 2007 tried to place picture object at the end of page to avoid picture object shift (each object have position attribute to define its position in a page, so where to place does not affect where object shows). We have tried it with RTF exported by CR, and the logo didn’t shift.

    2.       We resaved the exported rtf file in Word 2003 and reopened it in Word 2007, the logo was shifted.

    Thus, this issue seems to be caused by a tricky behavior in Word 2007. Could you please help to resolve this problem?

    Friday, April 22, 2011 7:25 AM

Answers

  • OK, the only other thing that I can see that is probably significant is that when I select the Image, its anchor is shown in the paragraph containing the text "City Cyclists", which is an RTL paragraph. (It's easy to select the image in Word 2010, but not so easy in Word 2007 where I have to do it in VBA, e.g. using ActiveDocument.Shapes(3).Select). It is not clear why the shape's anchor should be there, because it is supposed to be anchored to the page, and all the positioning information is relative to the top left of the page. However, I have a feeling that Word has to display an anchor as part of a paragraph, and perhaps that has something to do with the problem. If you can select the image when you have added your extra LTR paragraph under it, is it perhaps anchored to that paragraph instead?

    Whatever the case, I think Word 2007 is "getting it wrong", and the workaround that you have found is probably as good a way as any to "fix" the problem, assuming it does not cause other problems for you.  I assume that either you need RTL (even if you are not using RTL scripts in the example you have posted), or that Crystal Reports is using RTL as a mechanism to do Right justification. Otherwise, the simple solution is probably to format everything as LTR.

     


    Peter Jamieson
    Wednesday, April 27, 2011 10:52 AM

All replies

  • Hi Celine,

     

    Thanks for posting in the MSDN Forum.

     

    I try to reproduce your issue by following steps:

     

    1.      I create a rtf file on Word 2003 and place a picture from file at the beginning of the document.

    2.      I save the rtf file.

    3.      I open the rtf file on Word 2007.

     

    It works fine on my side, everything is expected. Did I miss something in the above steps? I generate the rtf under WinXp, Word 2003 and Open it at Vista, Word 2007.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 25, 2011 6:08 AM
    Moderator
  • Can you post the rtf output from Crystal Reports somewhere where we can look at it?

    I probably have various versions of Crystal Reports here, but it's so long since I actually used it that it might take some time to replicate the problem :-)

     


    Peter Jamieson
    Monday, April 25, 2011 2:10 PM
  • Hi Tom,

     

    Thanks for the reply!

     

    The problem was caused by the text formatted to display from right to left in the next section. If I change the text’s reading order to “left to right” and then export it to Word 2007, the picture will not be shifted.

     

    Thanks,

    Celine

    Tuesday, April 26, 2011 3:42 AM
  • Can you post the rtf output from Crystal Reports somewhere where we can look at it?

    I probably have various versions of Crystal Reports here, but it's so long since I actually used it that it might take some time to replicate the problem :-)

     


    Peter Jamieson

    Hi Peter,

     

    Thanks for your reply!

     

    I’m trying to attach the report and the exported rtf file. However, I’m not familiar with the function for this forum. How can I post them in this web page? Or may I send them to your mailbox?

     

    Thanks,

    Celine

    Tuesday, April 26, 2011 3:54 AM
  • Hi Celine,

     

    You’re able to sent you file to skydrive. Please login the MSDN Forum then click the link http://www.live.com. You will find skydrive the menu when you put your mouse over the <<Windows Live>>at the top of web page. You’re able to add you files in to skydrive ant post the link in the forum.

     

    I hope it can help you.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 26, 2011 6:58 AM
    Moderator
  • Thanks Tom! I’ve shared the report and the exported rtf file to skydrive.

    Please find them at http://cid-3b5ae8e35729281b.office.live.com/browse.aspx/Export%5E_to%5E_RTF%5E_issue?Bsrc=EMSHHM&Bpub=SN.Notifications&sa=288042140

     

    Looking forward to your response.

     

    Thanks!

    Celine

    Tuesday, April 26, 2011 8:08 AM
  • Just as a starting point, I can see the problem you report in Word 2007 SP2, and I can see that the problem seems to go away again in Word 2010, but so far I cannot see if anything obvious in the rtf is the cause, or could be fixed.

    Two things that I have noticed that might be relevant:

     a. There is a page break at the top of the very first page. Is that always inserted by Crystal Reports, even when all the output is LTR?

     b. The image location is measured from the right hand side of the document. Is that the case when all the text is LTR?

    Also, is there only one way to position the image the way that you want in Crystal Reports? If there is more than one way, e.g. if you can choose to position it relative to the page or relative to the margin, can you try to specify the positioning a different way?

     


    Peter Jamieson
    Tuesday, April 26, 2011 10:11 PM
  • Hi Peter,


    Thanks for looking into the issue. Please see my comments below.

    Two things that I have noticed that might be relevant:

    a.       There is a page break at the top of the very first page. Is that always inserted by Crystal Reports, even when all the output is LTR?

    [Celine]: There is no difference excepts paragraph reading direction when all the output is LTR.

    b.      The image location is measured from the right hand side of the document. Is that the case when all the text is LTR?  

    [Celine]: Change the text to LTR the image location returns.

    Also, is there only one way to position the image the way that you want in Crystal Reports? If there is more than one way, e.g. if you can choose to position it relative to the page or relative to the margin, can you try to specify the positioning a different way?  

    [Celine]: I have tried to position it relative to the page or the margin, it doesn’t work. And another clue about is to add an empty LTR paragraph under the image and it position returns the right place. It seems the position have been affected by the RTL paragraph in Word 2007.

     

    Thanks!

    Celine

    Wednesday, April 27, 2011 9:16 AM
  • OK, the only other thing that I can see that is probably significant is that when I select the Image, its anchor is shown in the paragraph containing the text "City Cyclists", which is an RTL paragraph. (It's easy to select the image in Word 2010, but not so easy in Word 2007 where I have to do it in VBA, e.g. using ActiveDocument.Shapes(3).Select). It is not clear why the shape's anchor should be there, because it is supposed to be anchored to the page, and all the positioning information is relative to the top left of the page. However, I have a feeling that Word has to display an anchor as part of a paragraph, and perhaps that has something to do with the problem. If you can select the image when you have added your extra LTR paragraph under it, is it perhaps anchored to that paragraph instead?

    Whatever the case, I think Word 2007 is "getting it wrong", and the workaround that you have found is probably as good a way as any to "fix" the problem, assuming it does not cause other problems for you.  I assume that either you need RTL (even if you are not using RTL scripts in the example you have posted), or that Crystal Reports is using RTL as a mechanism to do Right justification. Otherwise, the simple solution is probably to format everything as LTR.

     


    Peter Jamieson
    Wednesday, April 27, 2011 10:52 AM