ullas K

ullas K

  • NA
  • 55
  • 0

displaying records in crystal reports from multiple tables in desired format

Sep 17 2012 12:22 AM
I am developing a windows application for a Library.I have to create a report using crystal report for Book details languagewise and categorywise.I can do all this .But my problem is in displaying category name.My database structure is as follws

Table-Books
Book_no varchar(30)
Book_Name varchar(40)
Language varchar(2)
catcode varchar(4)

I have four category table for respective languages named "Category_English",Category_Hindi",Category_Tamil",Category_Malayalam"

all these tables have the same fields ie;
cat_id int
catcode varchar(4)
catname varchar(25)

now if Language is English i want the corresponding catname from table "Category_English" displayed and if Hindi ,corresponding catname from table "Category_Hindi" and so on.

so depending on the language and catcode in Table BOOKS the corresponding Category name should be displayed.My report should look like

Book no Book Name
ENGLISH
AUTOBIOGRAPHY (Here now for me it is displaying catcode ie,ENAB(catcode for English Autobiography)
ENAB1 ABC
ENAB2 XYZ
NOVEL
ENN1 CDE
ENN2 FGH
HINDI
STORY
HS1 XXX
HS2 YYY

i WAS ABLE TO GROUP ALL THIS BUT SHOULD GET THE RESPECTIVE CATEGORY NAME DISPLAYED IN PLACE OF CATEGORY CODE.nOW IT IS DISPLAYING CATCODE FROM TABLE BOOKS.i TRIED USING FORMULA FIELD BUT WAS ABLE TO DISPLAY ONLY FOR ONE LANGUAGE
I Created a formula field catname and in the editor I typed

If{Books.language}="EN" then
{Category_English.catname} . This is working but if I write for all languages the report is empty
Ie;
If{Books.language}="EN" then
{Category_English.catname} else
If{Books.language}="H" then
{Category_Hindi.catname} and so on

Is there any way to do this.I am not well versed in this.Please help


Answers (6)