Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Friday, March 30, 2012

MultiValue Parameter

Hello,

I have in my report a text box that lists the user selection. When the user select a few of the values I display the selection but when the user select "All" I would like the text box to say "Parameter: All".

Is there anyway to know if "All" was selected, I don't want to list all the values because sometime there are too many of them.

Thank you,

Itzhak

The closest you can get is to compare the number of rows in the dataset used for the valid values list (e.g. =CountRows("ParameterDataSetName")) with the number of selected parameter values (e.g. =Parameters!P1.Count)

-- Robert

|||

Thank you, this will solve my issue.

I put the following expression and it works well !!

=iif(CountRows("UsersDataSet")=Parameters!UserID.Count,"ALL",join(Parameters!UserID.Label,","))

Thanks,

Itzhak

Wednesday, March 21, 2012

Multiple values int textbox...

Hi,
I need to display the result set in a textbox,
if there are multiple rows i need to show them as comma separated..
Can anyone give me idea of how it can be achieved..
Thanks in advance,I can't think of an easy way.
You need to get the resultset concatanating, not do it in report layout.
You could use a cursor (effectively a loop) in the SQL query - get the
result set and concatanate the rows into a variable and output the
variable as the result set. Cursors are quite slow though.
You could do the same thing in VB code using ADO if that's your thing.
Chris
CCP wrote:
> Hi,
> I need to display the result set in a textbox,
> if there are multiple rows i need to show them as comma separated..
> Can anyone give me idea of how it can be achieved..
> Thanks in advance,sql

multiple values inside textbox

Hi,
I have created a function that will accept multiple values for a parameter.
I have added a textbox to the body where I want to display the values of the
parameter but for some reason it only shows the first value.
Why and how can I resolve it?
Thanksim also facing the same prob...
Did u get any solution for this...
Thanks,
"collie" wrote:
> Hi,
> I have created a function that will accept multiple values for a parameter.
> I have added a textbox to the body where I want to display the values of the
> parameter but for some reason it only shows the first value.
> Why and how can I resolve it?
> Thanks|||What kind of function is it? Are you storing comma separated values for that
parameter?
"Chandra" wrote:
> im also facing the same prob...
> Did u get any solution for this...
> Thanks,
>
> "collie" wrote:
> > Hi,
> >
> > I have created a function that will accept multiple values for a parameter.
> > I have added a textbox to the body where I want to display the values of the
> > parameter but for some reason it only shows the first value.
> > Why and how can I resolve it?
> >
> > Thanks|||Thanks for the response. Below is the function I am using.
CREATE FUNCTION dbo.UDF_CharCommaSeparatedListToTable
(
@.CommaSeparatedList VARCHAR(8000)
)
RETURNS @.ParsedTableValue TABLE (TableValue VARCHAR(1000))
AS
BEGIN
DECLARE @.TableValue VARCHAR(1000)
DECLARE @.Pos INT
SET @.CommaSeparatedList = LTRIM(RTRIM(@.CommaSeparatedList))+ ','
SET @.Pos = CHARINDEX(',', @.CommaSeparatedList, 1)
IF REPLACE(@.CommaSeparatedList, ',', '') <> ''
BEGIN
WHILE @.Pos > 0
BEGIN
SET @.TableValue = LTRIM(RTRIM(LEFT(@.CommaSeparatedList, @.Pos - 1)))
IF @.TableValue <> ''
BEGIN
INSERT INTO @.ParsedTableValue (TableValue)
VALUES (RTRIM(@.TableValue))
END
SET @.CommaSeparatedList = RIGHT(@.CommaSeparatedList,
LEN(@.CommaSeparatedList) - @.Pos)
SET @.Pos = CHARINDEX(',', @.CommaSeparatedList, 1)
END
END
RETURN
END
In the sp I am using it as follows:
--
where
(@.Paramregion IS NULL OR t.region in (Select stringval from dbo.CSVTABLE
(@.Paramregion)))
"Vipul Shah" wrote:
> What kind of function is it? Are you storing comma separated values for that
> parameter?
> "Chandra" wrote:
> > im also facing the same prob...
> > Did u get any solution for this...
> > Thanks,
> >
> >
> > "collie" wrote:
> >
> > > Hi,
> > >
> > > I have created a function that will accept multiple values for a parameter.
> > > I have added a textbox to the body where I want to display the values of the
> > > parameter but for some reason it only shows the first value.
> > > Why and how can I resolve it?
> > >
> > > Thanks|||Didn't find a solution. Did u?
"Chandra" wrote:
> im also facing the same prob...
> Did u get any solution for this...
> Thanks,
>
> "collie" wrote:
> > Hi,
> >
> > I have created a function that will accept multiple values for a parameter.
> > I have added a textbox to the body where I want to display the values of the
> > parameter but for some reason it only shows the first value.
> > Why and how can I resolve it?
> >
> > Thanks

Monday, March 12, 2012

Multiple Tables

Hi,
I am using a SProc to run a report, is it possible to have 2 Tables in one
report which will display different columns from the dataset ?
ThanksYes. You can use the same dataset multiple times. For instance, you could
apply different filters to it, have a table and have a graph etc. What you
cannot do is have the sproc return two resultsets.
Also, you can have multiple datasets as well.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Vishal" <vrajput77@.hotmail.com> wrote in message
news:Od3rYTACGHA.740@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I am using a SProc to run a report, is it possible to have 2 Tables in one
> report which will display different columns from the dataset ?
> Thanks
>

Saturday, February 25, 2012

multiple series on line chart

Hello,

I want to display more than one series on a line chart. I'm producing a resultset from a stored procedure which is like this:

Type Value Date

TypeA 0.07 01/06/2006

TypeB 0.08 01/06/2006

TypeC 0.08 01/06/2006

TypeA 0.08 02/06/2006

TypeB 0.09 02/06/2006

TypeC 0.09 02/06/2006

TypeA 0.09 03/06/2006

TypeB 0.10 03/06/2006

TypeC 0.11 03/06/2006

I want a seperate series for each of TypeA, TypeB, TypeC . Is it possible to doctor the resultset to give each Type (and Value) as unique columns? Or is there another way? Or do I have to shell out for Dundas Charts :) !

Thanks in advance for any help.

Sorry, I'm new to RS - I had overlooked the 'Series' area on the layout tab. Can it just be a matter of dropping the 'Type' field there? I'm not at my desk just now but will try in the morning - if someone feels like confirming meantime that would be great.|||

Dragging the 'Type' field from the dataset onto the series area on the layout tab gives me curves for TypeA, TypeB,TypeC. However the dates on the horizontal axis are all wrong 'Year' and 'Month' groups are OK but 'Days' are back to front (I have 3 category groups) - I need this because sometimes the dataset crosses more than 1 year. Anyone ?

|||All problems solved. In case anyone has similar problems - the issue was the dataset - the dates were not uniform for each Type ie.each series had a different set of dates.Once I got the dates matching everything was OK.

Multiple Select statements + Stored Procedure

Hi all,

I have 2 select statements in my Stored Proc.

I want to display the results of each query in my DataGridView.

However, only the data of the last select query is returned.

Why is this?

Thanks.

At a time you can only bind one resultset. if you need both the resultset on your page, you need to have 2 datagrid view.

If you use dataset,

grid1.DataSource = dataset.Tables[0];

grid2.DataSource = dataset.Tables[1];

If you use datareader,

grid1.DataSource = datareader;

datareader.NextResultSet();

grid2.DataSource = datareader;

|||

Ideally I want all data displayed in one DataGridView.

Each SELECT Query returns the exact same Columns but differing data.

|||

As both queries return the same columns, could you use a union clause in your stored proc?

eg

Code Snippet

CREATE PROC proc

AS

SELECT col1, col2

FROM table1

UNION ALL
SELECT col1, col2

FROM table2

This would mean you'd have just one results set.

If its more complicated than that, you could put the results of each query into a temp table/variable and just select from that?

HTH!

|||

May be something like this...

Select 'Table 1' as Source, * From FirstTable

Union ALL

Select 'Table 2' as Source, * From SecondTable

Order By

Source, ....

|||If there any relation between the tables,you can group them in the gridview|||

Thanks!!

UNION ALL works.

Multiple sections in report?

Perhaps I'm only overlooking something very simple?
I want to display different columns from my resultset, depending of the data
in one column. I also want to apply different styles depending on that
"controlling" column. I understand that I in a Table can define attributes
for the whole row (same as when you select the "left" portion of a row),
which can be based of the value of that row. But what if I want to display
different columns, based on the data?
Example:
* A dataset with a datetime column. We want to sort by this in the report.
Earliest event at the top.
* Each row represent different activities over the day. One column define
type of activity.
* Depending of the type of activity, I want to display different columns
from the dataset. Ideally, I want to control horizontal position depending
on the type of activity.
I believe that Crystal is using the term "Multiple Sections" for this, but
I'm not sure about the terminology.
Thanks
TiborTibor,
You can base the column field on a expression,e.g.
=Iif(Fields!A.Value=<expression>, Fields!B.Value, Fields!C.Value).
<expression> can reference to a field value or call to an embedded or
external function.
In addition, you can implement conditional formatting, e.g. identity the
column value based on the condition, coloring cells, etc.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com : http://tinyurl.com/3l49j
Home page and blog: http://www.prologika.com/
----
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> Perhaps I'm only overlooking something very simple?
> I want to display different columns from my resultset, depending of the
data
> in one column. I also want to apply different styles depending on that
> "controlling" column. I understand that I in a Table can define attributes
> for the whole row (same as when you select the "left" portion of a row),
> which can be based of the value of that row. But what if I want to display
> different columns, based on the data?
> Example:
> * A dataset with a datetime column. We want to sort by this in the report.
> Earliest event at the top.
> * Each row represent different activities over the day. One column define
> type of activity.
> * Depending of the type of activity, I want to display different columns
> from the dataset. Ideally, I want to control horizontal position depending
> on the type of activity.
> I believe that Crystal is using the term "Multiple Sections" for this, but
> I'm not sure about the terminology.
> Thanks
> Tibor
>|||Thanks Teo,
I understand those options, but it will become too much of a mess as you want to do more changes.
I had problems understanding what the customer wanted until he showed me this in Crystal. Imagine that you
have several sections (like page header/body/footer). In effect, you have several bodies, and position the
columns freely into each section. In section A I want column x and z, with this formatting. In section B I
want columns z and y and g, having the desired formatting. Etc. Then you say a condition which determines
which section is to be used for the row data. For example, if the value for column A is this, use section A
for the row. If the value is B, use section F.
I very much doubt this can be done using the table control, as you cannot align columns conditionally (column
width etc based on a value in the row). Methinks.
Possibly by just positioning out text boxes etc, but I can't really see how you can define several "sections",
and control which section is to be used for the row data.
I have a feeling this cannot be done using current version of RS. This is fine, considering it is a 1.0
product after all. The customer understand this as well. I just wanted to see whether I missed something.
(None of the three books I have mention anything along this line. I recall asking for your book as well, but
the store didn't have it. Looking forward to go through that too when I get my hands on it. :-) ).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message news:OF$jESEjEHA.3232@.TK2MSFTNGP10.phx.gbl...
> Tibor,
> You can base the column field on a expression,e.g.
> =Iif(Fields!A.Value=<expression>, Fields!B.Value, Fields!C.Value).
> <expression> can reference to a field value or call to an embedded or
> external function.
> In addition, you can implement conditional formatting, e.g. identity the
> column value based on the condition, coloring cells, etc.
> --
> Hope this helps.
> ----
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com : http://tinyurl.com/3l49j
> Home page and blog: http://www.prologika.com/
> ----
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > Perhaps I'm only overlooking something very simple?
> >
> > I want to display different columns from my resultset, depending of the
> data
> > in one column. I also want to apply different styles depending on that
> > "controlling" column. I understand that I in a Table can define attributes
> > for the whole row (same as when you select the "left" portion of a row),
> > which can be based of the value of that row. But what if I want to display
> > different columns, based on the data?
> >
> > Example:
> > * A dataset with a datetime column. We want to sort by this in the report.
> > Earliest event at the top.
> > * Each row represent different activities over the day. One column define
> > type of activity.
> > * Depending of the type of activity, I want to display different columns
> > from the dataset. Ideally, I want to control horizontal position depending
> > on the type of activity.
> >
> > I believe that Crystal is using the term "Multiple Sections" for this, but
> > I'm not sure about the terminology.
> >
> > Thanks
> > Tibor
> >
> >
>|||Tibor,
Looks like nested list regions may do the trick for you, where the outermost
list region will display the dataset rows, while the inner list regions are
the sections which visibility could be changed conditionally. Have you
explored this opton?
BTW, my book is shipping... see the report footer.
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com : http://tinyurl.com/3l49j
Home page and blog: http://www.prologika.com/
----
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eymIZXFjEHA.2524@.TK2MSFTNGP11.phx.gbl...
> Thanks Teo,
> I understand those options, but it will become too much of a mess as you
want to do more changes.
> I had problems understanding what the customer wanted until he showed me
this in Crystal. Imagine that you
> have several sections (like page header/body/footer). In effect, you have
several bodies, and position the
> columns freely into each section. In section A I want column x and z, with
this formatting. In section B I
> want columns z and y and g, having the desired formatting. Etc. Then you
say a condition which determines
> which section is to be used for the row data. For example, if the value
for column A is this, use section A
> for the row. If the value is B, use section F.
> I very much doubt this can be done using the table control, as you cannot
align columns conditionally (column
> width etc based on a value in the row). Methinks.
> Possibly by just positioning out text boxes etc, but I can't really see
how you can define several "sections",
> and control which section is to be used for the row data.
> I have a feeling this cannot be done using current version of RS. This is
fine, considering it is a 1.0
> product after all. The customer understand this as well. I just wanted to
see whether I missed something.
> (None of the three books I have mention anything along this line. I recall
asking for your book as well, but
> the store didn't have it. Looking forward to go through that too when I
get my hands on it. :-) ).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
news:OF$jESEjEHA.3232@.TK2MSFTNGP10.phx.gbl...
> > Tibor,
> >
> > You can base the column field on a expression,e.g.
> > =Iif(Fields!A.Value=<expression>, Fields!B.Value, Fields!C.Value).
> > <expression> can reference to a field value or call to an embedded or
> > external function.
> >
> > In addition, you can implement conditional formatting, e.g. identity the
> > column value based on the condition, coloring cells, etc.
> >
> > --
> > Hope this helps.
> >
> > ----
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > Home page and blog: http://www.prologika.com/
> > ----
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> > message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > > Perhaps I'm only overlooking something very simple?
> > >
> > > I want to display different columns from my resultset, depending of
the
> > data
> > > in one column. I also want to apply different styles depending on that
> > > "controlling" column. I understand that I in a Table can define
attributes
> > > for the whole row (same as when you select the "left" portion of a
row),
> > > which can be based of the value of that row. But what if I want to
display
> > > different columns, based on the data?
> > >
> > > Example:
> > > * A dataset with a datetime column. We want to sort by this in the
report.
> > > Earliest event at the top.
> > > * Each row represent different activities over the day. One column
define
> > > type of activity.
> > > * Depending of the type of activity, I want to display different
columns
> > > from the dataset. Ideally, I want to control horizontal position
depending
> > > on the type of activity.
> > >
> > > I believe that Crystal is using the term "Multiple Sections" for this,
but
> > > I'm not sure about the terminology.
> > >
> > > Thanks
> > > Tibor
> > >
> > >
> >
> >
>|||The report object model collections (e.g. Fields, Parameters) allow you to
perform dynamic access by using field names that are determined dynamically
at runtime.
E.g.
=Fields(Fields!FieldName.Value).Value
=Fields(Parameters!P1.Value).Value
You can even use complex expressions to generate field names.
Is this what you are looking for?
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> Perhaps I'm only overlooking something very simple?
> I want to display different columns from my resultset, depending of the
data
> in one column. I also want to apply different styles depending on that
> "controlling" column. I understand that I in a Table can define attributes
> for the whole row (same as when you select the "left" portion of a row),
> which can be based of the value of that row. But what if I want to display
> different columns, based on the data?
> Example:
> * A dataset with a datetime column. We want to sort by this in the report.
> Earliest event at the top.
> * Each row represent different activities over the day. One column define
> type of activity.
> * Depending of the type of activity, I want to display different columns
> from the dataset. Ideally, I want to control horizontal position depending
> on the type of activity.
> I believe that Crystal is using the term "Multiple Sections" for this, but
> I'm not sure about the terminology.
> Thanks
> Tibor
>|||> Is this what you are looking for?
Not really, I'm afraid. Thing is you have to "program" all this (using expressions). Compare that to having
several sections (several bodies) where you *visually* layout the elements (text-boxes, possibly data-bound,
defining font style etc). Then you just state that if col1 = a then use section z for the row, if col1 = b
then use section y for the row, etc.
You might want to check out how Crystal is doing it. I had a hard time understand until my customer showed me.
After that I clearly understood. A really neat feature.
Thanks for the reply.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Robert Bruckner [MSFT]" <robruc@.online.microsoft.com> wrote in message
news:u0bze$KjEHA.3696@.TK2MSFTNGP15.phx.gbl...
> The report object model collections (e.g. Fields, Parameters) allow you to
> perform dynamic access by using field names that are determined dynamically
> at runtime.
> E.g.
> =Fields(Fields!FieldName.Value).Value
> =Fields(Parameters!P1.Value).Value
> You can even use complex expressions to generate field names.
> Is this what you are looking for?
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > Perhaps I'm only overlooking something very simple?
> >
> > I want to display different columns from my resultset, depending of the
> data
> > in one column. I also want to apply different styles depending on that
> > "controlling" column. I understand that I in a Table can define attributes
> > for the whole row (same as when you select the "left" portion of a row),
> > which can be based of the value of that row. But what if I want to display
> > different columns, based on the data?
> >
> > Example:
> > * A dataset with a datetime column. We want to sort by this in the report.
> > Earliest event at the top.
> > * Each row represent different activities over the day. One column define
> > type of activity.
> > * Depending of the type of activity, I want to display different columns
> > from the dataset. Ideally, I want to control horizontal position depending
> > on the type of activity.
> >
> > I believe that Crystal is using the term "Multiple Sections" for this, but
> > I'm not sure about the terminology.
> >
> > Thanks
> > Tibor
> >
> >
>|||Interesting. I'll check it out. I guess I have to look into whether a list region can display rows like a
table does it. Seems I have some reading up to do. Any pointers where I can find some basic steps for how to
accomplish nested list regions?
Judging by the publishers website, seems your book is one notch up from the basic books? (I prefer to buy
books from a physical book store, to support them. I'd hate to see all them go out of business. But where I
can't find a book, yes, I do buy it off the net. Yours is on the list. :-) )
Thanks!
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message news:el71IoFjEHA.384@.TK2MSFTNGP10.phx.gbl...
> Tibor,
> Looks like nested list regions may do the trick for you, where the outermost
> list region will display the dataset rows, while the inner list regions are
> the sections which visibility could be changed conditionally. Have you
> explored this opton?
> BTW, my book is shipping... see the report footer.
> --
> Hope this helps.
> ----
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com : http://tinyurl.com/3l49j
> Home page and blog: http://www.prologika.com/
> ----
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:eymIZXFjEHA.2524@.TK2MSFTNGP11.phx.gbl...
> > Thanks Teo,
> >
> > I understand those options, but it will become too much of a mess as you
> want to do more changes.
> >
> > I had problems understanding what the customer wanted until he showed me
> this in Crystal. Imagine that you
> > have several sections (like page header/body/footer). In effect, you have
> several bodies, and position the
> > columns freely into each section. In section A I want column x and z, with
> this formatting. In section B I
> > want columns z and y and g, having the desired formatting. Etc. Then you
> say a condition which determines
> > which section is to be used for the row data. For example, if the value
> for column A is this, use section A
> > for the row. If the value is B, use section F.
> >
> > I very much doubt this can be done using the table control, as you cannot
> align columns conditionally (column
> > width etc based on a value in the row). Methinks.
> >
> > Possibly by just positioning out text boxes etc, but I can't really see
> how you can define several "sections",
> > and control which section is to be used for the row data.
> >
> > I have a feeling this cannot be done using current version of RS. This is
> fine, considering it is a 1.0
> > product after all. The customer understand this as well. I just wanted to
> see whether I missed something.
> > (None of the three books I have mention anything along this line. I recall
> asking for your book as well, but
> > the store didn't have it. Looking forward to go through that too when I
> get my hands on it. :-) ).
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> news:OF$jESEjEHA.3232@.TK2MSFTNGP10.phx.gbl...
> > > Tibor,
> > >
> > > You can base the column field on a expression,e.g.
> > > =Iif(Fields!A.Value=<expression>, Fields!B.Value, Fields!C.Value).
> > > <expression> can reference to a field value or call to an embedded or
> > > external function.
> > >
> > > In addition, you can implement conditional formatting, e.g. identity the
> > > column value based on the condition, coloring cells, etc.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ----
> > > Teo Lachev, MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > > Home page and blog: http://www.prologika.com/
> > > ----
> > >
> > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in
> > > message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > > > Perhaps I'm only overlooking something very simple?
> > > >
> > > > I want to display different columns from my resultset, depending of
> the
> > > data
> > > > in one column. I also want to apply different styles depending on that
> > > > "controlling" column. I understand that I in a Table can define
> attributes
> > > > for the whole row (same as when you select the "left" portion of a
> row),
> > > > which can be based of the value of that row. But what if I want to
> display
> > > > different columns, based on the data?
> > > >
> > > > Example:
> > > > * A dataset with a datetime column. We want to sort by this in the
> report.
> > > > Earliest event at the top.
> > > > * Each row represent different activities over the day. One column
> define
> > > > type of activity.
> > > > * Depending of the type of activity, I want to display different
> columns
> > > > from the dataset. Ideally, I want to control horizontal position
> depending
> > > > on the type of activity.
> > > >
> > > > I believe that Crystal is using the term "Multiple Sections" for this,
> but
> > > > I'm not sure about the terminology.
> > > >
> > > > Thanks
> > > > Tibor
> > > >
> > > >
> > >
> > >
> >
> >
>|||Tibor,
I attached a sample report that demonstrates nested lists. The Adventure
Works database has two types of customers: stores and individuals. The idea
here is that if the customer is individual the report will show his first
and last name. If the customer is store, store-specific details are shown.
This is accomplished by having two overlapping lists lstIndividual and
lstStore nested inside lstCustomer.
Not sure I get the idea of the book support that the brick-and-mortar stores
have but online don't. Please educate me on this subject some more so I
could pass it along to the publisher. Do you mean to return the book?
Hopefully, you won't have to. And yes, I tried my best to keep it above
basic :-)
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OaaxQZQjEHA.3476@.tk2msftngp13.phx.gbl...
> Interesting. I'll check it out. I guess I have to look into whether a list
region can display rows like a
> table does it. Seems I have some reading up to do. Any pointers where I
can find some basic steps for how to
> accomplish nested list regions?
> Judging by the publishers website, seems your book is one notch up from
the basic books? (I prefer to buy
> books from a physical book store, to support them. I'd hate to see all
them go out of business. But where I
> can't find a book, yes, I do buy it off the net. Yours is on the list.
:-) )
> Thanks!
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
news:el71IoFjEHA.384@.TK2MSFTNGP10.phx.gbl...
> > Tibor,
> >
> > Looks like nested list regions may do the trick for you, where the
outermost
> > list region will display the dataset rows, while the inner list regions
are
> > the sections which visibility could be changed conditionally. Have you
> > explored this opton?
> >
> > BTW, my book is shipping... see the report footer.
> >
> > --
> > Hope this helps.
> >
> > ----
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > Home page and blog: http://www.prologika.com/
> > ----
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> > message news:eymIZXFjEHA.2524@.TK2MSFTNGP11.phx.gbl...
> > > Thanks Teo,
> > >
> > > I understand those options, but it will become too much of a mess as
you
> > want to do more changes.
> > >
> > > I had problems understanding what the customer wanted until he showed
me
> > this in Crystal. Imagine that you
> > > have several sections (like page header/body/footer). In effect, you
have
> > several bodies, and position the
> > > columns freely into each section. In section A I want column x and z,
with
> > this formatting. In section B I
> > > want columns z and y and g, having the desired formatting. Etc. Then
you
> > say a condition which determines
> > > which section is to be used for the row data. For example, if the
value
> > for column A is this, use section A
> > > for the row. If the value is B, use section F.
> > >
> > > I very much doubt this can be done using the table control, as you
cannot
> > align columns conditionally (column
> > > width etc based on a value in the row). Methinks.
> > >
> > > Possibly by just positioning out text boxes etc, but I can't really
see
> > how you can define several "sections",
> > > and control which section is to be used for the row data.
> > >
> > > I have a feeling this cannot be done using current version of RS. This
is
> > fine, considering it is a 1.0
> > > product after all. The customer understand this as well. I just wanted
to
> > see whether I missed something.
> > > (None of the three books I have mention anything along this line. I
recall
> > asking for your book as well, but
> > > the store didn't have it. Looking forward to go through that too when
I
> > get my hands on it. :-) ).
> > > --
> > > Tibor Karaszi, SQL Server MVP
> > > http://www.karaszi.com/sqlserver/default.asp
> > > http://www.solidqualitylearning.com/
> > >
> > >
> > > "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> > news:OF$jESEjEHA.3232@.TK2MSFTNGP10.phx.gbl...
> > > > Tibor,
> > > >
> > > > You can base the column field on a expression,e.g.
> > > > =Iif(Fields!A.Value=<expression>, Fields!B.Value, Fields!C.Value).
> > > > <expression> can reference to a field value or call to an embedded
or
> > > > external function.
> > > >
> > > > In addition, you can implement conditional formatting, e.g. identity
the
> > > > column value based on the condition, coloring cells, etc.
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ----
> > > > Teo Lachev, MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > > > Home page and blog: http://www.prologika.com/
> > > > ----
> > > >
> > > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote
> > in
> > > > message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > > > > Perhaps I'm only overlooking something very simple?
> > > > >
> > > > > I want to display different columns from my resultset, depending
of
> > the
> > > > data
> > > > > in one column. I also want to apply different styles depending on
that
> > > > > "controlling" column. I understand that I in a Table can define
> > attributes
> > > > > for the whole row (same as when you select the "left" portion of a
> > row),
> > > > > which can be based of the value of that row. But what if I want to
> > display
> > > > > different columns, based on the data?
> > > > >
> > > > > Example:
> > > > > * A dataset with a datetime column. We want to sort by this in the
> > report.
> > > > > Earliest event at the top.
> > > > > * Each row represent different activities over the day. One column
> > define
> > > > > type of activity.
> > > > > * Depending of the type of activity, I want to display different
> > columns
> > > > > from the dataset. Ideally, I want to control horizontal position
> > depending
> > > > > on the type of activity.
> > > > >
> > > > > I believe that Crystal is using the term "Multiple Sections" for
this,
> > but
> > > > > I'm not sure about the terminology.
> > > > >
> > > > > Thanks
> > > > > Tibor
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
begin 666 ListDemo.rdl
M/#]X;6P@.=F5R<VEO;CTB,2XP(B!E;F-O9&EN9STB=71F+3@.B/SX-"CQ297!O
M<G0@.>&UL;G,](FAT=' Z+R]S8VAE;6%S+FUI8W)O<V]F="YC;VTO<W%L<V5R
M=F5R+W)E<&]R=&EN9R\R,# S+S$P+W)E<&]R=&1E9FEN:71I;VXB('AM;&YS
M.G)D/2)H='1P.B\O<V-H96UA<RYM:6-R;W-O9G0N8V]M+U-13%-E<G9E<B]R
M97!O<G1I;F<O<F5P;W)T9&5S:6=N97(B/@.T*(" \4FEG:'1-87)G:6X^,6EN
M/"]2:6=H=$UA<F=I;CX-"B @./$)O9'D^#0H@.(" @./%)E<&]R=$ET96US/@.T*
M(" @.(" @./$QI<W0@.3F%M93TB;&ES=$]U=&5R(CX-"B @.(" @.(" @./%-T>6QE
M("\^#0H@.(" @.(" @.(#Q(96EG:'0^,"XR-6EN/"](96EG:'0^#0H@.(" @.(" @.
M(#Q4;W ^,"XQ,C5I;CPO5&]P/@.T*(" @.(" @.(" \1W)O=7!I;F<@.3F%M93TB
M;&ES=$]U=&5R7T1E=&%I;'-?1W)O=7 B/@.T*(" @.(" @.(" @.(#Q'<F]U<$5X
M<')E<W-I;VYS/@.T*(" @.(" @.(" @.(" @./$=R;W5P17AP<F5S<VEO;CX]1FEE
M;&1S(4-U<W1O;65R240N5F%L=64\+T=R;W5P17AP<F5S<VEO;CX-"B @.(" @.
M(" @.(" \+T=R;W5P17AP<F5S<VEO;G,^#0H@.(" @.(" @.(#PO1W)O=7!I;F<^
M#0H@.(" @.(" @.(#Q:26YD97@.^,3PO6DEN9&5X/@.T*(" @.(" @.(" \1&%T85-E
M=$YA;64^9'-#=7-T;VUE<CPO1&%T85-E=$YA;64^#0H@.(" @.(" @.(#Q297!O
M<G1)=&5M<SX-"B @.(" @.(" @.(" \5&5X=&)O>"!.86UE/2)#=7-T;VUE<E1Y
M<&4B/@.T*(" @.(" @.(" @.(" @./%-T>6QE/@.T*(" @.(" @.(" @.(" @.(" \4&%D
M9&EN9TQE9G0^,G!T/"]0861D:6YG3&5F=#X-"B @.(" @.(" @.(" @.(" @./%!A
M9&1I;F=";W1T;VT^,G!T/"]0861D:6YG0F]T=&]M/@.T*(" @.(" @.(" @.(" @.
M(" \4&%D9&EN9U1O<#XR<'0\+U!A9&1I;F=4;W ^#0H@.(" @.(" @.(" @.(" @.
M(#Q0861D:6YG4FEG:'0^,G!T/"]0861D:6YG4FEG:'0^#0H@.(" @.(" @.(" @.
M(" \+U-T>6QE/@.T*(" @.(" @.(" @.(" @./%I);F1E>#XR/"]:26YD97@.^#0H@.
M(" @.(" @.(" @.(" \<F0Z1&5F875L=$YA;64^0W5S=&]M97)4>7!E/"]R9#I$
M969A=6QT3F%M93X-"B @.(" @.(" @.(" @.(#Q7:61T:#XR+C$R-6EN/"]7:61T
M:#X-"B @.(" @.(" @.(" @.(#Q#86Y'<F]W/G1R=64\+T-A;D=R;W<^#0H@.(" @.
M(" @.(" @.(" \5F%L=64^/49I<G-T*$9I96QD<R%#=7-T;VUE<E1Y<&4N5F%L
M=64I/"]686QU93X-"B @.(" @.(" @.(" @.(#Q,969T/C%I;CPO3&5F=#X-"B @.
M(" @.(" @.(" \+U1E>'1B;W@.^#0H@.(" @.(" @.(" @./$QI<W0@.3F%M93TB;'-T
M0W5S=&]M97(B/@.T*(" @.(" @.(" @.(" @./%-T>6QE("\^#0H@.(" @.(" @.(" @.
M(" \6DEN9&5X/C$\+UI);F1E>#X-"B @.(" @.(" @.(" @.(#Q297!O<G1)=&5M
M<SX-"B @.(" @.(" @.(" @.(" @./%1E>'1B;W@.@.3F%M93TB3&%S=$YA;64B/@.T*
M(" @.(" @.(" @.(" @.(" @.(#Q3='EL93X-"B @.(" @.(" @.(" @.(" @.(" @.(#Q0
M861D:6YG3&5F=#XR<'0\+U!A9&1I;F=,969T/@.T*(" @.(" @.(" @.(" @.(" @.
M(" @./%!A9&1I;F=";W1T;VT^,G!T/"]0861D:6YG0F]T=&]M/@.T*(" @.(" @.
M(" @.(" @.(" @.(" @./%!A9&1I;F=4;W ^,G!T/"]0861D:6YG5&]P/@.T*(" @.
M(" @.(" @.(" @.(" @.(" @./%!A9&1I;F=2:6=H=#XR<'0\+U!A9&1I;F=2:6=H
M=#X-"B @.(" @.(" @.(" @.(" @.(" \+U-T>6QE/@.T*(" @.(" @.(" @.(" @.(" @.
M(#Q:26YD97@.^,3PO6DEN9&5X/@.T*(" @.(" @.(" @.(" @.(" @.(#QR9#I$969A
M=6QT3F%M93Y,87-T3F%M93PO<F0Z1&5F875L=$YA;64^#0H@.(" @.(" @.(" @.
M(" @.(" @./%=I9'1H/C$N-S5I;CPO5VED=&@.^#0H@.(" @.(" @.(" @.(" @.(" @.
M/$-A;D=R;W<^=')U93PO0V%N1W)O=SX-"B @.(" @.(" @.(" @.(" @.(" \5F%L
M=64^/49I96QD<R%,87-T3F%M92Y686QU93PO5F%L=64^#0H@.(" @.(" @.(" @.
M(" @.(" @./$QE9G0^,2XS-S5I;CPO3&5F=#X-"B @.(" @.(" @.(" @.(" @./"]4
M97AT8F]X/@.T*(" @.(" @.(" @.(" @.(" \5&5X=&)O>"!.86UE/2)&:7)S=$YA
M;64B/@.T*(" @.(" @.(" @.(" @.(" @.(#Q3='EL93X-"B @.(" @.(" @.(" @.(" @.
M(" @.(#Q0861D:6YG3&5F=#XR<'0\+U!A9&1I;F=,969T/@.T*(" @.(" @.(" @.
M(" @.(" @.(" @./%!A9&1I;F=";W1T;VT^,G!T/"]0861D:6YG0F]T=&]M/@.T*
M(" @.(" @.(" @.(" @.(" @.(" @./%!A9&1I;F=4;W ^,G!T/"]0861D:6YG5&]P
M/@.T*(" @.(" @.(" @.(" @.(" @.(" @./%!A9&1I;F=2:6=H=#XR<'0\+U!A9&1I
M;F=2:6=H=#X-"B @.(" @.(" @.(" @.(" @.(" \+U-T>6QE/@.T*(" @.(" @.(" @.
M(" @.(" @.(#QR9#I$969A=6QT3F%M93Y&:7)S=$YA;64\+W)D.D1E9F%U;'1.
M86UE/@.T*(" @.(" @.(" @.(" @.(" @.(#Q7:61T:#XQ+C,W-6EN/"]7:61T:#X-
M"B @.(" @.(" @.(" @.(" @.(" \0V%N1W)O=SYT<G5E/"]#86Y'<F]W/@.T*(" @.
M(" @.(" @.(" @.(" @.(#Q686QU93X]1FEE;&1S(49I<G-T3F%M92Y686QU93PO
M5F%L=64^#0H@.(" @.(" @.(" @.(" @.(#PO5&5X=&)O>#X-"B @.(" @.(" @.(" @.
M(#PO4F5P;W)T271E;7,^#0H@.(" @.(" @.(" @.(" \3&5F=#XS+C(U:6X\+TQE
M9G0^#0H@.(" @.(" @.(" @.(" \5FES:6)I;&ET>3X-"B @.(" @.(" @.(" @.(" @.
M/$AI9&1E;CX]("A&:65L9',A0W5S=&]M97)4>7!E+E9A;'5E+E1O3&]W97(H
M*29L=#LF9W0[)W,G*3PO2&ED9&5N/@.T*(" @.(" @.(" @.(" @./"]6:7-I8FEL
M:71Y/@.T*(" @.(" @.(" @.(#PO3&ES=#X-"B @.(" @.(" @.(" \5&5X=&)O>"!.
M86UE/2)#=7-T;VUE<DE$(CX-"B @.(" @.(" @.(" @.(#Q3='EL93X-"B @.(" @.
M(" @.(" @.(" @./%!A9&1I;F=,969T/C)P=#PO4&%D9&EN9TQE9G0^#0H@.(" @.
M(" @.(" @.(" @.(#Q497AT06QI9VX^4FEG:'0\+U1E>'1!;&EG;CX-"B @.(" @.
M(" @.(" @.(" @./%!A9&1I;F=";W1T;VT^,G!T/"]0861D:6YG0F]T=&]M/@.T*
M(" @.(" @.(" @.(" @.(" \4&%D9&EN9U1O<#XR<'0\+U!A9&1I;F=4;W ^#0H@.
M(" @.(" @.(" @.(" @.(#Q0861D:6YG4FEG:'0^,G!T/"]0861D:6YG4FEG:'0^
M#0H@.(" @.(" @.(" @.(" \+U-T>6QE/@.T*(" @.(" @.(" @.(" @./')D.D1E9F%U
M;'1.86UE/D-U<W1O;65R240\+W)D.D1E9F%U;'1.86UE/@.T*(" @.(" @.(" @.
M(" @./%=I9'1H/C%I;CPO5VED=&@.^#0H@.(" @.(" @.(" @.(" \0V%N1W)O=SYT
M<G5E/"]#86Y'<F]W/@.T*(" @.(" @.(" @.(" @./%9A;'5E/CU&:65L9',A0W5S
M=&]M97))1"Y686QU93PO5F%L=64^#0H@.(" @.(" @.(" @./"]497AT8F]X/@.T*
M(" @.(" @.(" \+U)E<&]R=$ET96US/@.T*(" @.(" @./"],:7-T/@.T*(" @.(" @.
M/$QI<W0@.3F%M93TB;'-T4W1O<F4B/@.T*(" @.(" @.(" \4W1Y;&4@.+SX-"B @.
M(" @.(" @./$AE:6=H=#XP+C(U:6X\+TAE:6=H=#X-"B @.(" @.(" @./%1O<#XP
M+C<U:6X\+U1O<#X-"B @.(" @.(" @./%=I9'1H/C(N,3(U:6X\+U=I9'1H/@.T*
M(" @.(" @.(" \3&5F=#XS+C8R-6EN/"],969T/@.T*(" @.(" @./"],:7-T/@.T*
M(" @.(#PO4F5P;W)T271E;7,^#0H@.(" @./%-T>6QE("\^#0H@.(" @./$AE:6=H
M=#XR:6X\+TAE:6=H=#X-"B @./"]";V1Y/@.T*(" \5&]P36%R9VEN/C%I;CPO
M5&]P36%R9VEN/@.T*(" \1&%T85-O=7)C97,^#0H@.(" @./$1A=&%3;W5R8V4@.
M3F%M93TB061V96YT=7)E5V]R:W,B/@.T*(" @.(" @./')D.D1A=&%3;W5R8V5)
M1#XP.3=E-6)B,RUF-#(V+30W93(M.38V,"UD-35B-3(Y93,V96,\+W)D.D1A
M=&%3;W5R8V5)1#X-"B @.(" @.(#Q$871A4V]U<F-E4F5F97)E;F-E/D%D=F5N
M='5R95=O<FMS/"]$871A4V]U<F-E4F5F97)E;F-E/@.T*(" @.(#PO1&%T85-O
M=7)C93X-"B @./"]$871A4V]U<F-E<SX-"B @./%=I9'1H/C<N-S5I;CPO5VED
M=&@.^#0H@.(#Q$871A4V5T<SX-"B @.(" \1&%T85-E="!.86UE/2)D<T-U<W1O
M;65R(CX-"B @.(" @.(#Q&:65L9',^#0H@.(" @.(" @.(#Q&:65L9"!.86UE/2)#
M=7-T;VUE<DE$(CX-"B @.(" @.(" @.(" \1&%T849I96QD/D-U<W1O;65R240\
M+T1A=&%&:65L9#X-"B @.(" @.(" @.(" \<F0Z5'EP94YA;64^4WES=&5M+DEN
M=#,R/"]R9#I4>7!E3F%M93X-"B @.(" @.(" @./"]&:65L9#X-"B @.(" @.(" @.
M/$9I96QD($YA;64](D-U<W1O;65R5'EP92(^#0H@.(" @.(" @.(" @./$1A=&%&
M:65L9#Y#=7-T;VUE<E1Y<&4\+T1A=&%&:65L9#X-"B @.(" @.(" @.(" \<F0Z
M5'EP94YA;64^4WES=&5M+E-T<FEN9SPO<F0Z5'EP94YA;64^#0H@.(" @.(" @.
M(#PO1FEE;&0^#0H@.(" @.(" @.(#Q&:65L9"!.86UE/2)!8V-O=6YT3G5M8F5R
M(CX-"B @.(" @.(" @.(" \1&%T849I96QD/D%C8V]U;G1.=6UB97(\+T1A=&%&
M:65L9#X-"B @.(" @.(" @.(" \<F0Z5'EP94YA;64^4WES=&5M+DEN=#,R/"]R
M9#I4>7!E3F%M93X-"B @.(" @.(" @./"]&:65L9#X-"B @.(" @.(" @./$9I96QD
M($YA;64](D9I<G-T3F%M92(^#0H@.(" @.(" @.(" @./$1A=&%&:65L9#Y&:7)S
M=$YA;64\+T1A=&%&:65L9#X-"B @.(" @.(" @.(" \<F0Z5'EP94YA;64^4WES
M=&5M+E-T<FEN9SPO<F0Z5'EP94YA;64^#0H@.(" @.(" @.(#PO1FEE;&0^#0H@.
M(" @.(" @.(#Q&:65L9"!.86UE/2),87-T3F%M92(^#0H@.(" @.(" @.(" @./$1A
M=&%&:65L9#Y,87-T3F%M93PO1&%T849I96QD/@.T*(" @.(" @.(" @.(#QR9#I4
M>7!E3F%M93Y3>7-T96TN4W1R:6YG/"]R9#I4>7!E3F%M93X-"B @.(" @.(" @.
M/"]&:65L9#X-"B @.(" @.(" @./$9I96QD($YA;64](D5M86EL061D<F5S<R(^
M#0H@.(" @.(" @.(" @./$1A=&%&:65L9#Y%;6%I;$%D9')E<W,\+T1A=&%&:65L
M9#X-"B @.(" @.(" @.(" \<F0Z5'EP94YA;64^4WES=&5M+E-T<FEN9SPO<F0Z
M5'EP94YA;64^#0H@.(" @.(" @.(#PO1FEE;&0^#0H@.(" @.(" @.(#Q&:65L9"!.
M86UE/2).86UE(CX-"B @.(" @.(" @.(" \1&%T849I96QD/DYA;64\+T1A=&%&
M:65L9#X-"B @.(" @.(" @.(" \<F0Z5'EP94YA;64^4WES=&5M+E-T<FEN9SPO
M<F0Z5'EP94YA;64^#0H@.(" @.(" @.(#PO1FEE;&0^#0H@.(" @.(" @.(#Q&:65L
M9"!.86UE/2).=6UB97)%;7!L;WEE97,B/@.T*(" @.(" @.(" @.(#Q$871A1FEE
M;&0^3G5M8F5R16UP;&]Y965S/"]$871A1FEE;&0^#0H@.(" @.(" @.(" @./')D
M.E1Y<&5.86UE/E-Y<W1E;2Y);G0S,CPO<F0Z5'EP94YA;64^#0H@.(" @.(" @.
M(#PO1FEE;&0^#0H@.(" @.(" \+T9I96QD<SX-"B @.(" @.(#Q1=65R>3X-"B @.
M(" @.(" @./$1A=&%3;W5R8V5.86UE/D%D=F5N='5R95=O<FMS/"]$871A4V]U
M<F-E3F%M93X-"B @.(" @.(" @./$-O;6UA;F1497AT/E-%3$5#5" @.(" @.5$]0
M(#$P,"!#=7-T;VUE<BY#=7-T;VUE<DE$+"!#=7-T;VUE<BY#=7-T;VUE<E1Y
M<&4L($-U<W1O;65R+D%C8V]U;G1.=6UB97(L($EN9&EV:61U86PN1FER<W1.
M86UE+"!);F1I=FED=6%L+DQA<W1.86UE+" -"B @.(" @.(" @.(" @.(" @.(" @.
M(" @.("!);F1I=FED=6%L+D5M86EL061D<F5S<RP@.4W1O<F4N3F%M92P@.4W1O
M<F4N3G5M8F5R16UP;&]Y965S#0I&4D]-(" @.(" @.(" @.0W5S=&]M97(@.3$5&
M5"!/551%4B!*3TE.#0H@.(" @.(" @.(" @.(" @.(" @.(" @.(" @.26YD:79I9'5A
M;"!/3B!#=7-T;VUE<BY#=7-T;VUE<DE$(#T@.26YD:79I9'5A;"Y#=7-T;VUE
M<DE$($Q%1E0@.3U5415(@.2D])3@.T*(" @.(" @.(" @.(" @.(" @.(" @.(" @.(%-T
M;W)E($].($-U<W1O;65R+D-U<W1O;65R240@./2!3=&]R92Y#=7-T;VUE<DE$
M/"]#;VUM86YD5&5X=#X-"B @.(" @.(#PO475E<GD^#0H@.(" @./"]$871A4V5T
M/@.T*(" \+T1A=&%3971S/@.T*(" \3&5F=$UA<F=I;CXQ:6X\+TQE9G1-87)G
M:6X^#0H@.(#QR9#I3;F%P5&]'<FED/G1R=64\+W)D.E-N87!4;T=R:60^#0H@.
M(#QR9#I$<F%W1W)I9#YT<G5E/"]R9#I$<F%W1W)I9#X-"B @./')D.E)E<&]R
M=$E$/C X-#5F-#=E+39D-F4M-#=B82TY-38R+3=F.65E,C0S-#-F9#PO<F0Z
M4F5P;W)T240^#0H@.(#Q";W1T;VU-87)G:6X^,6EN/"]";W1T;VU-87)G:6X^
I#0H@.(#Q,86YG=6%G93YE;BU54SPO3&%N9W5A9V4^#0H\+U)E<&]R=#X`
`
end|||Hi Teo!
What you are describing sound very much what I try to do. Unfortunately, I couldn't run your code. I
modified the connection information so the query ran fine (I get both "I" and "S" in the
CustomerType column, for different rows).
However, when I run the query, I get compilation error:
"C:\Projects\MutipleLists\ListDemo.rdl The hidden expression for the list 'lstCustomer' contains an
error: [BC30201] Expression expected."
Sorry to be a pain here, seems like I'm very close to what I want to achieve... :-)
What I mean by the book store, is that I enjoy walking around in a physical book store, flipping the
pages. Mainly for "ordinary" books, but as well for computer books. I'd just hate to see that option
go away in some far future, due to online book stores has driven physical stores bust.
I'm no fanatic, though. I do buy online as well, especially when there are hard to get books, I'm
tight on time to go shopping etc.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
news:ulTGY9RjEHA.2652@.TK2MSFTNGP15.phx.gbl...
> Tibor,
> I attached a sample report that demonstrates nested lists. The Adventure
> Works database has two types of customers: stores and individuals. The idea
> here is that if the customer is individual the report will show his first
> and last name. If the customer is store, store-specific details are shown.
> This is accomplished by having two overlapping lists lstIndividual and
> lstStore nested inside lstCustomer.
> Not sure I get the idea of the book support that the brick-and-mortar stores
> have but online don't. Please educate me on this subject some more so I
> could pass it along to the publisher. Do you mean to return the book?
> Hopefully, you won't have to. And yes, I tried my best to keep it above
> basic :-)
> --
> Hope this helps.
> ----
> Teo Lachev, MCSD, MCT
> Author: "Microsoft Reporting Services in Action"
> Publisher website: http://www.manning.com/lachev
> Buy it from Amazon.com: http://shrinkster.com/eq
> Home page and blog: http://www.prologika.com/
> ----
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:OaaxQZQjEHA.3476@.tk2msftngp13.phx.gbl...
> > Interesting. I'll check it out. I guess I have to look into whether a list
> region can display rows like a
> > table does it. Seems I have some reading up to do. Any pointers where I
> can find some basic steps for how to
> > accomplish nested list regions?
> >
> > Judging by the publishers website, seems your book is one notch up from
> the basic books? (I prefer to buy
> > books from a physical book store, to support them. I'd hate to see all
> them go out of business. But where I
> > can't find a book, yes, I do buy it off the net. Yours is on the list.
> :-) )
> >
> > Thanks!
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> news:el71IoFjEHA.384@.TK2MSFTNGP10.phx.gbl...
> > > Tibor,
> > >
> > > Looks like nested list regions may do the trick for you, where the
> outermost
> > > list region will display the dataset rows, while the inner list regions
> are
> > > the sections which visibility could be changed conditionally. Have you
> > > explored this opton?
> > >
> > > BTW, my book is shipping... see the report footer.
> > >
> > > --
> > > Hope this helps.
> > >
> > > ----
> > > Teo Lachev, MCSD, MCT
> > > Author: "Microsoft Reporting Services in Action"
> > > Publisher website: http://www.manning.com/lachev
> > > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > > Home page and blog: http://www.prologika.com/
> > > ----
> > >
> > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
> in
> > > message news:eymIZXFjEHA.2524@.TK2MSFTNGP11.phx.gbl...
> > > > Thanks Teo,
> > > >
> > > > I understand those options, but it will become too much of a mess as
> you
> > > want to do more changes.
> > > >
> > > > I had problems understanding what the customer wanted until he showed
> me
> > > this in Crystal. Imagine that you
> > > > have several sections (like page header/body/footer). In effect, you
> have
> > > several bodies, and position the
> > > > columns freely into each section. In section A I want column x and z,
> with
> > > this formatting. In section B I
> > > > want columns z and y and g, having the desired formatting. Etc. Then
> you
> > > say a condition which determines
> > > > which section is to be used for the row data. For example, if the
> value
> > > for column A is this, use section A
> > > > for the row. If the value is B, use section F.
> > > >
> > > > I very much doubt this can be done using the table control, as you
> cannot
> > > align columns conditionally (column
> > > > width etc based on a value in the row). Methinks.
> > > >
> > > > Possibly by just positioning out text boxes etc, but I can't really
> see
> > > how you can define several "sections",
> > > > and control which section is to be used for the row data.
> > > >
> > > > I have a feeling this cannot be done using current version of RS. This
> is
> > > fine, considering it is a 1.0
> > > > product after all. The customer understand this as well. I just wanted
> to
> > > see whether I missed something.
> > > > (None of the three books I have mention anything along this line. I
> recall
> > > asking for your book as well, but
> > > > the store didn't have it. Looking forward to go through that too when
> I
> > > get my hands on it. :-) ).
> > > > --
> > > > Tibor Karaszi, SQL Server MVP
> > > > http://www.karaszi.com/sqlserver/default.asp
> > > > http://www.solidqualitylearning.com/
> > > >
> > > >
> > > > "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> > > news:OF$jESEjEHA.3232@.TK2MSFTNGP10.phx.gbl...
> > > > > Tibor,
> > > > >
> > > > > You can base the column field on a expression,e.g.
> > > > > =Iif(Fields!A.Value=<expression>, Fields!B.Value, Fields!C.Value).
> > > > > <expression> can reference to a field value or call to an embedded
> or
> > > > > external function.
> > > > >
> > > > > In addition, you can implement conditional formatting, e.g. identity
> the
> > > > > column value based on the condition, coloring cells, etc.
> > > > >
> > > > > --
> > > > > Hope this helps.
> > > > >
> > > > > ----
> > > > > Teo Lachev, MCSD, MCT
> > > > > Author: "Microsoft Reporting Services in Action"
> > > > > Publisher website: http://www.manning.com/lachev
> > > > > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > > > > Home page and blog: http://www.prologika.com/
> > > > > ----
> > > > >
> > > > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> wrote
> > > in
> > > > > message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > > > > > Perhaps I'm only overlooking something very simple?
> > > > > >
> > > > > > I want to display different columns from my resultset, depending
> of
> > > the
> > > > > data
> > > > > > in one column. I also want to apply different styles depending on
> that
> > > > > > "controlling" column. I understand that I in a Table can define
> > > attributes
> > > > > > for the whole row (same as when you select the "left" portion of a
> > > row),
> > > > > > which can be based of the value of that row. But what if I want to
> > > display
> > > > > > different columns, based on the data?
> > > > > >
> > > > > > Example:
> > > > > > * A dataset with a datetime column. We want to sort by this in the
> > > report.
> > > > > > Earliest event at the top.
> > > > > > * Each row represent different activities over the day. One column
> > > define
> > > > > > type of activity.
> > > > > > * Depending of the type of activity, I want to display different
> > > columns
> > > > > > from the dataset. Ideally, I want to control horizontal position
> > > depending
> > > > > > on the type of activity.
> > > > > >
> > > > > > I believe that Crystal is using the term "Multiple Sections" for
> this,
> > > but
> > > > > > I'm not sure about the terminology.
> > > > > >
> > > > > > Thanks
> > > > > > Tibor
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>|||Tibor,
Strangely, I encountered this error myself. I am almost positive that it is
related to a bug with RS. For some reason, RS thinks that
=Fields!CustomerType.Value = "i" is not a valid expression. I tried several
alterations and I don't recall exactly what I did to get rid off the error
message. The expression on the list visibility is perfectly fine and runs
fine on my computer :-(. Try to close your report or restart VS.NET to see
if it will help. Or, change to another expression and then replace it again.
Got your point about brick-and-mortar stores. Hopefully, the samples
chapters will boost your confidence level...
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23lYA18ojEHA.2812@.tk2msftngp13.phx.gbl...
> Hi Teo!
> What you are describing sound very much what I try to do. Unfortunately, I
couldn't run your code. I
> modified the connection information so the query ran fine (I get both "I"
and "S" in the
> CustomerType column, for different rows).
> However, when I run the query, I get compilation error:
> "C:\Projects\MutipleLists\ListDemo.rdl The hidden expression for the list
'lstCustomer' contains an
> error: [BC30201] Expression expected."
> Sorry to be a pain here, seems like I'm very close to what I want to
achieve... :-)
>
> What I mean by the book store, is that I enjoy walking around in a
physical book store, flipping the
> pages. Mainly for "ordinary" books, but as well for computer books. I'd
just hate to see that option
> go away in some far future, due to online book stores has driven physical
stores bust.
> I'm no fanatic, though. I do buy online as well, especially when there are
hard to get books, I'm
> tight on time to go shopping etc.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> news:ulTGY9RjEHA.2652@.TK2MSFTNGP15.phx.gbl...
> > Tibor,
> >
> > I attached a sample report that demonstrates nested lists. The Adventure
> > Works database has two types of customers: stores and individuals. The
idea
> > here is that if the customer is individual the report will show his
first
> > and last name. If the customer is store, store-specific details are
shown.
> >
> > This is accomplished by having two overlapping lists lstIndividual and
> > lstStore nested inside lstCustomer.
> >
> > Not sure I get the idea of the book support that the brick-and-mortar
stores
> > have but online don't. Please educate me on this subject some more so I
> > could pass it along to the publisher. Do you mean to return the book?
> > Hopefully, you won't have to. And yes, I tried my best to keep it above
> > basic :-)
> >
> > --
> > Hope this helps.
> >
> > ----
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ----
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> > message news:OaaxQZQjEHA.3476@.tk2msftngp13.phx.gbl...
> > > Interesting. I'll check it out. I guess I have to look into whether a
list
> > region can display rows like a
> > > table does it. Seems I have some reading up to do. Any pointers where
I
> > can find some basic steps for how to
> > > accomplish nested list regions?
> > >
> > > Judging by the publishers website, seems your book is one notch up
from
> > the basic books? (I prefer to buy
> > > books from a physical book store, to support them. I'd hate to see all
> > them go out of business. But where I
> > > can't find a book, yes, I do buy it off the net. Yours is on the list.
> > :-) )
> > >
> > > Thanks!
> > > --
> > > Tibor Karaszi, SQL Server MVP
> > > http://www.karaszi.com/sqlserver/default.asp
> > > http://www.solidqualitylearning.com/
> > >
> > >
> > > "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> > news:el71IoFjEHA.384@.TK2MSFTNGP10.phx.gbl...
> > > > Tibor,
> > > >
> > > > Looks like nested list regions may do the trick for you, where the
> > outermost
> > > > list region will display the dataset rows, while the inner list
regions
> > are
> > > > the sections which visibility could be changed conditionally. Have
you
> > > > explored this opton?
> > > >
> > > > BTW, my book is shipping... see the report footer.
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ----
> > > > Teo Lachev, MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > > > Home page and blog: http://www.prologika.com/
> > > > ----
> > > >
> > > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote
> > in
> > > > message news:eymIZXFjEHA.2524@.TK2MSFTNGP11.phx.gbl...
> > > > > Thanks Teo,
> > > > >
> > > > > I understand those options, but it will become too much of a mess
as
> > you
> > > > want to do more changes.
> > > > >
> > > > > I had problems understanding what the customer wanted until he
showed
> > me
> > > > this in Crystal. Imagine that you
> > > > > have several sections (like page header/body/footer). In effect,
you
> > have
> > > > several bodies, and position the
> > > > > columns freely into each section. In section A I want column x and
z,
> > with
> > > > this formatting. In section B I
> > > > > want columns z and y and g, having the desired formatting. Etc.
Then
> > you
> > > > say a condition which determines
> > > > > which section is to be used for the row data. For example, if the
> > value
> > > > for column A is this, use section A
> > > > > for the row. If the value is B, use section F.
> > > > >
> > > > > I very much doubt this can be done using the table control, as you
> > cannot
> > > > align columns conditionally (column
> > > > > width etc based on a value in the row). Methinks.
> > > > >
> > > > > Possibly by just positioning out text boxes etc, but I can't
really
> > see
> > > > how you can define several "sections",
> > > > > and control which section is to be used for the row data.
> > > > >
> > > > > I have a feeling this cannot be done using current version of RS.
This
> > is
> > > > fine, considering it is a 1.0
> > > > > product after all. The customer understand this as well. I just
wanted
> > to
> > > > see whether I missed something.
> > > > > (None of the three books I have mention anything along this line.
I
> > recall
> > > > asking for your book as well, but
> > > > > the store didn't have it. Looking forward to go through that too
when
> > I
> > > > get my hands on it. :-) ).
> > > > > --
> > > > > Tibor Karaszi, SQL Server MVP
> > > > > http://www.karaszi.com/sqlserver/default.asp
> > > > > http://www.solidqualitylearning.com/
> > > > >
> > > > >
> > > > > "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> > > > news:OF$jESEjEHA.3232@.TK2MSFTNGP10.phx.gbl...
> > > > > > Tibor,
> > > > > >
> > > > > > You can base the column field on a expression,e.g.
> > > > > > =Iif(Fields!A.Value=<expression>, Fields!B.Value,
Fields!C.Value).
> > > > > > <expression> can reference to a field value or call to an
embedded
> > or
> > > > > > external function.
> > > > > >
> > > > > > In addition, you can implement conditional formatting, e.g.
identity
> > the
> > > > > > column value based on the condition, coloring cells, etc.
> > > > > >
> > > > > > --
> > > > > > Hope this helps.
> > > > > >
> > > > > > ----
> > > > > > Teo Lachev, MCSD, MCT
> > > > > > Author: "Microsoft Reporting Services in Action"
> > > > > > Publisher website: http://www.manning.com/lachev
> > > > > > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > > > > > Home page and blog: http://www.prologika.com/
> > > > > > ----
> > > > > >
> > > > > > "Tibor Karaszi"
<tibor_please.no.email_karaszi@.hotmail.nomail.com>
> > wrote
> > > > in
> > > > > > message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > > > > > > Perhaps I'm only overlooking something very simple?
> > > > > > >
> > > > > > > I want to display different columns from my resultset,
depending
> > of
> > > > the
> > > > > > data
> > > > > > > in one column. I also want to apply different styles depending
on
> > that
> > > > > > > "controlling" column. I understand that I in a Table can
define
> > > > attributes
> > > > > > > for the whole row (same as when you select the "left" portion
of a
> > > > row),
> > > > > > > which can be based of the value of that row. But what if I
want to
> > > > display
> > > > > > > different columns, based on the data?
> > > > > > >
> > > > > > > Example:
> > > > > > > * A dataset with a datetime column. We want to sort by this in
the
> > > > report.
> > > > > > > Earliest event at the top.
> > > > > > > * Each row represent different activities over the day. One
column
> > > > define
> > > > > > > type of activity.
> > > > > > > * Depending of the type of activity, I want to display
different
> > > > columns
> > > > > > > from the dataset. Ideally, I want to control horizontal
position
> > > > depending
> > > > > > > on the type of activity.
> > > > > > >
> > > > > > > I believe that Crystal is using the term "Multiple Sections"
for
> > this,
> > > > but
> > > > > > > I'm not sure about the terminology.
> > > > > > >
> > > > > > > Thanks
> > > > > > > Tibor
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
>|||One more thing you can try is coexrce the expression to bool, such as:
=CBool(Fields!CustomerType.Value = "i")
--
Hope this helps.
----
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
----
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23lYA18ojEHA.2812@.tk2msftngp13.phx.gbl...
> Hi Teo!
> What you are describing sound very much what I try to do. Unfortunately, I
couldn't run your code. I
> modified the connection information so the query ran fine (I get both "I"
and "S" in the
> CustomerType column, for different rows).
> However, when I run the query, I get compilation error:
> "C:\Projects\MutipleLists\ListDemo.rdl The hidden expression for the list
'lstCustomer' contains an
> error: [BC30201] Expression expected."
> Sorry to be a pain here, seems like I'm very close to what I want to
achieve... :-)
>
> What I mean by the book store, is that I enjoy walking around in a
physical book store, flipping the
> pages. Mainly for "ordinary" books, but as well for computer books. I'd
just hate to see that option
> go away in some far future, due to online book stores has driven physical
stores bust.
> I'm no fanatic, though. I do buy online as well, especially when there are
hard to get books, I'm
> tight on time to go shopping etc.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> news:ulTGY9RjEHA.2652@.TK2MSFTNGP15.phx.gbl...
> > Tibor,
> >
> > I attached a sample report that demonstrates nested lists. The Adventure
> > Works database has two types of customers: stores and individuals. The
idea
> > here is that if the customer is individual the report will show his
first
> > and last name. If the customer is store, store-specific details are
shown.
> >
> > This is accomplished by having two overlapping lists lstIndividual and
> > lstStore nested inside lstCustomer.
> >
> > Not sure I get the idea of the book support that the brick-and-mortar
stores
> > have but online don't. Please educate me on this subject some more so I
> > could pass it along to the publisher. Do you mean to return the book?
> > Hopefully, you won't have to. And yes, I tried my best to keep it above
> > basic :-)
> >
> > --
> > Hope this helps.
> >
> > ----
> > Teo Lachev, MCSD, MCT
> > Author: "Microsoft Reporting Services in Action"
> > Publisher website: http://www.manning.com/lachev
> > Buy it from Amazon.com: http://shrinkster.com/eq
> > Home page and blog: http://www.prologika.com/
> > ----
> >
> > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> > message news:OaaxQZQjEHA.3476@.tk2msftngp13.phx.gbl...
> > > Interesting. I'll check it out. I guess I have to look into whether a
list
> > region can display rows like a
> > > table does it. Seems I have some reading up to do. Any pointers where
I
> > can find some basic steps for how to
> > > accomplish nested list regions?
> > >
> > > Judging by the publishers website, seems your book is one notch up
from
> > the basic books? (I prefer to buy
> > > books from a physical book store, to support them. I'd hate to see all
> > them go out of business. But where I
> > > can't find a book, yes, I do buy it off the net. Yours is on the list.
> > :-) )
> > >
> > > Thanks!
> > > --
> > > Tibor Karaszi, SQL Server MVP
> > > http://www.karaszi.com/sqlserver/default.asp
> > > http://www.solidqualitylearning.com/
> > >
> > >
> > > "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> > news:el71IoFjEHA.384@.TK2MSFTNGP10.phx.gbl...
> > > > Tibor,
> > > >
> > > > Looks like nested list regions may do the trick for you, where the
> > outermost
> > > > list region will display the dataset rows, while the inner list
regions
> > are
> > > > the sections which visibility could be changed conditionally. Have
you
> > > > explored this opton?
> > > >
> > > > BTW, my book is shipping... see the report footer.
> > > >
> > > > --
> > > > Hope this helps.
> > > >
> > > > ----
> > > > Teo Lachev, MCSD, MCT
> > > > Author: "Microsoft Reporting Services in Action"
> > > > Publisher website: http://www.manning.com/lachev
> > > > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > > > Home page and blog: http://www.prologika.com/
> > > > ----
> > > >
> > > > "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
wrote
> > in
> > > > message news:eymIZXFjEHA.2524@.TK2MSFTNGP11.phx.gbl...
> > > > > Thanks Teo,
> > > > >
> > > > > I understand those options, but it will become too much of a mess
as
> > you
> > > > want to do more changes.
> > > > >
> > > > > I had problems understanding what the customer wanted until he
showed
> > me
> > > > this in Crystal. Imagine that you
> > > > > have several sections (like page header/body/footer). In effect,
you
> > have
> > > > several bodies, and position the
> > > > > columns freely into each section. In section A I want column x and
z,
> > with
> > > > this formatting. In section B I
> > > > > want columns z and y and g, having the desired formatting. Etc.
Then
> > you
> > > > say a condition which determines
> > > > > which section is to be used for the row data. For example, if the
> > value
> > > > for column A is this, use section A
> > > > > for the row. If the value is B, use section F.
> > > > >
> > > > > I very much doubt this can be done using the table control, as you
> > cannot
> > > > align columns conditionally (column
> > > > > width etc based on a value in the row). Methinks.
> > > > >
> > > > > Possibly by just positioning out text boxes etc, but I can't
really
> > see
> > > > how you can define several "sections",
> > > > > and control which section is to be used for the row data.
> > > > >
> > > > > I have a feeling this cannot be done using current version of RS.
This
> > is
> > > > fine, considering it is a 1.0
> > > > > product after all. The customer understand this as well. I just
wanted
> > to
> > > > see whether I missed something.
> > > > > (None of the three books I have mention anything along this line.
I
> > recall
> > > > asking for your book as well, but
> > > > > the store didn't have it. Looking forward to go through that too
when
> > I
> > > > get my hands on it. :-) ).
> > > > > --
> > > > > Tibor Karaszi, SQL Server MVP
> > > > > http://www.karaszi.com/sqlserver/default.asp
> > > > > http://www.solidqualitylearning.com/
> > > > >
> > > > >
> > > > > "Teo Lachev" <teo.lachev@.nospam.prologika.com> wrote in message
> > > > news:OF$jESEjEHA.3232@.TK2MSFTNGP10.phx.gbl...
> > > > > > Tibor,
> > > > > >
> > > > > > You can base the column field on a expression,e.g.
> > > > > > =Iif(Fields!A.Value=<expression>, Fields!B.Value,
Fields!C.Value).
> > > > > > <expression> can reference to a field value or call to an
embedded
> > or
> > > > > > external function.
> > > > > >
> > > > > > In addition, you can implement conditional formatting, e.g.
identity
> > the
> > > > > > column value based on the condition, coloring cells, etc.
> > > > > >
> > > > > > --
> > > > > > Hope this helps.
> > > > > >
> > > > > > ----
> > > > > > Teo Lachev, MCSD, MCT
> > > > > > Author: "Microsoft Reporting Services in Action"
> > > > > > Publisher website: http://www.manning.com/lachev
> > > > > > Buy it from Amazon.com : http://tinyurl.com/3l49j
> > > > > > Home page and blog: http://www.prologika.com/
> > > > > > ----
> > > > > >
> > > > > > "Tibor Karaszi"
<tibor_please.no.email_karaszi@.hotmail.nomail.com>
> > wrote
> > > > in
> > > > > > message news:uCjSU4CjEHA.3664@.TK2MSFTNGP12.phx.gbl...
> > > > > > > Perhaps I'm only overlooking something very simple?
> > > > > > >
> > > > > > > I want to display different columns from my resultset,
depending
> > of
> > > > the
> > > > > > data
> > > > > > > in one column. I also want to apply different styles depending
on
> > that
> > > > > > > "controlling" column. I understand that I in a Table can
define
> > > > attributes
> > > > > > > for the whole row (same as when you select the "left" portion
of a
> > > > row),
> > > > > > > which can be based of the value of that row. But what if I
want to
> > > > display
> > > > > > > different columns, based on the data?
> > > > > > >
> > > > > > > Example:
> > > > > > > * A dataset with a datetime column. We want to sort by this in
the
> > > > report.
> > > > > > > Earliest event at the top.
> > > > > > > * Each row represent different activities over the day. One
column
> > > > define
> > > > > > > type of activity.
> > > > > > > * Depending of the type of activity, I want to display
different
> > > > columns
> > > > > > > from the dataset. Ideally, I want to control horizontal
position
> > > > depending
> > > > > > > on the type of activity.
> > > > > > >
> > > > > > > I believe that Crystal is using the term "Multiple Sections"
for
> > this,
> > > > but
> > > > > > > I'm not sure about the terminology.
> > > > > > >
> > > > > > > Thanks
> > > > > > > Tibor
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
>

Monday, February 20, 2012

Multiple Rows to One Column Results

I want to display the top 5 count of areacodes for each name
I

want to combine all the results for the areacodes into one column for

each user. like a csv. I tried my code below but the results just

return the same 5 of areacodes for all names on each area code row with

each callername. like
joe blow 123,456,755,312,465,567,555
bill jones 123,456,755,312,465,567,555

I just want the top 5 for each particular name.
I tried reading a few articles on putting multiple colums in one row and i could not figure out what i am missing!
Thanks

DECLARE @.Stage TABLE (RowID INT IDENTITY(1, 1), CallerName VARCHAR(256), AreaCode VARCHAR(3), Calls INT, theDate DATETIME,myareacodes int)
declare @.MyAreaCodes varchar(50)
INSERT @.Stage
(
CallerName,
AreaCode,
Calls,
theDate
--myAreacodes

) --This is where the area code data comes from I can get it to display in multiple colums, but -- I want the area codes to be on one line for each name
SELECT CallerName,
SUBSTRING(TargetNum, 2, 3) AS AreaCode,
COUNT(*) AS AreaCodeCount,
DATEADD(day, DATEDIFF(day, 0, GtCalcDate), 0) as myDate
FROM CDRMAIN
WHERE LEN(TargetNum) >= 11
AND TargetNum NOT LIKE '_800%'
AND GtCalcDate >= '2006-11-06'
AND GtCalcDate < '2006-11-07'
GROUP BY CallerName,
SUBSTRING(TargetNum, 2, 3),
DATEADD(day, DATEDIFF(day, 0, GtCalcDate), 0)
ORDER BY CallerName,
COUNT(*) DESC

-- Get Calls
SELECT s.CallerName,
s.AreaCode,
s.Calls,
s.theDate--,myareacodes
FROM @.Stage s
INNER JOIN (
SELECT CallerName,
MIN(RowID) mirw,
4 + MIN(RowID) marw
FROM @.Stage
GROUP BY CallerName

HAVING (CallerName = 'name1') OR
(CallerName = 'name2')
) q ON q.CallerName = s.CallerName AND s.RowID BETWEEN q.mirw AND q.marw
ORDER BY callername,Calls desc
--
set @.MyAreaCodes =''
--
SELECT top 5 @.MyAreaCodes = @.MyAreaCodes + ISNULL(AreaCode,'') + ',' from @.Stage

--
SELECT CallerNAme,@.MyAreaCodes AS MyAreaCodes from @.stage
Group By CallerName

This should do it

DECLARE @.Stage TABLE (RowID INT IDENTITY(1, 1), CallerName VARCHAR(256), AreaCode VARCHAR(3), Calls INT, theDate DATETIME,myareacodes int)
declare @.MyAreaCodes varchar(50)
INSERT @.Stage
(
CallerName,
AreaCode,
Calls,
theDate
--myAreacodes
) --This is where the area code data comes from I can get it to display in multiple colums, but -- I want the area codes to be on one line for each name
SELECT CallerName,
SUBSTRING(TargetNum, 2, 3) AS AreaCode,
COUNT(*) AS AreaCodeCount,
DATEADD(day, DATEDIFF(day, 0, GtCalcDate), 0) as myDate
FROM CDRMAIN
WHERE LEN(TargetNum) >= 11
AND TargetNum NOT LIKE '_800%'
AND GtCalcDate >= '2006-11-06'
AND GtCalcDate < '2006-11-17'
GROUP BY CallerName,
SUBSTRING(TargetNum, 2, 3),
DATEADD(day, DATEDIFF(day, 0, GtCalcDate), 0)
ORDER BY CallerName,
COUNT(*) DESC

select CallerName, coalesce(AreaCode1 + ', ' + AreaCode2 + ', ' + AreaCode3 + ', ' + AreaCode4 + ', ' + AreaCode5, AreaCode1 + ', ' + AreaCode2 + ', ' + AreaCode3 + ', ' + AreaCode4, AreaCode1 + ', ' + AreaCode2 + ', ' + AreaCode3, AreaCode1 + ', ' + AreaCode2, AreaCode1)
from (select s0.CallerName, s1.AreaCode AreaCode1, s2.AreaCode AreaCode2, s3.AreaCode AreaCode3, s4.AreaCode AreaCode4, s5.AreaCode AreaCode5
from (select CallerName, min(RowID) as RowID from @.stage group by CallerName) s0
left outer join @.stage s1 on s1.CallerName = s0.CallerName AND s1.RowID = s0.RowID
left outer join @.stage s2 on s2.CallerName = s0.CallerName AND s2.RowID = s0.RowID + 1
left outer join @.stage s3 on s3.CallerName = s0.CallerName AND s3.RowID = s0.RowID + 2
left outer join @.stage s4 on s4.CallerName = s0.CallerName AND s4.RowID = s0.RowID + 3
left outer join @.stage s5 on s5.CallerName = s0.CallerName AND s5.RowID = s0.RowID + 4) Top5Calls