Formatting text in Crystal Reports - asp.net

I need users to be able to enter text in a webform with some basic formatting options and then generate a report showing the formatted text.
The support for HTML is horrible and entering a simple bulletlist doesn't even show properly in the report.
Right now i'm using a textarea with tinyMCE but that's because i don't know what else to use.
Is there a known best-practice for showing formatted text in a Crystal Report?
Edit
I just need to show a report with a bunch of text and icons. Users need to be able to save it to PDF. I doesn't even have to be Crystal Reports but it's what i have been using and worked so far. Until i needed to show formatted text.
I wish for another solution that comes with a designer and let's me bind against a DataSet.

The solution is to convert the HTML to RTF. RTF support in CR is much better than it is for HTML. This way users can still use the tinyMCE editor and even paste Word formatted HTML.
The way i convert the HTML to RTF if using an XSL stylesheet. Basically you load the HTML as an XML document and let the XSL translate it to RTF. This way you also have a lot of freedom over the way your text will appear since you can tweak the XSL.
I used this article to achieve that, the article's attachment includes the .XSL.

Related

Keep text format when copy/paste from Angular Application

I've realized that when I try to copy/paste a text from an Angular Application to any text editor software (ie Microsoft Word), all the text loses the original format.
I'm using as example the angular material website: https://material.angular.io/
When I copy the text and past in Microsoft Word:
Thats means, the pasted text lost the center alignment, the color and de font type.
Is there a way to keep the website format? I know that the font used by Angular Material is different from text editor, but there are another things that could be mantained (i.e. alignment, color, etc).
I've started a project using Angular 8 + Angular Material and I'm facing the same problem.
Well, you're not likely to get a straight copy/paste action to do what you're requesting.
Why it doesn't work as you expect:
Copy & Paste out of MS Word for example and you'll get Rich Text where all the formatting is part of the data payload. When you copy this to the clipboard all that extra styling metadata goes along with the text. If you paste that data INTO a rich text editor (not a straight text input) like Wordpress's Admin that editor package translates the text metadata that you can't see into equivalent HTML styling.
However, When you copy from HTML (in your browsers) all you're getting is the text without all the "rich" formatting. This happens because a browser uses outside context like DOM position, tag type, and CSS to style the HTML content into what is presented for you to see.
Rich text copy for just YOU
There are multiple browser plug-ins for Chrome and Firefox that will intercept your copy request, create formatting and then paste that to the clipboard. Just ask Google for recommendations.
Rich text copy for all users of a project
This, unfortunately, is more complicated. You will need to write code to do the following (this answer has a good example):
Figure out what the user is trying to copy (usually mapped to selected text).
Convert that content into rich text format. The example above simply copies the HTML but that won't get styling applied by external CSS. Packages like Quill MIGHT give you the option to get rich text back out.
Copy your converted text to the user's local clipboard. You shouldn't hijack browser commands to do this which is why you frequently see a "copy to clipboard" button to do this action. You can move content to the user's clipboard using the Clipboard API in most modern browsers.
Oh and you'll need the user's permission to do all this since proactively interacting with the user's clipboard presents a pretty massive security issue.

Telegra.ph text formatting

It is said that http://telegra.ph is an editor that is able to format a text via HTML tags or markdown. In online editor neither the first nor the second method is working. What am I doing wrong? How to format text?
You can see API document, there support only limited tags.
You can select text on Telegraph Editor, you will see floating menu which contains formatting options.
I think you mistake Telegraph as Bot API, which provides Markdown and HTML formatting options.

Recommendations for reporting solution that renders html content in asp.net

Our users input data using html editors (ckeditor and aspxhtmleidtor) which is saved in the database. Finally a huge report is generated displaying this html.
I tried xtrareport but they have limited html tag support so report does not look exactly the same as data was inputted by user.
Any recommendation or way around? Please help.
what about Crystal Report.
http://www.codeproject.com/KB/database/CrystalReportViewer.aspx
In Microsoft ReportViewer you can add a TextBox and right click on Text then select Create Placeholder and in placeholder you must sure markup type is HTML... selcted.
In Value of placeholder you must set:
Value='Html Tag'
finally i found no solution...as no reporting Solution provides full HTML tag support, as if they provide... they will end up creating a whole browser engine..
but in my case i found an easy way out....just displayed whole raw html data in html page and with the help of iframe and css i made it appear like a report, then i used ABCpdf to convert from html to pdf to give a nice downloadable pdf version ..

Showing PDF in a browser and getting the Text selected by the user (flash will do as well)

I want to show a PDF in browser, from which user can select text, showing pdf is very easy i have done this using "pdfviewer" control, now i want to get the selected text which the user selects in the PDF, is there any way to achieve this? i am using asp.net.
Edit: If there is a flash/ flex solution at the client end that will as well, does anyone know about it, i tried one API, but that dint seem to work
You can add a JavaScript PDF action to the page and have it post to an online form.
The PDF Viewer control from Winnovative doesn't offer any text selection APIs at all.
Acrobat's JavaScript engine doesn't either.
Sorry: No.

Reporting in Rich Text

I've built an ASP.net web application which allows the users to view and make notes on a list of calendar events. The notes are edited in a WYSIWYG editor that outputs to HTML text (but could also output to RTF), which is then saved as text in an MSSQL05 database.
Now I've got to add a printing function to the calendar application. Prior to this version, the printing was done through SSRS05, but now that I've added rich text notes, this method will no longer work.
I can render the whole calendar in a printer-friendly format in the web browser, but my users have two issues with that: first, I can't turn off the header and footer added during the print, and the users are a little too basic to understand how to turn it off themselves; and second, when a note gets too long, the text gets wrapped not-too-gracefully to the next page. Unfortunately, they use IE7, so the page-break-inside attribute isn't recognized, and upgrading to IE8 or using a different browser is out of the question (I already asked :P)
So with that information, what's the best way to generate a report which features rich text?
I suggest DataDynamics ActiveReports. Very powerful, lightyears ahead Crystal. Give it a try!

Resources