Crosstab two columns under one column header Crystal Report - crystal-reports

I want to create a report like
in crystal report cross tab.
The Table has the following data .
I can get the report with three expected columns like SELF, 50% and 75%.
and their output look like
But my requirement is to use Increases and NPCalculated Columns under Main Column as mentioned in pic 1 above.
Note: I used the NPCalculated in Summarized Fields but It gives me out like NPCalculated Value comes under Increases Value but It should be side by side as per my requirement.

First I add NPCalculated column in Summarized field and now I have two summarized fields. Next, right-click one of the summary cells > Summarized Field lables > Summarize horizontally.

Related

Crystal report Cross-Tab order by another column

I've made a crosstab in crystal report like below:
However, as you can see, the ordering is weirld (i.e. the correct one should be like below:)
And the ordering is stored in another field called order, I took a look in the crystal report's cross-tab expert sorting option, it doesn't allow me to order by another column, it only allows me to sort either ascending or descending, how can I set the ordering by another column?
Crosstab's sorting is based on the rows order, if you want to sort it in your on you have to add some extra rows and have to suppress subtotal and Label in Customize Style of Crosstab Expert
Example:
If you have 3 rows(A,B,C) to display and you have to sort it in order like B,C,A then you have to add 2 new rows(B,C) now your Crosstab looks like (B,C,A,B,C) now you have to suppress Rows B and C you meet your both requirements for sorting and display order
But This solution have some limitations like
if you want to export the report in Excel then it will add extra cells in grand total.
otherwise you are good to go.
Example:
If you have 3 rows(A,B,C) to display and you added one row and you suppress it to solve your sorting issue then in Excel its grand total looks like
A B C
a 1 3
b 2 2
---------------------------
Total: 3 5
Yes, you can not sort on another column. You must use any of one column as a header.
In Crystal report, sorting happened based on header column's value (That's why you see as per alphabetic).
I also face this issue and how I solved, that I am explain. You have to use a formula which have order, but either hide it or use a value like in this link.
https://scn.sap.com/thread/3341846
Second option as per this link. (I think first you check this)
http://www.codeproject.com/Tips/493334/Custom-sorting-for-Crystal-Report-Cross-Tab
https://scn.sap.com/thread/1172741
open crosstab expert, highlight the column that you want to reorder, go to Group Options and select in specified order. This will open another tab where you will have your available values listed there. Using the arrows on the right side you can move up or down your values and accommodate them in the order you want them to be displayed.
Simple way would be take order column from stored procedure to cross tab and set the order according to that column.
Then supress the order column and reduce the width of that column to minimum pixel so that it doesn't appear in cross tab.
Make the field you want to sort by a group field and hide it. To hide it, in the Crosstab Expert > Customize Style dialog select this group then use the Group Options area to Suppress Subtotal and Supress Label. Worked for me.
Use the order field as the grouping column and change the label for said column to show the actual sizes. The labels can be changed in Crosstab Expert, Grouping Options and then the tab Options.

Getting sum of multiple fields in crystal reports

how to calculate {SUM} of multiple columns into a one column in In my Crystal reports.
Total=(VAT+TAX)
ok this how in general it works:
Place your data in detail section and take simmary in report footer, You can take that by right click ojn field and use insert summary option.
Now create a formula #Total
sum(Vat)+sum(tax)+sum(duty) //you can select the summary fields from report fields
Place the formula in report footer

multiple columns crosstab layout

how can I achieve below layout using a crosstab? Month in the top of the columns and columns below with their own names.
thanks
In the Cross-Tab Expert you can create groupings like this by just adding more columns (The outer-most groupings are those higher in the Column list). In your case, the first column of your Cross-Tab should be your record date with the option selected to print for each Month. Then just add the rest of your columns to your Cross-Tab as usual.
I have created the crosstab, added a formula that shows me the month name as column and the other fields as summarized fields. Then on crosstab expert -> Customized Style tab, under columns section I selected my grand totals, checked show labels and Horizontal and was able to get the desired layout. Thanks #Ryan

SSRS Report Group

I want to get a tabular result like below
My query is returning the result like below
Can anyone suggest me a way to do this using SSRS?
I have tried grouping, but couldn't get the expected output. I am new to ssrs reporting. Please provide a detailed solution for this
Set up a Tablix, grouped by Doctor Code, and add a Group Header row based on this group. Display all fields in this row except Product Sampled.
In the Product Sampled Textbox, insert a Tablix directly into the Textbox. Set this Tablix up to show only one detail row, set to display Product Sampled.
What this achieves is that you have one row per Doctor Code, but within each of these group rows you will have a table embedded to display each of the Product Sampled rows. Because the Product Sampled Tablix is embedded in a Group scope, it will display the Product Sampled details for each Doctor Code as required.
Edit after comment:
I will demonstrate with a simplified example. First generate some sample data:
Next, set up a table with a group based on DoctorCode, which will look something like this:
Note we haven't filled in ProductSampled yet.
Next, go to Toolbox and drag a table object into the blank ProductSampled cell. Remove the header and all but one of the columns, then set the column in the table to the ProductSampled field. It should look something like this:
When you run this report with the sample data, it works as required:

Details rows inside tablix SSRS Reporting service, Records with Details rows under it

Now it is a report with a tablix in which the records are like every row has some details rows under it. and the details row can have one or more records based on the main tablix rows
To elucidate the problem, plz have a look
Did some search here and there, but not able to figure out how to accomplish this.
Sub-reports inside the tablix cell, but how will it keep the track of the current row
One thing more : Do I need to create two separate datasets for this and bind accordingly or write query as a single dataset and do some grouping ?
any ideas !
P.S: SSRS r2 environment, native mode reports for web application
You can achieve this with one Dataset and one Tablix.
The Dataset will have all the columns in the report, with multiple rows for each BIL value.
The Tablix will have four rows and one group based on BIL.
The first row will be the Tablix header row, with the main column header details.
The next two rows will be group header rows. The first row will contain the group details, BIL, No Bayar, etc. The second row will contain the detail row header details.
The last row will be the detail row which will contain the COL1 and COL2 detail values.
You will see something like this (you'll need to fill in the TextBox details as appropriate):
create report with subreport will solve your problem
you can create one report with one dataset with (BIL NoB NoW Est TotalXYZ) columns.
Now link that subreport with the BIL
Now link subreport with main report the BIL (FK)
Hope this help