BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

 
Take control of your CMS with Infolytic (Opens a new window)  

General Notice: No events within the next 45 days.

displaying multivalue field in page header


 
Search this topic... | Search Crystal Reports... | Search Box
Register or Login to Post    Forum Index -> Building Reports -> Crystal Reports  Previous TopicPrint TopicNext Topic
Author Message
broccolimustdie
Senior Member
Senior Member



Joined: 17 Jun 2010

Posts: 83



PostPosted: Thu Nov 18, 2010 5:23 pm 
Post subject: displaying multivalue field in page header

a person can have multiple endorsements like so i need to make following possible in Page header( thts client rek)

Endorsement: H, E, T, R


when i m putting it in detail section i am getting folliwng result

Endorsement:
H
E
T
R

but in header its like : Endorsement: H

Plese help how this can be done
Back to top
BO_Chief
Forum Fanatic
Forum Fanatic



Joined: 06 Jun 2004
ASUG Icon
Posts: 5541
Location: Somewhere on God's Land.


flag
PostPosted: Thu Nov 18, 2010 6:34 pm 
Post subject: Re: displaying multivalue field in page header

Is your report based on Tables or Stored Procedure ?
What database are you using ?

If your report is based on stored procedure, you have to use PIVOT() database function if it supports. You should be able to display it.

_________________
help us help you! make sure your post has the following elements:
Does it include BO version, Database, an error, a problem, a SQL for object or Condition ?
Does it include some sample data what you have?
Does it include any code you already tried ? (working or not..)
Did you explain what you want for results?
If any of those elements are missing,chances are you didn't post enough information for us to help you!
Back to top
nahtanoj
Principal Member
Principal Member



Joined: 07 Jul 2009

Posts: 183
Location: Philippines


flag
PostPosted: Thu Nov 18, 2010 10:58 pm 
Post subject: Re: displaying multivalue field in page header

Hi,

This is normal behavior of CR once you place your parameter in Report Header or Page section. It only get the first value you selected.

Using Selected value you cannot display the value in Report or Page Section but if you are using range of values you can specify 2 set of parameters to define the the first and last value you want to capture.
Back to top
broccolimustdie
Senior Member
Senior Member



Joined: 17 Jun 2010

Posts: 83



PostPosted: Fri Nov 19, 2010 9:14 am 
Post subject: Re: displaying multivalue field in page header

@BO_Chief I am using oracle 11g tables.
is it possible with it


@jbiason
I dint get the soln you told can u explain in bit detail

Thanks in advance
Back to top
Don McG
Forum Member
Forum Member



Joined: 29 Sep 2010

Posts: 7



PostPosted: Fri Nov 19, 2010 11:20 am 
Post subject: Re: displaying multivalue field in page header

Create a formula that converts your multi-value parameter to a concatenated string of values, and use the formula's result in your header. Use the Crystal JOIN() function to perform the concatenation of the parameter's values.

Syntax is:

Join({MyParameter},", ")

where the value between the quotes may be any string of characters (including carriage returns) that you want to appear between the values in your parameter array.
Back to top
broccolimustdie
Senior Member
Senior Member



Joined: 17 Jun 2010

Posts: 83



PostPosted: Fri Nov 19, 2010 11:57 am 
Post subject: Re: displaying multivalue field in page header

i think that works fine with parameter but what about report field.
thanks for reply

It gives error a string required.

I used it following way

join({Abcd_query.Endr Code},",")

and it gives error highlighting "Abcd_query.endr Code" with error is a string array is required here.


I hope i was clear in explaining icon_rolleyes.gif
thanks in advance
Back to top
Don McG
Forum Member
Forum Member



Joined: 29 Sep 2010

Posts: 7



PostPosted: Fri Nov 19, 2010 3:14 pm 
Post subject: Re: displaying multivalue field in page header

Sorry. Misunderstood your problem. That approach would work only with multi-value parameters within Crystal.

What's the data type of the column you're trying to display? And how does Crystal manage to display it correctly in the detail section? Or is the detail section really displaying only the first value too?
Back to top
Don McG
Forum Member
Forum Member



Joined: 29 Sep 2010

Posts: 7



PostPosted: Fri Nov 19, 2010 3:33 pm 
Post subject: Re: displaying multivalue field in page header

Just re-read your original post, and I think I understand what you meant. I think you're saying that you want to display in the header (page header? group header?) a list of all the endorsement codes present in the data. If you're not using a parameter to specify the endorsements being selected in the query, the only way to do that would be to make sure that the list is present as a separate column in each row of the data, and use that column in the header. Otherwise, as you've seen, only the endorsement value present in the first row will appear in the header. A kludgey workaround would be to hard-code a column in your data with a list of all the values. This won't be dynamic, though, and won't necessarily reflect what's present in the data each time your query runs.

Maybe somebody else will come up with a creative approach to this, though I have to ask why it's important to have those values present in a header . . .
Back to top
BO_Chief
Forum Fanatic
Forum Fanatic



Joined: 06 Jun 2004
ASUG Icon
Posts: 5541
Location: Somewhere on God's Land.


flag
PostPosted: Fri Nov 19, 2010 5:00 pm 
Post subject: Re: displaying multivalue field in page header

broccolimustdie wrote:
@BO_Chief I am using oracle 11g tables.
is it possible with it


Yes, In that case, you have to create a command object in your report :

Code:
select 'Endorsement :', [1] as id1, [2] as id2 ,[3] as id3,[4] as id4
FROM (SELECT <ColumnName> FROM  <Table> ) p
     PIVOT (min(<ColumnName>) FOR <ColumnName> IN ([1],[2],[3],[4])) q


In the above code, replace <Table> with your database table and <ColumnName> with your table column name. Drag the columns to the report and concatenate them.

The above syntax is for SQL Server 2008. I am not sure the above will work for Oracle 11g.

_________________
help us help you! make sure your post has the following elements:
Does it include BO version, Database, an error, a problem, a SQL for object or Condition ?
Does it include some sample data what you have?
Does it include any code you already tried ? (working or not..)
Did you explain what you want for results?
If any of those elements are missing,chances are you didn't post enough information for us to help you!
Back to top
broccolimustdie
Senior Member
Senior Member



Joined: 17 Jun 2010

Posts: 83



PostPosted: Tue Nov 23, 2010 2:32 pm 
Post subject: Re: displaying multivalue field in page header

i did this and created column which represent all endorsement codes as one string and now that can be used in report ...but got busy with something else so havent implemented... but sure it will work

thank you icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Building Reports -> Crystal Reports  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0527 seconds using 17 queries. (SQL 0.0085 Parse 0.0342 Other 0.0099)
CCBot/2.0 (http://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo