This is a migrated thread and some comments may be shown as answers.

RichTextBox report - server side

4 Answers 138 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Emil Alexiev
Top achievements
Rank 1
Emil Alexiev asked on 27 May 2011, 10:51 PM
Hi,
I think this doesn't fully apply to this part of the forum but I'd like to ask you guys anyways because you seem to be very proficient with silverlight and business web apps.

My silverlight webapp is a kind of a medical image storage server which not only runs a web server but also other services which can accept image data from other computers.  Customer can then log into the website and look at these images and generate a report.
I'm using richtextbox to generate a simple report for customers.  But since richtextbox and all of the silverlight app is running on the client side, the customer must open the web site and manually trigger generating of the report.
Customer would instead like to automate this process so that the report will get automatically generated and possibly stored to a network driver or sent directly to printer when our image service receives new image data.

Is there any way to utilize the richtextbox to perform automatic report generation on server side?  If not, do you have an idea how this could be accomplished? maybe using telerik reporting framework?
Thank you, Emil.

4 Answers, 1 is accepted

Sort by
0
Lantu Datinh
Top achievements
Rank 1
answered on 01 Jun 2011, 07:59 AM
I think i face the same problem. My scenario is:

I have the requirement to save RadDocument to database and display it on the site. Everything works fine on client side.

However, other requirement raised, require to display the content of RadDocument to telerik report. What i tried to do is (server side):
1. Convert it back to RadDocument
                            XamlFormatProvider xamlData = new XamlFormatProvider();
                            RadDocument document = xamlData.Import(basePDFContent.ContentCMS);

2. Convert it to HTML to be displayed in the report
                            HtmlFormatProvider htmlData = new HtmlFormatProvider();
                            report.HtmlContent = htmlData.Export(document);

Error occur when try to import XAML to RadDocument (Bold line):

+        InnerException    {"Could not load file or assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.":"System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"}    System.Exception {System.IO.FileNotFoundException}

                            Message    "The type initializer for 'MS.Internal.JoltHelper' threw an exception."    string

StackTrace    "   at MS.Internal.JoltHelper.get_ThreadID()\r\n   at MS.Internal.XcpImports.CheckThread()\r\n   at MS.Internal.XcpImports.CreateFromXaml(String xamlString, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers, Boolean expandTemplatesDuringParse)\r\n   at MS.Internal.XcpImports.CreateFromXaml(String xamlString, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers)\r\n   at System.Windows.Markup.XamlReader.Load(String xaml)\r\n   at Telerik.Windows.Documents.FormatProviders.Xaml.XamlFormatProvider.Import(String input) in c:\\Builds\\WPF_Scrum\\Release_SL\\Sources\\Development\\Documents\\Telerik.Windows.Documents.FormatProviders.Xaml\\XamlFormatProvider.cs:line 114"    string

I've already add the necessary reference. However reference to client project is "'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'"
Same added on the server, its version is 4.0
(C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll)

Please help and show me what i was wrong or miss something. Or there is a better way to achieve this.
0
Mike
Telerik team
answered on 02 Jun 2011, 08:49 AM
Hello Emil, Lantu Datinh,

The problem reported by Lantu appears because you are trying to use Silverlight assemblies in a .net application which in this case is not possible. Fortunately we have a version of RadRichTextBox for WPF (.Net 3.5 and 4.0)  which you should use in this case. This version of RadRichTextBox is suitable for scenarios that require document processing on the server and both Silverlight and WPF version use a compatible Xaml document format so documents can be manipulated with either component in the same way.  Please let us know if you meet any problems with this approach.

Regards,
Mike
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Lantu Datinh
Top achievements
Rank 1
answered on 02 Jun 2011, 11:08 AM
Hi Admin,

Can you show us how it can be done? which reference should be added more?

RadDocument document = xamlData.Import(basePDFContent.ContentCMS);
would be replace by which method.

Thanks a lot.
0
Iva Toteva
Telerik team
answered on 07 Jun 2011, 05:49 PM
Hi Lantu Datinh,

In your Silverlight project, you should add references to the Silverlight assemblies. In the Web project, you can add references to the WPF assemblies.
The API of the WPF RadRichtTextBox is just the same as the one for Silverlight and the code from your snippet:

RadDocument document = xamlData.Import(basePDFContent.ContentCMS);
can be used just as it is.


Regards,
Iva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
Emil Alexiev
Top achievements
Rank 1
Answers by
Lantu Datinh
Top achievements
Rank 1
Mike
Telerik team
Iva Toteva
Telerik team
Share this question
or