I have a report that joins multiple tables. One possibility for this join is that no rows are returned under part of the selections criteria. Sort of.
I have 3 groups: Movie Rental Place, Type of Movie, Rented / Not Rented / No Interest to Rent.
So an example could be:
Blockbuster | Comedy | Rented: List rented movies.
Blockbuster | Comedy | Not Rented: List movies not rented.
Blockbuster | Comedy | No Interest to Rent: List movies not interested in renting.
Now, I do not want to suppress a section if it is empty, I want to print something else in the Details section of CR. Is there a way to do this?
I am using CR 11.5.
Thanks
Go to Section Expert and check the "Suppress blank section" option. Add a new section below it (for the static message) and add a suppress formula to that section that uses some isnull check on whichever column indicates "no data".
Before, when I was attempting to create a custom formula for the Details section, I was testing on NULL values, when the report was setup to give default values for NULL values. Once I removed that, things worked as intended.
Thanks
Related
So, our branches are wanting shipping labels created which I have created a template on Crystal reports.
Our issue is using the NofM function. If the user prints one label it will say 1of1 which is correct. We want it so the counter is determined by the number of prints they require for example:
If the user prints 4 pages it will be 1of4 to 4of4.
Any assistance would be appreciated
In Field Explorer, expand 'Special Fields'.
Use the 'Page N of M' special field.
It sounds like you need a solution to duplicate the printing copies based on a parameter.
Option 1. if the max expected quantity is not too large, you can create multiple sections (Details a, Details b, Details c, ...) and use a dynamic suppress condition to hide the sections beyond the quantity parameter.
Option 2. Create a "REPEATER" table with a single column (How_Many) and rows for 1 | 2 | 3 | 4 | 5 | 6 | ...
Now, in your report, add the REPEATER Table and add a Record Selection condition of
{?QTY} >= {Repeater.How_Many}
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.
I have a report which displays information by group; I'd like to not show any group that doesn't have at least two items in it. Is there an easy way to do this?
Example:
Bob
3/1
4/3
Joe
3/2
3/7
3/9
Mark
5/9
James
John
8/17
9/2
Grouped on name, should not show Mark or James.
If your report is simplistic enough, you can get away with just suppressing the Group Header, Group Footer, and Details sections by using a summary function like count({table.somedate},{table.dudesname}) < 2. Note that the second parameter to a summary function has to be a field being used to group on.
Your mileage may vary with doing it this way. If you are displaying calculated summaries in the report footer, for example, it won't make sense to just suppress these groups as their data will still affect any report-level summary. The other problem you might run into is needing to use a distinct count on some field instead of just a count, depending on your table joins.
You could create a group-selection formula (Report | Selection Formula | Group...):
Count({table.field_to_count}, {table.grouped_field}) < 2
It may be a bit more complicated then that, but here goes.
This report lists overtime on a weekly basis. Each driver has worksheets that outline details of a given shift. The user selects a period of a week, and I have some formulas that fill variables with their hours worked for each day of the week. The lines look something like this:
CKL09844 - LATTA Scott 9.5 8.6 10.5 11 0 hourlysum, etc.
The records are grouped by the 'Driver ID' - the first field - but I'd like to have them listed in alphabetical order. Only the group footers are being displayed currently. Anyone have any advice?
Edit: List them alphabetically by last name, that is.
You can either
Change the group to the 'LastName, FirstName' field or fields instead of driverID or
Use a summary to sort the group. You can do this by inserting a summary like maximum({table.name},{table.driverID}) and placing it in the footer and then suppressing it (It's stupid but Crystal needs this field actually in the report before it will allow you to access the next step). Then, go to "Report -> Group Sort Expert -> For this group sort: All" and select the summary you just made.
I have created a cross tab however if I have a firstname field it merges the rows together if there are two names which are the same. How do you get it to display the names in the each row. In the example below Sarah is not displayed twice as the cells are merged together.
Firstname Lastname
Judy Collins
Sarah Dane
Smith
Joe Dine
Mary Lane
It sounds like you grouped your crosstab on the first name only. I would recommend:
Make a new Formula (Call it "FullName")
In the formula, combine the first name and last name, e.g. something like {First Name}&{Last Name}
Edit your crosstab to group by the FullName formula instead.
Does this help?
EDIT
Based on your comment, I don't think your comment is with Crystal. You need a "unique ID" of some sort, a distinct number for each person. My original suggestion was trying to use the user's full name as a unique ID, but that won't work if your dataset is big enough to include multiple people with the same name. Does your dataset have any kind of unique ID? What is this crosstab trying to display? There might be a better way.