Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: non-relational Post Reply Post New Topic
Author Message
tkr_13
Newbie
Newbie


Joined: 12 Oct 2007
Online Status: Offline
Posts: 3
Quote tkr_13 Replybullet Topic: non-relational
    Posted: 12 Oct 2007 at 11:06am

We have an  Entity Attribute Values (EAV) database, which basically means we have a table with lots of rows, instead of lots of columns.  The software is sort of a long questionaire, with a persons responses being stored in this database.  So instead of a table with tons of columns each one representing a particular question, we have rows, and a id number that maps to another table that tells you the question.  So looks something like this:

ID        Value 

314    11/16/1967
317    111-11-1111
318    1 Main St
319    Apt 23
320    Podunk
321    IA
322    33445
323    802-867-5309
 

The ID value references another table which tells me what the particular question is.  For a report I want to grab answers to a certain question, and put it in a certain place on the report.  So birthday (id = 314) might go at top, phone number (id = 323) might go somewhere else, etc. I tried creating a formula field, taking value of field Value if ID = 314, but doesn't seem to work.  Only value I get is first one I come across (say birthday) and none of the others have anything. 

 

Any ideas how this might be able to work?

 

I'm using Crystal Reports 8.5.  I know that's old, but there's some reason that we need to use this version.

 

Thanks!

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 15 Oct 2007 at 9:12am
I would create a stored procedure that links the two tables together to reorganize the data into a standard table format and then report off the stored procedure.

Another very convoluted way to do this is to use the formula idea like you said to map each field into another formula that either returns an empty string or the field's value (formatted properly as a string data type) and put each formula in the appropriate place in the detail section. Then do a Underlay Following Section so that all the rows print on top of each other. That way they all appear to be from one record. However, you'll have to make sure your group them accordingly so that a new 'virtual row' will be created for each questionnaire (unless you are only printing one questionnaire at a time).
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.015 seconds.