Diaply Header Name in all the pages in SSRS - ssrs-2008

I am working on a report where i gropued the date based on Employee_ID, and my report should fetch the details of the report based on Employee_ID.
Inside my report i have 4 parameters like Employe_name which is drop
down field and multiselect value.
AsoFDate parameter, which is text field. and two more parameters.
i have selected two values from employee_name parameter, for example i selected ram and rahul two employees from employee_name parameter, my report has to fetch the details of ram and rahul based on their Eid.
on page one details of ram, and on page 2 details of rahul. upto here it is working fine fine for me. Now i need to display the names of the employee at top of report.
For example if am fetching the results of ram, my report has to show the deatils of Ram like this
Ram
DepatID Designation salary
1 Programmer 20k
then when i move on to next page, it should fetch rahul details like
Rahul
DepatID Designation salary
1 Programmer 20k
2 programmer 45K
i am able to display the details, but not the employee_names Ram and Rahul at the top of corresponding report.

Yes i sorted out this issue, i placed employee_name parameter inside the table tablix. Now am able to get the desired outcome.

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.

DSUM function in crystal reports?

I am trying to convert an old Microsoft Access report into Crystal reports. I have everything working perfectly except for this last small detail. The Access report uses a DSUM function within an if statement for one of the fields on the report.
After much searching, I've determined that CR doesn't have anything similar.
Here's basically what I'm dealing with.
I have a proposal report. In the details of the report I print the qty, description, and a couple of price fields.
The data looks like something this:
Proposalnum Partitem RolltoItem Unitprice
18611.............1.......... NULL........0.00
18611.............2......... NULL.......17225.92
18611............3............ 2............156.90
18611............4............. 2............482.05
What I need to do is when I print a specific part, I need to query through the rest of the records to find the parts that have a matching number in the rolltoitem field and add the unitprice to the part I'm printing.
So in this example when I print partitem #2, I need to add the 156.90 and the 482.05 from parts 3 and 4 to the 17225.92 so I print a total of 17864.87.
Is there any way to do this?
As far as i know, there is no such function.
But I would try this.
The general idea is: group the data by ProposalNum and use a subreport to select the "children rows" and sum the "children prices".
Details:
Create an empty group section by PartItem.
If you want to show only items where RoolToItem is null, use a suppress function for this case.
In the details section, put a subreport. The data source of the subreport would be the same of the main report.
Change subreport links to select data in subreport based on fields: PartItem in the main report = RolltoItem in the subreport.
Pass other fields to the subreport without select data: ProposalNum, PartItem, UnitPrice. I think you need to create parameters in the subreports before doing that - example: ParentProposalNum, ParentPartItem, ParentUnitPrice.
Create a new formula: ParentUnitPrice + Sum ({YourDataSource.UnitPrice})
Put the formula in the subreport footer a long with the other fields. Maybe: ParentProposalNum, ParentPartItem, formula.
It is a theoretical solution. I hope it points out to the right direction.
If you are trying to sum the Unitprice column for all items that have the same value in Rolltoitem, you could do this with a SQL Expression Field. The code would look something like this. My Where clause may need tweaked though since I'm not sure what your database structure looks like.
(
Select Sum("YourDataBaseTableName"."Unitprice")
From YourDataBaseTableName
Where "YourDataBaseTableName"."Rolltoitem" = *currentRolltoitemValue*
)
Syntax can also vary for SQL Expression Fields based upon what type of database you are using. The syntax I provided is fairly general, but should work on SQL Server.
EDIT: Adding example with explanation of how it works.
Here is one of my SQL Expression Fields from a crystal report that prints a Bill of Lading for shipped goods.
(
Select Sum("SHIPMENTS"."PALLET_COUNT")
From SHIPMENTS
Where "SHIPMENTS"."BOL_ID" = "BOL"."ID"
)
In my database the BOL table is the starting point. A single BOL can contain 1 or more SHIPMENTS, and a single SHIPMENTS can contain one or more PRODUCTS.
Top level grouping is on BOL.ID. The PALLET_COUNT is found once and only once on each SHIPMENTS. I also had a sorting requirement for the data in the details section that prevented me from using a Running Total Field.
This allows a BOL with 2 SHIPMENTS that contains a total of 3 products to look like this:
BOL.ID SHIPMENTS.ID SHIPMENTS.BOL_ID PALLET_COUNT PRODUCT.ID
1 10 1 2 XXX
1 9 1 1 YYY
1 10 1 2 ZZZ
The correct PALLET_COUNT for this BOL should be 3, since PRODUCTS XXX and ZZZ are in the same SHIPMENTS and the PALLET_COUNT is duplicated because of its relationship to the PRODUCTS.

Removing duplicate record text but keeping unique values

In our system, it shows each charge as a record, despite the account being the same.
Crystal reports image
How would I go about doing this?
Also, is there a way to show it like this even though they are all seperate records?
Option 2
You can solve this using sub reports.
In main report take distinct record and place the fields Account and city in detail section.
Now take sub report and place it after the first 2 columns in detail section but take care that you won't select the option distinct records that means you retrieve all records. In sub report place Charge type, charge fields

Crystal Reports: Need to use a summary field as part of the Record Selection Formula

I have a fairly basic report that needs to show events with a total spend of >$200K OR event attendance >60ppl. The attendance portion is no problem, as it's a simple text field in the table. The expense spend is a field that has to be summed before it can be used, coming from a separate table with multiple entries per event. I have no problem doing this in a summary field dropped in the eventID header or even using a subreport and passing a shared variable to the main report. The problem I run into is that I cannot access this summary field in the report record selection to extract the either or records. Any idea how I can do this accurately?
Create a sql-expression field for total spending:
//{%total_spending}
(
SELECT sum(Amount)
FROM Meeting_Expenses
WHERE MeetingId=Meeting.Id
)
Use fields in record-selection formula:
{Meeting.actual_attendance}>60
AND {%total_spending}>200000

How to select a specific record/row of data in Crystal Reports?

I have my sql database Views available to my report, but sometimes they return multiple values, for example I have one that shows me the Total Credits for a range of years.
When I click "Browse Data.." it lets me see what bits of data are available
Eg:
Credits
-------
31
45
460
But I want to select 45 (based on a customer ID)... is it possible to do this?
EDIT: An alternative is if I can link the Customer ID from two views, but only if it's not null (as sometimes there are no records in the Credits)
To avoid the problem of unintentionally "deleting" customers from the report results, first do a left outer join between the CONTRACT_VIEW and the year views, such as TOTAL_2013. In your selection formula, instead of just doing something like {TOTAL_2013.Customer_ID}=MyCustomerID, add all the nulls to it as well, so: isnull({TOTAL_2013.Customer_ID}) or {TOTAL_2013.Customer_ID}=MyCustomerID. This will prevent customers who don't have any entries in the by-year views from being removed completely from the report.