locked
Reports with rtf text RRS feed

  • Question

  • Hi all,

    I'm creating a report module which will save reports to xps format. I found information that to save report to xps I need to generate FixedDocument. I know how to do this but there is a problem, because every record which is added to report have property of type string which contains rtf text, and I need to display this property as it is formated with all pictures which are included to this text. All could be ok but when I'm writing to xps file or I want to display FixedDocument I have MemoryOutOfRangeException. Everything is ok when I remove this rtf text from report, so is there any different way to display rtf text without using FlowDocument? or maybe there is some module to create this kind of reports in xps files?

    Thursday, October 27, 2011 9:31 AM

All replies

  • Hi zibi_b,

    I think you could try to rtf text in a FlowDocument and then convert it to XPS, there is a blog about how to convert FlowDocument to XPS,

    http://blogs.msdn.com/b/fyuan/archive/2007/03/10/convert-xaml-flow-document-to-xps-with-style-multiple-page-page-size-header-margin.aspx

     

    Best regards,


    Sheldon _Xiao[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.

    Friday, October 28, 2011 9:12 AM
  • Hi Sheldon _Xiao,

    I will try this solution but I think that it will not help because as I tested few solutions i saw that in when I'm saving to xps file it memory usage starts growing. The same situation is when I'm trying display this in wpf application. So probably the problem is because there is a lot of records even 5800 which must be saved/displayed. So the question is how to reduce memory usage? If it's not possible please let me know I will try to find a different format for my reports.

    Best Regards

    Friday, October 28, 2011 11:41 AM
  • Hi zibi_b,

    It will not avoid the memory issue if there are 5800 records,  as for your specific situation, I think what I could do is chech your code and check if I could optimize it(however, it will not make big difference).

    Could you share your code with me.

     

    best regards,


    Sheldon _Xiao[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, October 31, 2011 7:37 AM