cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Efashion db Query for passing multiple values

Former Member
0 Kudos

I want to pass multiple values from main report to subreport using efashion database.

for that i have created a formula @1- Join({p1},"','")   Formula @2        "(" + " ' " + @1 +" ' " + ")"

Obtained a string like ('Austin','Boston')

after that linked this formula(@2) to subreport's parameter which i created in Subreport SQL with the name {3}

Sql i wrote is -

Select City from tablename where {3}

However this is not returning the required result but when i am hardcoding the value in sql

as select City from Tablename where City in('Austin','Boston')

It is working fine.

Appreciate your help.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Could you pls tell me each and every step for passing multiple values from main report to subreport using efashion database.. because there might be a problem from my end in linking or etc..


abhilash_kumar
Active Contributor
0 Kudos

Attached is a sample report.

Download the file > Extract using Winzip/Winrar or any other unzipping tool that you might have > change the extension of the file from .txt to .rpt.

-Abhilash

Answers (7)

Answers (7)

Former Member
0 Kudos

It worked for me .. Thanks a lot Abhilash .. i liked this Community very much...

abhilash_kumar
Active Contributor
0 Kudos

Glad I could help. Please close this thread.

-Abhilash

Former Member
0 Kudos

Thanks a lot Abhilash!  I can see the output of Sample.rpt and it is same what I require

I want to see the command used in Subreport but whenever I click on view Command. It gives a prompt asking for Database selection where it is not showing Xtreme Sample Db used by you.

How to see this Command and run the report.


Former Member
0 Kudos

I have extracted and changed the filename from .txt->.rpt

but while opening this doc its throwing an error that (The Compound file %1 was produced with a newer version of storage )

Failed to open the document.

I am trying to open this rpt file at CRYSTAL REPORTS 2011

abhilash_kumar
Active Contributor
0 Kudos

I was able to change its extension and also open it in CR 2011!

I hope you're not 'renaming' the file. To change the extension, you need to:

- Go to Computer

- Click Alt + T > Folder Options > View > Uncheck 'Hide extensions for known file types' > OK

- You should now see the file I sent you as 'Sample.txt'

- Click rename on this file and change the 'extension' to .rpt which should also change its icon to Crystal Report's icon.

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Could you pls send me this file in any other format irrespective of rpt .

As i have different server for accessing crystal i.e inside ODC.There i can't send any mails and from here this file is not opening.

Thanks a lot for your help

abhilash_kumar
Active Contributor
0 Kudos

What is the issue with this file?

I was able to download > change its extension from .txt to .rpt > open the .rpt in CR Designer - works

for me!

There isn't another way as e-mails also don't work for you.

-Abhilash

Former Member
0 Kudos

Still I am getting Null values in subreport

Former Member
0 Kudos

Hi Abhilash,

Do I need to link the formula mentioned in step2 with City_Prompt?

abhilash_kumar
Active Contributor
0 Kudos

Yes. I thought you already had it linked hence I didn't mention.

-Abhilash

abhilash_kumar
Active Contributor
0 Kudos

Hi Saumya,

1) Change the SQL Query in the Subreport to:

Select City from tablename where City IN ({?City_Prompt})


2) Change the formula in the Main Report to:


"'" & Join({?Main_report_Prompt},"','") & "'"


-Abhilash