Crystal Report Group Issue - c#

I am new to Crystal Report.
I have a data set like this:
DataSet:
Name Type Unit Price
One p1 3 10
Two p2 2 8
Three p1 1 5
In my crystal report I want to group the data by Type and then only list the group data that Type is equal to p1
How could I apply some logic to hide other groups?

I'm not sure how far along you are, so in a nutshell...
Add a group by right-clicking inside any one of the sections:
Select the field you want to "group" by, in this case a field named "fieldName":
Right-click the group section header bar and open the "Section Expert". Check the "Suppress" checkbox, press the formula button next to it, and enter a formula that tells it when to suppress the group, in this case when "fieldName <> "P1".
Right click on the "Details" section and do the same thing (click the same checkbox and enter the same formula). If you have anything in the group footer, do the same there too.

Related

Avoid showing LineNbr totals in Acumatica Report

I'm trying to avoid printing some SO Lines in the Sales order Report of Acumatica (SO641010) to do that I've added a Usr field to the SOLine DAC and DB Table by doing that I was able to stop showing the desired lines by adding the VisibleExpr as =[SOLine.UsrNoPrint] <> True but the totals at the bottom keep summarizing that line to the totals of the report.
Is there a quick way to prevent the addition of that line to the totals of the bottom of the report?
You can put the same condition in the LineNbr variable in the 'Variables' dialog of the Details section. It will increments the LineNbr field on the same condition you use to show the records.
Click on the 'detailSection1' header to select it, or select it from
the properties combo box.
Click on the ellipsis […] button right of 'Variables' in the properties tree view
Change LineNbr formula from =$LineNbr+1 to
=IIf([SOLine.UsrNoPrint] <> True, $LineNbr+1, $LineNbr)

How to make List report item repeat horizontally for RDLC Report?

I am using the List report item to make a report in visual studio with four report items per page. I am able to get the report to repeat vertically, but not horizontally. Is there a setting I am missing or do I need to do something additional?
You can create a horizontal List this way:
Insert a List
Right click on row header and from Row Group item, click Delete Group
Drag one or more fields from Report Data window, to data cell of report.
Right click on column header and from Add Group item in Column Group section click Parent Group....
Enter =RowNumber(Nothing) as expression of group and click OK. (If you have a unique field like Id, you can choose it from dropdown and in such case you don't need to do step 6)
Again, right click on column header and from Column Group item, click Group Properties... and from Sorting tab, select first row in table and click Delete.
More settings on report:
You can also perform this using a Table or Matrix
You can hide first row which shows record number.
You can insert a column to show some row header.
For more information take a look at this blog post about Horizontal Tables in SSRS.

How to display single row against each groupBy rdlc report

I am trying to display aggrgated data in my rdlc report. I have grouped data by a particular field by
Add Group -> Parent Group -> Group By: Field Name
All data shows up as I want against each group. Now I want to display count of records against each particular group. So I added a column to the right on group and added the following expression
=Count(Fields!TestPackNo.Value, "ModuleNo")
This correctly displays count of records against each group but the problem is # of rows that are appearing against each group is repeating. I want only one # (count of TestPack NOs against each Module) to appear. How do i do that?
You would need to add this formula to the total outside of the group.

Adding Details to a MS Report Viewer report without resorting to Subreports/drill down

I've worked with Crystal Rpt and the VB6 Report Designer before and I'm now moving on to Microsoft Report Viewer.
I'm actually trying to achieve something quite simple but I can't seem to find how to do it in a simple manner:
I have an orders list where each line is composed of Order Id, Customer Name and Address.
I am able to list them in Report Viewer.
Next, I want to be able to show a list of items below each order in something line this:
+ORDER 1, Customer A, Cust Address
|-- Product 1 for Order 1
|-- Product 2 for order 1
+ORDER 2, Customer B, Cust Address
|-- Product 1 for Order 2
....
I know I can link this information through subreports but this seems way of an overkill for such a simple scenario.
In the (very) old VB6 Report designer, it was possible to add sub sections to the report and link the Main section with the sub section through a parameter, without having to go through the whole Subreport feature, keeping everything in one single report.
Is there such a way to achieve this in Report Designer/Viewer (i.e. adding sub sections, avoiding the use of Sub reports)?
Thank you
Pedro
You should be able to do this all on 1 report if you use Groups and a sub-tablix.
Create the table with a header row and detail row, and change the default Row Group called "Details" to Orders, and have it Group on your Order Number:
Insert another row "Inside Group - Below" under the Order Num, and merge all of the cells across.
Insert a rectangle into the merged cell, and then insert a Table on top of the rectangle. Add your product fields there. (In image below, everything in the Parent table is grey, and the sub-table is white)
When you run this, since the Product row is inside of the same grouping as the Order row, each time that row is displayed, it will only show the Products that are associated with that Order (assuming your query has them linked correctly).
Hope this helps! Let me know!

SUM of the details in group header Crystal reports

I am generating the crystal report in the ASP.NET/C# Website. I require the groupwise sum in the header of the group, When I add the SUM field (Running Total Field) shows the first entry of the records is there any way to show the total of all records in details in the header of the same group?
Running Totals won't work in a Group Header section because of the way they are evaluated. Instead, you could just use a regular summary function and place it in the Group Header. You can do this by either right-clicking the field to summarize, selecting "Insert", and then "Summary" or by creating a formula:
sum({table.field_to_summarize},{table.field_you_are_grouping_on})
using Subreports and link them and show Sum of that group in subreport.
put your subreport in Group header of main report
Design a Query from DB and Get Sum of Group in desird feilds.
for example :
Select GId,Sum(Salary) as SSalary from Customer group by GID
and create a subreport in your Main Report by Right Click and select Insert and SubReport -> select Previous Step DataSet -> Next you must link Them with Group Ids and in fill report you must fill subreport[0] of your main report by adequate data from his dataset
for detail info refer to Subreports

Categories

Resources