Report Design
 Crystal Reports Forum : Crystal Reports .NET 2003 : Report Design
Message Icon Topic: Display product details in multiple lines Post Reply Post New Topic
Author Message
chinnam
Newbie
Newbie


Joined: 31 Jul 2008
Location: Malaysia
Online Status: Offline
Posts: 2
Quote chinnam Replybullet Topic: Display product details in multiple lines
    Posted: 31 Jul 2008 at 3:31am
I am programming with Visual Studio.NET 2003 and my database is a SQL2005 Express.
 
I am currently creating a system which needs to list out products lines together with their details underneath (this can be very long and I wish to control the way they are broken down into multiple lines.
 
As a result, when my user is registering new products, I have instructed them to put a ";" sign in the nvarchar field to denote the starting of new lines.  I have no problem make sure of the ";" sign to break down the details in my program to show on textbox.  However, when it comes to the printing part in the Crystal Reports, I have spent very long time but cannot get it accomplished.  I know we could switch on the 'Can grow' function to have our details to be shown in multiple lines, but, I could not control on when I wan that to be.
 
Any help is very much appreciated as I need to get that resolved urgently!  Or, am I going on the wrong direction?  Should I use other datatype instead of nvarchar(MAX)?  Or, is there any ways to denote the starting of new lines that CR is actually able to support?
 
Thank you in advance on any help.


Edited by chinnam - 31 Jul 2008 at 3:32am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 02 Aug 2008 at 10:11pm

The problem is that if you use nvarchar(MAX), you may not be able to manipulate the string in BO, so that makes it hard to manipulate it.  You could try to do something like this in a formula:

replace({table.long field}, ';', chr(13) + chr(10))
 
This will replace each of the semi-colons with a carriage return/line feed.  You'd then put that formula on your report, make it as wide as you need to and turn on Can Grow.  You'd get your new lines where you want them that way.  However, unless you have a very small, well-trusted set of users, they're not always going to do what you ask them to!
 
Also, Crystal WILL read carriage return in long text.  So, you could have the users just press the Enter key instead of a semi-colon.  It would be more natural and easier for them to remember.
 
If the data absolutely needs to be formatted a specific way, regardless of how the users enter it, you need to find some other way to set up the data entry to ensure that it's formatted correctly.
 
-Dell
IP IP Logged
chinnam
Newbie
Newbie


Joined: 31 Jul 2008
Location: Malaysia
Online Status: Offline
Posts: 2
Quote chinnam Replybullet Posted: 03 Aug 2008 at 5:33pm

Hi Dell,

Your proposed solution works extremely well.  I really appreciate your help.

Thank you very much!

 

Best regards,

Chin Nam

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.