change group height dynamically - crystal-reports

I have a report with multiple groups. sometimes in some groups all field's value will be null.
in that situation, I wanna this group's height become less to fit.
What can I do?

You've got a few options.. but it maybe just be simpler to remove the null records from the dataset using the 'selection expert' or amending your data source/command, SQL?
Alternatively you can look at the 'Format Editor' using formulas to 'Suppress' individual fields and in the 'Section Expert' tick 'Suppress blank sections' for the details, headers and footers.
Would that solve your problem?

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.

Crystal Report suppress a whole row in details section

I am using crystal report in my vb.net program. Because of my database design I get some rows duplicated as in the following picture:
As you can see from the picture, the first record has two printer models that have the same ink group. and the next model is the only model that has that particular ink group. As I have mentioned before This is because the way I designed the database and its not the problem. I know how to suppress a single column.
When I select a column and check "suppress if duplicate", the following results show:
The row is suppressed but also has taken a place in the report details.
My question now is how to suppress a whole duplicated row?
thank you
As you are aware that your database design is producing these type of results, one option would be check the option Select Distinct Records so that only distinct records are displayed.
One more option.. This is not a tested one change as you required, This is just an idea
write a condition in supress of the section where you placed your data.
if ID=next(ID)
then true
else false
This condition will make sure that if next row is duplicated then it will be supressed
there is many Options , Easy one Is,
you can use Grouping in Crystal report , in your Example u can Group on ID then Suppress Group Detail and Group Footer Problem Solve Have Fun with Coding

"Stretch With OverFlow" option overlaps another text field

I have set the "Stretch With Overflow" option True to some text fields (Denomination, From, To, Stock, Amount). There is one text field which is placed below these text fields ($F{grandTotal}). The below situation occur when I generate the report.
Can anyone please suggest what should I do to avoid this circumstance?
And this is the scenario of my report design.
I have found the answer to this problem. Here is what I've done-
Right click on report name and select Add Report Group
Select a group name and click next.
Check Add Group Footer option.
Then place the $F{grandTotal} in the group footer and Voala! it's done.
Here is what happens: The group is added with respect to the detail band. So, my $F{grandTotal} field is placed perfectly after the detail band column values are generated.
Thanks...
Move grandTotal to summary or ColumnFooter Band. In this use case I would suggest using a variable that aggregates "total" field so You don't need grandTotal field, unless grandTotal aggregates values not shown on report...

crystal report - repeat group header across multiple column

I have a report that has 3 columns and it is grouped by a value that i display in the group header. The report is setup to run down then across.
If the details span across multiple columns, how do I repeat that group header on the next column.
I have already checked "repeat group header on each page" in the group expert.
I have already checked "format groups with multiple column" in the Layout tab of the details section.
It will not let me insert a text object in the group header of each column.
Not sure how to do this. I could write a formula to only show at the top of each column, but not sure if there is a function to find out when the second column has started.
edit
What i want is below
Group Header Text Group Header Text Group Header Text
Detail Values Detail Values Detail Values
Detail Values Detail Values Detail Values
I would like to have the Group Header Text show at the top of each column. Doesn't matter if its the start of a new group or in the middle of the group.
thanks.
okay, I have your solution, the field, that you are grouping by , just place it on to the page header and it will repeat itself on every page until the columns of that group are finished.
Lets say you are grouping by Employee Names, just put the Employee Name field on to the page header and it should solve the issue, I jsut tried it and it worked, thanks.
There is Previous() function available in formulas that allows to show-hide a Text Object based on the change of specific field value from previous to current record.
Is this what are you looking for? Can you edit you question drawing a sample af what you have and what you want?

Enable grow of cross tab in crystal report

I am using a Cross-Tab object in crystal report. I am having problem making my data column (Field Row) to increase dynamically in height when my data size increases. Since the "Can Grow" property in the Format Editor is disabled, it would not let me set the "Can Grow" to true to enable this function. How do I enable the "Can Grow" function so I can set it to true?
I ran into a similar problem where my row labels did not wrap.
Sadly, I think the best solution is to increase the height of your "data" row field (probably the bottom row). This does fix the height for ALL rows but it means that text in ALL rows will be able to wrap at the same height.
I was going to post an image but I don't have the rep.
Cross-Tabs, like Charts, are always able to grow. For this reason, the "Can Grow"-related formatting options are disabled. It really wouldn't make sense if they couldn't grow since they are dynamic objects.
If you're not seeing some data/rows you would expect, it is because the data is not there or something related to the data source for the Cross-Tab is configured incorrectly.