Print Page | Close Window

Multi-line Input string Parameters

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22519
Printed Date: 02 May 2024 at 1:35pm


Topic: Multi-line Input string Parameters
Posted By: statey603
Subject: Multi-line Input string Parameters
Date Posted: 08 Jan 2018 at 10:17am
Crystal Reports 2013 allows me to declare an input parameter that is thousands of characters in length.

Does anyone have any idea why the input text box doesn't size itself to accommodate the number of characters specified by the string length [max minus min]?

Also, why can't a carriage return be handled by the input text box?

A string variable certainly can handle a CR, but as soon as a CR is entered in an input parameter textbox, the parameter screen considers the CR the end of the input.

I just want to allow entry of simple, multiple line text into a string.

I am very surprised to discover this limitation and even read that older versions of Crystal Reports supported multiple line input parameter s.

I appreciate any workarounds that are suggested.


-------------
-bill



Replies:
Posted By: DBlank
Date Posted: 09 Jan 2018 at 3:21am
Can you describe your data set that would make sense for a user to hand type in over one thousand characters and those characters actually match a data set as a useful way to filter? Why would you not just use a multi-select option from a drop down?


Posted By: statey603
Date Posted: 09 Jan 2018 at 3:56am
Sure thing.

We are using Crystal Reports to generate letters to clients. Client information [name, address, case info, etc.] is pulled into the letter from the database. The letters have some input parameters where the worker inputs text specific to the client situation, such as the reason that the client's services are being discontinued, etc. Sometimes this might be a paragraph of text. This information is NOT stored in the database.

I do not know of any other way to modify the text of a report/letter. We have tried exporting to editable MS Word but Crystal loses page formatting. We also tried exporting to Rich Text, which does not lose page formatting, but the font and section sizes get screwed up. So our only alternative is to enter the text up front.

Thanks



-------------
-bill


Posted By: DBlank
Date Posted: 09 Jan 2018 at 3:59am
I see. You are not using it for filtering but rather to augment the out put for data that you could not pull from your EHR. Correct?


Posted By: statey603
Date Posted: 09 Jan 2018 at 4:14am
DBlank,

Yes, that is correct.

One way to accomplish what I need would be to store the text that the users need to type in the database and then just pull it into the report, but that requires adding screens to our application.

I do not understand why the Crystal's Input Parameter dialog screen is so inflexible. Ideally I think we optionally should be able to have more control such as change the size of the screen, the size of each input parameter box and most importantly, allow multi-line string input. I can dream..........

Thanks,
Bill

-------------
-bill


Posted By: DBlank
Date Posted: 09 Jan 2018 at 4:35am
which version of crystal are you using and what is the way the users are executing reports?


Posted By: statey603
Date Posted: 09 Jan 2018 at 5:56am
The reports/letters are being created by the development group using Crystal Reports 2013 SP10. These reports reside on a Crystal Reports Server [BI 4.0 SP4].

The users launch the Crystal Reports via 'URL reporting' that is implemented in a Windows application developed using PowerBuilder 12.6.





-------------
-bill


Posted By: DBlank
Date Posted: 09 Jan 2018 at 9:39am
Maybe play around a bit with HTML formatting and an .rtf export that could be edited in Word (or the like).
In earlier versions of CR I have created one large text box that compiles the 'text' as HTML. Set the field to interpret the string as HTML to get the formatting into it. I think it might hold the formatting better when it is exported as an rtf.

I would insert into the location of string the missing content (where you were using a run time parameter) with things like "<b>ADD YOUR IDEAS HERE</b>" so when the item was exported they could do the editing in Word but easily see what still needed to be altered.

Test a small version out to see if it works for what you need to do.


Posted By: statey603
Date Posted: 09 Jan 2018 at 10:37am
I tried export to Word but the page formatting is lost. Another Crystal Reports limitation. So, if, for example we have a letter that is more than one page, the page formatting that you see in the viewer is not applied to the Word document and we end up with letterhead on pages we don't want it on, etc.

I tried export to RTF which did not lose the page formatting but the section sizes were essentially locked to the size of the report section text when the report was generated [before manually adding more text]. In order to insert a paragraph of text into a section, I need to manually resize the section and guess what.....the sections below it do not move down on their own. So it means having to move each underlying section, resize all sections that need modified text and then enter the text. It was a formatting nightmare.

Oh yeah, I forgot to mention that the exports change the size of the font too.

I pretty much think I exhausted all of the export options that I could identify.

Perhaps I missed something but I scoured the forums and documentation and those were the only options I could find.

Thanks,
Bill

-------------
-bill


Posted By: DBlank
Date Posted: 10 Jan 2018 at 2:27am
I tried to handle the section issue by changing it into one giant HTML field that as the only item that is displayed. I used the HTML as a way to manage the formatting and within that one field. That alleviates the issue of when a user is adding the missing content to the exported version of it not 'moving' the sections below it.


Posted By: statey603
Date Posted: 10 Jan 2018 at 9:48am
DBlank,

I am not sure I am following you. I added a large textbox to a report with html tags and a prompt indicating this is where the text should be entered.

I exported to RTF but when I eidit the RTF, I still am seeing the same section size restrictions as before. I guess I am not understanding the HTML piece of it. Are you defining the text object as HTML or just putting an HTML prompt in it?

Thanks.

-------------
-bill


Posted By: DBlank
Date Posted: 11 Jan 2018 at 3:09am
I am concatenated the entire "letter" into one formula field and I am using HTML tags in that as the way to format that one field for the entirety of the way I wanted the letter to 'display'. This way when the letter is exported as an rtf it is just one section with multiple paragraphs.
For values that are still needed to be added by a user I decided to use color and bold tags and an "insert specific value here" text to prompt the user to 'finish the exported letter' before printing it.
When you place that formula field in the report canvas set it to be displayed as text interpretation = HTML text
I would recommend a simple test before spending hours building a complex.
Like build the letter header and pull in a few data items and a few places to 'add content'.
Export that and try editing it.


Posted By: statey603
Date Posted: 11 Jan 2018 at 3:15am
OK, a couple last questions. lol.

When you say you are concatenating the entire letter into your formula, how are you doing that?
Is the entire letter text being pasted into an input parameter?
or is there a way you are selecting all of the text of the crystal report from a formula?

Thanks


-------------
-bill


Posted By: DBlank
Date Posted: 11 Jan 2018 at 3:25am
I am creating a formula field in crystal.
In that formula field is where you concatenate the values

"<p>Dear " + table.FirstName + ",</p>" + "<p>The following foods <b>Add foods here</b> are needed for dinner.</p>"



Posted By: statey603
Date Posted: 11 Jan 2018 at 3:26am
OK, I see what you mean now.

Thank you.


-------------
-bill


Posted By: DBlank
Date Posted: 11 Jan 2018 at 3:26am
I am not sure this idea will work for what you need but it was a work around I found that I was able to get value out of.


Posted By: statey603
Date Posted: 11 Jan 2018 at 3:29am
I will try to create a minimal report to test it out and see if it will work for us.

I really appreciate all of your assistance with this.

Thanks,
Bill


-------------
-bill


Posted By: DBlank
Date Posted: 11 Jan 2018 at 3:30am
You can also make it so it creates multiple 'letters' at once for different 'customers' by grouping on a customer ID. If you need to roll multiple rows into one item you can do that via a shared variable and then make your ultimate output place on the group footer.


Posted By: statey603
Date Posted: 11 Jan 2018 at 4:24am

I just tried a quick test.

How do you get the report to recognize/interpret the HTML ?

I created a new formula and pasted your sample HTML into it and just replaced your table.FirstName field with my DB client name.

The client name gets picked up but the HTML tags are showing in the report as shown below. NOTE: I added spaces in the HTML tags so this forum post would not interpret the HTML.

< p >Dear John,< /p >" + "< p >The following foods < b >Add foods here< /b > are needed for dinner.< /p >

thanks




-------------
-bill


Posted By: DBlank
Date Posted: 11 Jan 2018 at 4:27am
Right click on the formula field
select Format Field
select Paragraph Tab
Change "Text Interpretation:" to HTML text


Posted By: statey603
Date Posted: 11 Jan 2018 at 4:30am
That fixed it.

Thanks


-------------
-bill


Posted By: statey603
Date Posted: 16 Jan 2018 at 6:53am
This approach might possibly be the solution that I need for the issues I was having.

Here are a few minor issues I ran into and how I resolved them.

1. If the RTF spans pages and the user edits it and adds too much text [more than the report section size can handle], some of the underlying text disappears below the Word frame and I cannot figure out how the user can scroll to it.
Resolution:
I added an input parameter asking the user to specify the number of lines of text they will be adding and I insert a <BR> for each line so the report section is sized appropriately. This seems to be working, although I need to test more scenarios.

2. My report has a bitmap image with the logo in the letterhead section. It looks fine when viewing the report but after the export to RTF, this image has a solid line border around it. No border in the original report. The image border can manually be removed by selecting the image, while editing the RTF, and changing the border color to No Color, but our users are not going to want to have to do this every time. I am wondering if there is a way to prevent the border from the report export.
Resolution:
In the report, selected the image and selected Format Graphic - Border tab. Although the line style was set to none, the color was set to Black. I changed it to White and now the border does not appear in the exported RTF.


Thanks,
Bill

-------------
-bill



Print Page | Close Window