how to display fields with header only if they are greater than 0 in crystal reports? - vb.net

I am creating a crystal report from a datatable which has two columns: cash and card. The datatable is populated via an SQL query.
My report shows correctly, but now I want to change it to only show cash or card entries if they have values (not 0). Otherwise, the field should not show with its header.
For example, if cash has a value of 100 and card has no value or is 0, then the report shows only the cash entry with its header. If cash and card both have values then both should be display with their headers.
Right now I see this:
cash 100
card 0
I'd like to see this for the same data:
cash 100
How can I do this?

You can split the detail section yo Detail a and Detail b (right-click, Insert Section Below). Place the card info in Detail b.
Then, set a dynamic Suppress expression for each section to ensure they don't show if their respective amounts are zero (Value = 0).

Related

MS-Access 2021 Adding/Subtracting field entry from one table with the current value in another

I'm new to SQL and Access and am trying to take an entry from an InventoryTransactions.Quantity and summing it with another field from another table MasterInventory.QuantityOnHand. I know there is a way to do this with queries and forms but I'm kind of hitting a roadblock. Any help will be much appreciated!
Example
InventoryTransactions.Quantity (Table)
ID | TransactionItem | TransactionType | Quantity |
[ID] = Autonumber [TransactionItem] = Lookup referencing [.ID],[.ItemName], (Checking Y/N from [.Consumable]), all from [MasterInventory] [TransactionType] - Addition, Removal (Add, Subtract) from [TransactionTypeTable] Quantity - Number
MasterInventory
Here I want to add my record entry for Quantity in the above table and it to be added or subtracted (depending on the entry in the TransactionType field to .QuantityOnHand in this MasterInventory table
Say I've got 20 of something in [MasterInventory].[QuantityOnHand] and I enter 20 into the [ItemTransactions].[Quantity]
Saying that I selected "Addition" in [ItemTransactions].[TransactionType]
The new value in [MasterInventory].[QuantityOnHand] should now be updated to 40 for the corresponding [MasterInventory].[ID] field. (Updated to 0 if I selected "Remove" in [ItemTransactions].[TransactionType]
Let me know if you see this and need clarification please.

Display all product in sale report

in sale report you can choose only products and quantity bought per costumers and export it as an excel file
what i need is a way to show all products even if the quantity is 0
Is that possible ?
Thanks.
you can using the advanced filters in the search bar
chose quantity on hand equal 0 or greater than 0

PowerPivot Pivot Table displays all rows instead of context rows

I'm looking for guidance on what changes need to be made to the model to get this pivot to display the proper rows under their respective jusridictions.
Currently the pivot displays ALL tax detail rows for each jusridiction.
Image 1 was removed due to posting limits.
Image 2 is the pivot after adding in the tax type.
Image 3 is the data model, showing the relation between the invoice data and the tax data. There can be 1 to many tax rows per invoice row.
If this question has been asked and answered before please provide a link. I don't have the time to scan 1000+ posts on PowerPivot to see if they apply. I did go through 150 of them with no joy.

SSRS Lookup on single dataset

Hopefully you can help!
I have a single data source in my SSRS report. With this data source, I have populated a tablix. The tablix looks something like this:
SalesPerson ID Group Sales
Sarah 1 1 1234
Ross 2 1 555
Gemma 3 2 678
Jill 4 2 345
Jack 5 3 987
Peter 6 2 432
Henry 7 2 356
The report is set up to create a different page for each of the sales people. for example, on the first page of the report, only first record would be shown (the record that holds Sarah's information, the second page would show the record for Ross' information ,etc..)
The issues I face is this:
At the bottom of the report, I need to include a textbox that displays the group number that the specific employee belongs to (the employee who is currently being displayed on the page).
I think that I need to do some sort of lookup on the IDReportItem to return the group ID in order to do this, but have had no luck in my attempts.
I understand that this is a horrible way of doing things, but I am limited to using this single dataset for performing this task.
Any help you can provide will be greatly appreciated,
Thanks you!
Unfortunately there doesn't seem to be a way to do this in a single textbox, but you can do it with a second tablix that uses the same dataset.
Create your second tablix and position it at the bottom of the page, then set your grouping to be the same on both tablixes and use the second tablix to only display the group ID, plus whatever label you want.
Create a new row group for each tablix (grouping on group ID), then right click the group and browse to Group Properties -> Page Breaks and check the box that says "Between each instance of a group". Do this for both tablixes.
This is what grouping is designed for. Build your table, and set the page break attribute to true.
You can have multiple rows under your group. Since your group is a field, simply add it to the detail row.
Your grouping is obviously set up right to get the report paging correctly.
You could add a List to the report, set the grouping on that (with page break between groups)
Inside the list - Add a RECTANGLE. (this be important!)
Once you've added the rectangle, you can add another as many objects as you like. In your case I think that may be a matrix and a text box
eg
Then it just becomes as spacing issue (to get the page looking right)

Equivalent of WHERE clause in Crystal Reports

This Crystal Report program was dumped on my lap and I'm brand new to it. I understand the concept, but I'm hitting a wall here.
There is another question that's similar:
Crystal Reports equivalent of 'WHERE'
But it and the answers are directed towards (it seems) "totaling" the column, whereas I want to simply only show the row if one of the columns (in this case, if "CostType" is equal to 0).
I have two data tables I'm reading from to create this report. They're joined via a common column name (ItemKey). Unfortunately, in the second table, there are multiple records of the same item. I only want the item(s) with a CostType of 0.
This is stupidly easy in SQL, even for a beginner like me, but I can't figure out how to effectively say: "only show an item if the CostType is 0" with Crystal Reports.
Item_Cost Table (example):
ItemKey Special Cost CostType
001 TRUE 55.00 0
002 FALSE 10.00 0
003 TRUE 20.00 1
Item Table (example):
ItemKey Description Mode
001 Whatever EE
002 Random AB
003 Unimportant GE
What shows up:
Item Description Mode
Box Whatever EE
Square Random AB
Circle Unimportant GE
What I want to show:
Item Description Mode
Box Whatever EE
Square Random AB
I hope this all makes sense. Basically, if this was a SQL query, I'd just say "WHERE CostType = 0" at the end and I wouldn't get all of the other items that have different cost types.
I should mention that this is entirely handled by Crystal Reports. I'm not using a SQL string and passing it in or something. The function for showing the window is as follows:
Dim PartsDemandReport As CrystalDecisions.CrystalReports.Engine.ReportDocument = New crptIndentedBomXLBom
PartsDemandReport.SetDataSource(GLOBAL_VARIABLES.GlobalBomIndented)
Dim CrystalReportViewerForm As New frmCrystalReportViewer
CrystalReportViewerForm.CrystalReportViewer1.ReportSource = PartsDemandReport
CrystalReportViewerForm.Show()
PartsDemandReport = Nothing
If there's a way to simply force Crystal Reports to add that "WHERE CostType = 0", that'd be great. Thanks in advance.
There are couple of ways to do this:
If you don't need the CostType not equal to 0 in whole report then you can directly give in select expert which acts as where clause for crystal reports.
Example:
go to Report ---> Selection Formula ---> Record this open formula window in that add below line
CostType = 0
This will ensure only cost type = 0 will be retrived from database
2.If you require cost type <> 0 any where in report. Then add below condition for Item, Description and Mode Columns
Example
#Item:
if cost type = 0
then <<Database Item field >>
Place it in detail part of Item column.
In the same way do for other columns as well.