Page 1 of 2

Report with 2 bands with second dependant on first

Posted: Wed May 06, 2015 12:31 pm
by allancliff
Morning,

Looking to make a report with the following.

1. List of Orders
2. Under each order, a list of the first 3 products in each order.

Order 1 by Mr Bloggs
Item 1 £50
Item 2 £22.50
Item 3 £80

Order 2 by Mrs Smith
Item 1 £23
etc

Is this done with normal bands?
With a child band?
Have been going round in circles for hours but can't find an example.

Just need pointing in the right direction.

Thanks.

Re: Report with 2 bands with second dependant on first

Posted: Wed May 06, 2015 1:11 pm
by HighAley
Hello.

The report template depends on structure of your data.
This could be master-detail report or report with grouping.

Thank you.

Re: Report with 2 bands with second dependant on first

Posted: Thu May 07, 2015 9:23 am
by allancliff
Thank you for your reply, the Master Detail is the one I needed.



Can you help me with another problem.

I have a variable which is Surname:
The value can possibly have a single quote.

There are 2 ways to do this as I see.

1. Directly in SQL

AND Surname = '{SurnameOption}'
becomes
AND Surname = 'O'Leary'
(This is failing, I have tried to double the single quotes {Replace(SurnameOption,"'","''")} and the report doesn't load.

2. Using Filter
Query.Surname == IIF(SurnameOption == "All",Query.Surname,SurnameOption)

This doesn't seem to work, it loads "All" ok, but the doesn't filter when a value is sent.

Thanks for your time.

Re: Report with 2 bands with second dependant on first

Posted: Thu May 07, 2015 12:59 pm
by HighAley
Hello.

Do you use pure Silverlight or Client/Server Version?

Thank you.

Re: Report with 2 bands with second dependant on first

Posted: Thu May 07, 2015 2:11 pm
by allancliff
Silverlight

Re: Report with 2 bands with second dependant on first

Posted: Fri May 08, 2015 7:00 am
by allancliff
Hi, Aleksey is there a workaround for this in Silverlight?

Re: Report with 2 bands with second dependant on first

Posted: Fri May 08, 2015 7:35 am
by HighAley
Hello.

There are two completely different set of components in the Stimulsoft Reports.Silverlight product. Which one do you use? For pure Silverlight or Client/Server Version?
Please, send us a sample project with sample data which reproduces the issue. We will help you to solve your issues.

Thank you.

Re: Report with 2 bands with second dependant on first

Posted: Fri May 08, 2015 9:25 am
by allancliff
As far as I have been told by our programmers we have Client/Server Version.

I attach a very simple dictionary but it is just a list of Surnames.
Brown,Clint,Fox,Leeds,O'Leary,Smith

Then a select list of 'All' plus the Surnames, for a variable.
All,Brown,Clint,Fox,Leeds,O'Leary,Smith

In the filter I have Clients.Surname == SurnameOption, which works correctly for the Surnames but obviously "All" doesn't give results.

I just need to know the syntax for the filter so it shows All Data when the option is "All"

i.e.
Clients.Surname == IIF(SurnameOption == "All",Clients.Surname,SurnameOption)
(This option gives All the surnames on loading, but then when filtering on one gives no results)

IIF(SurnameOption == "All",Clients.Surname == Clients.Surname,Clients.Surname == SurnameOption)
(This gives an error)

Thanks again.

P.S. As another option I could filter directly in SQL but
WHERE Surname = '{Replace(SurnameOption,"'","''")}'
(replace a single quote with two single quotes also gives an error)

Re: Report with 2 bands with second dependant on first

Posted: Fri May 08, 2015 12:01 pm
by HighAley
Hello

Please, try to use next filter expression:

Code: Select all

Clients.Surname == SurnameOption || SurnameOption == "All"
You could insert in SQL query variable only. If you need to make any changes in it, you should do it before using the variable in the SQL query.

Thank you.

Re: Report with 2 bands with second dependant on first

Posted: Fri May 08, 2015 5:36 pm
by allancliff
Thank you so much, exactly what I need.