Reputation: 41
I am working on a C# app that will print bills/receipts with a thermal printer. I am using Crystal Reports for generating reports/bills.
I want the report to have 4 fields (Item Name, Quantity, Amount, Discount). There might be a discount sometimes otherwise not. The format of this report should be something like this (For reference also see this)
| Item Name | Qty | Amount$ |
|---------------------------|
| Abc | 1 | 100 |
| You Saved 4$ | |
|---------------------------|
| Def | 1 | 50 |
|---------------------------|
As from the table, there was a discount for Item = Abc, so the discount row (You saved 4$) is there, for the Item=Def there was no discount so the row is not there.
Upvotes: 0
Views: 604
Reputation: 4001
No need for an additional column. Right-click the detail section and select 'Insert Section Below. This should result in Detail a (where you place the normal content) and Detail b section (where you place the discount info.
In the Suppress expression for Detail b have an expression such as:
{Discount} = 0
That would cause that section to be visible only when Discount is not zero.
Upvotes: 3
Reputation: 6683
This may not be the complete answer to your case, but it generally is applicable and give you an idea.
You can conditionally suppress the band. I think you pass the dataset to the report. If so, add a new column to your dataset. for each row, that column should define if the band needs to be suppressed or not. and use that column in your condition for suppressing the band.
Upvotes: 0