Cross tab report in Crystal Report - crosstab

I am quite new to cross tab type reports in crystal report and I want to show multiple users multiple details.
So that I have columns as username and row containing details of the same.
Like:
User1 User2 User3 User4 User5
Details1: aaa bbb ccc dddd eeee
Details2: 123 345 534 566 87667
Details3: geg dhrth htrhytr ghdf ytryr
But I am unable to get the interface as total, subtotal summary etc fields are quite confusing.
Also I am not interested in grouping my rows on the basis of one field and then showing details in it.

Create a cross tab report and in Row area you put Your details and in column are you put your user, and don't forgot to put the Summarized fields. It works fine. No need to do any coding all the things should manage from your stored procedure.

Related

How can i get 2 or more SSRS tablix reasons to display on the same page including page breaks

im building a report that has multiple tablix in it and i am grouping each one by name. i want to display each table, grouped by the name so that all of the tables for a particular name are on the same page. for example on the first page of the report i should have something like:
name
address
city
bob
123 main st
los angeles
name
hobbies
age
bob
fishing
44
name
net worth
salary
bob
$2,400,000
$78,000
and then the second page of the report should have something like:
name
hobbies
age
felicia
54 gordon ct
atlanta
name
hobbies
age
felicia
yoga
33
name
net worth
salary
felicia
$750,000
$224,000
where the data for each of these tables comes from either one large query or multiple queries(I've tried it both ways). I have tried multiple approaches to solve this but the one that got me the closest was creating 3 separate subreports (each grouped by name and with page breaks) and putting them all in a main report. When i do this the main report does not respect the page breaks in the subreports and instead puts all of the data for each subreport in a clump like this:
name
address
city
bob
123 main st
los angeles
felicia
54 gordon ct
atlanta
I have also tried creating 3 separate tablixes and putting them one after another with page breaks but the tables dont show up on the same page, so i end up with everything on separate pages
I've tried tinkering with group settings and also tried to use rectangles but get the same output. Can this be done in SSRS?
There are a few ways to do this but my preference would be using a single sub report.
Create a report that takes 'name' as a parameter (e.g. pName). Build the report as normal so it handles just the data that relates to the name parameter, so make sure your dataset query only returns data for the 'pName' provided. Include all three tablixes and whatever else you want.
Test the report and then..
Create another report with a dataset that contains just a distinct list of the names you want to report on.
Add a tablix (table of list) to the report and set it's dataset to be the dataset containing the list of distinct names. This will generate one row per name. Inside the first textbox in the tablix, you need to insert a subreport. Go to the subreport properties, select the report you created at the start of this. In the subreport's parameters section set the pName parameter to the name field of the dataset.
Finally, in the rowgroups panel, go to the rowgroup properties (there will probably only a be a details row group- that's OK) and then set the pagebreak property to 'between each instance'
That should do it.

How to build a 'negative list' with crystal report

I just started to use crystal report and struggling about some kind of negative list building.
I am getting two input lists into crystal report and as a result I like to output a list of items, which are not included in both lists.
Example:
List 1 contains Peter, John, Alice, Mary and Tom
List 2 contains Peter and Mary
My result list should show John, Alice and Tom
How can I do this with crystal report?
If by LIST you mean database table, use an Outer Join from A to B and apply a record selection criterion of: IsNull(B.some_column)

Sub report links in crystal reports

I have a report having a command object where I have empno and some columns. And I have another command object which also having empno.
For 1st command the parameter is division and based on division I will get some empnos in 1st commnd object and I need to pass this empnos from 1st command object to 2nd command object.
So that the 2nd command object should get some empnos from 1st command object and should display countries based on the matched empnos .
So I linked both command objects empnos in links tab.
Due to some performance issue I am doing like this
Created a sub report with 2nd command object and created empno parameter. Now in sub reports links tab I am passing main reports empno to sub reports empno parameter.
But I am getting non matching empnos data.
Please suggest
Here what I observed in my 1st table have data like this.
eno name division
1 aaa 2
2 bbb 2
3 ccc 2
In my 2nd table I have data like this
eno country division
1 India 2
2 Aus 2
By using 1st method(linking command objects in links tab).
I am getting result like this.
eno name division country
1 aaa 2 Ind
2 bbb 2 Aus
By using 1st method(Sub report approach).
I am getting result like this.
eno name division country
1 aaa 2 Ind
2 bbb 2 Aus
3 ccc 2
I need to get only employees present in both tables using sub report approach.
Please suggest
Hi Siva i am unable to post the image I am getting data like this.In my 2nd table I have onlt enos 1 and 2 .But I am getting all the emps even I used record selection formula also
**eno name division country
1 aaa 2 Ind
2 bbb 2 Aus
3 ccc 2**
when you use sub report for this purpose then you should not link parameters of main report to sub report instead you should use the linked parameter in Record Selection Formula of sub report then your filtering applies to sub report.
for e.g:
pass the parameter to sub report through links (Take care dont link the parameters) then you will get siomething like this {pm-parameter1}.
then go to record selectoin formula and write as
database field = {pm-parameter1}

Transposing Row Data as Columns in Crystal Reports

I have the following data returned from a stored procedure
Staff Category Amount
----- ------- ------
Bob Art 123
Bob Sport 777
Bob Music 342
Jeff Art 0
Jeff Sport 11
Jeff Music 27
All Categories will always be returned for all Staff even is the Amount is zero
What I want to do on my Crystal Report is output this:-
Staff Art Sport Music
----- --- ----- -----
Bob 123 777 342
Jeff 0 11 27
I effectively want to Transpose the data in the Category rows as headers or columns in my report.
I do not want to use a Cross Tab as I have other things I need to add which will not fit nicely into a Cross Tab
Any thoughts on how I can do this in Crystal? I'm using version 11
Should be able to achive this in your sproc with a PIVOT Table. A helpfile on PIVOT tables can be found here
Group the report by staff and place staff, Art, Sport, Music as text fields in Group header.
now in details section place data as
Staff, formula 1 (If Category='Art' then Amount), formula 2 (If Category='Sport' then Amount), formula 3 (If Category='Music' then Amount)
If Staff has only one value then its ok else place Staff in Group footer and take sum of all values in group footer (Don't remove Formula 1,2,3 from details)

Subreports in Crystal Reports

Is it possible to create a single report in Crystal report showing the 3 lists that get information form only 1 main table?
This is my main table which I pulled out from a database and used full outer joins to AccountNum1 and AccountNum2, leading to the blank values in some rows:
AccountNum1 ActDate SuspDate AccountNum2 EntryDate Charge
12345 01/01/2001 12/12/2012 12345 01/01/2012 1.00
67890 02/02/2002 11/11/2011 67890 02/02/2012 1.00
<Blank> <Blank> <Blank> 23456 03/03/2012 1.00
34567 04/04/2004 12/12/2012 <Blank> <Blank> <Blank>
For the 1st report, I want to display all records with complete entries:
AccountNum ActDate SuspDate EntryDate Charge
12345 01/01/2001 12/12/2012 01/01/2012 1.00
67890 02/02/2002 11/11/2011 02/02/2012 1.00
For the 2nd report, I want to display all records that have entries for AccountNum2, EntryDate, Charge only
AccountNum EntryDate Charge
67890 02/02/2012 1.00
For the 3rd report, I want to display all records that have entries for AccountNum1, ActDate, SuspDate only
AccountNum ActDate SuspDate
34567 04/04/2004 12/12/2012
I need to be able to show the information in a single report and also summarize the count of entries in report1, report2 and report3.
Thanks for all your help.:)
This IS possible in Crystal via a workaround:
Add a formula that defines which section you want the row in, eg SectionNo:
Formula might need changing depending on your logic
If (Not Isnull(AccountNum) and Not Isnull(ActDate) and Not Isnull(SuspDate) and Not isnull(EntryDate) and Not Isnull(Charge) then
1
else if (Not Isnull(ActDate)) then
2
else
3
Now you can add a group by the new formula, this will separate the rows into the three sections.
Next add two new detail sections and setup detaila, detailb and detailc to show the fields you want in sections 1, 2 and 3.
Finally add 3 formulas to the three detail sections suppression formula:
DetailA enter "SectionNo <> 1"
DetailB enter "SectionNo <> 2"
DetailC enter "SectionNo <> 3"
If you need a hand setting it up let me know.
No this is not possible in crystal report, you have to create two sub report for second and third listing.