Report with 2 bands with second dependant on first

Stimulsoft Reports.Silverlight discussion
allancliff
Posts: 13
Joined: Thu Apr 09, 2015 11:14 am

Report with 2 bands with second dependant on first

Post 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.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Report with 2 bands with second dependant on first

Post by HighAley »

Hello.

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

Thank you.
allancliff
Posts: 13
Joined: Thu Apr 09, 2015 11:14 am

Re: Report with 2 bands with second dependant on first

Post 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.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Report with 2 bands with second dependant on first

Post by HighAley »

Hello.

Do you use pure Silverlight or Client/Server Version?

Thank you.
allancliff
Posts: 13
Joined: Thu Apr 09, 2015 11:14 am

Re: Report with 2 bands with second dependant on first

Post by allancliff »

Silverlight
allancliff
Posts: 13
Joined: Thu Apr 09, 2015 11:14 am

Re: Report with 2 bands with second dependant on first

Post by allancliff »

Hi, Aleksey is there a workaround for this in Silverlight?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Report with 2 bands with second dependant on first

Post 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.
allancliff
Posts: 13
Joined: Thu Apr 09, 2015 11:14 am

Re: Report with 2 bands with second dependant on first

Post 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)
Attachments
Clients.zip
(996 Bytes) Downloaded 226 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Report with 2 bands with second dependant on first

Post 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.
allancliff
Posts: 13
Joined: Thu Apr 09, 2015 11:14 am

Re: Report with 2 bands with second dependant on first

Post by allancliff »

Thank you so much, exactly what I need.
Locked