Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Printing individual comment lines Post Reply Post New Topic
Author Message
jspc
Newbie
Newbie


Joined: 06 Oct 2012
Location: Australia
Online Status: Offline
Posts: 11
Quote jspc Replybullet Topic: Printing individual comment lines
     Posted: 22 Aug 2015 at 1:57pm
Hello,

I have an invoice with multiple comment lines.
I want to be able to select the individual lines from that comment to print on my invoice.
Would this be possible, rather than all the lines printing?

I tried to create a parameter; however, that only prints that comment and excludes the product lines on the invoice which I don’t want.

Thank you.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2015 at 4:47am
Would need a lot more description of your data set to assist.
IP IP Logged
jspc
Newbie
Newbie


Joined: 06 Oct 2012
Location: Australia
Online Status: Offline
Posts: 11
Quote jspc Replybullet Posted: 24 Aug 2015 at 9:59am
Hello, thank you for your reply.

The data source is a SQL Database.
The comments are stored in a table called ZTransdetails.Description.
This prints in a block style, as in, if I had 4 comments (each separated by a carriage return) all will print.
I want a way to isolate this and say only select line 2 to print.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 25 Aug 2015 at 4:25am
The only way I could see this done, is to use a formula and break up the comments and probably put them in an array.  Of course there is the limitation in Crystal that allows only 100 elements in an array.

Maybe someone has a better solution.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Aug 2015 at 5:25am
if I understand you correctly you have one varchar(max) field that always has multiple carriage returns and you always want the 'second comment' you can try what kevlray suggests with a split()

Split ({field},CHR(13))[2]
IP IP Logged
jspc
Newbie
Newbie


Joined: 06 Oct 2012
Location: Australia
Online Status: Offline
Posts: 11
Quote jspc Replybullet Posted: 25 Aug 2015 at 8:40pm
Thanks again for your reply.

I have a table called ZTransdetails.
In this table I have a column called ZTransdetails._Description. (This is a String [200])

Comments within the database are stored in this column.

If I have inserted 5 comments into this field, when I print my report each 5 line items print.

I want to be able to select which lines to print on the report. I might only want line 4 to print.

I am unsure how to do this.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Aug 2015 at 3:44am
if you have 5 comments do you have 5 rows or one row that concatenates them together into one string in one row?
How are you deciding if you want to 'only print 4' rather than 3 or 5? Is this a case by case or applied universally?
IP IP Logged
jspc
Newbie
Newbie


Joined: 06 Oct 2012
Location: Australia
Online Status: Offline
Posts: 11
Quote jspc Replybullet Posted: 26 Aug 2015 at 11:22am
Hello,

I have 5 rows.

The report is actually a Sales Order with multiple comments.
When converted to an invoice, this invoice is released in stages, when stock is available.
We want to select what comments, from the sales order are released on each invoice.

This would be a case by case scenario.

Do you think it’s possible?

Thank you.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 28 Aug 2015 at 6:48am
I do something similar in one of my reports.  The user selects one or more possible statements for a a report (or none, it is an optional prompt).  I then have a detail section for each statement and hide or show depending on which statement(s) they choose.
IP IP Logged
jspc
Newbie
Newbie


Joined: 06 Oct 2012
Location: Australia
Online Status: Offline
Posts: 11
Quote jspc Replybullet Posted: 29 Aug 2015 at 9:47pm
Hello, I figured out a way.
Create a Parameter, a cascading parameter with:
•     Product Code
•     Comment

When you run the report, select the document number, then select the comment relevant to the document number.
IP IP Logged
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