About using supress blank field in crystal report - crystal-reports

I am developing software with c# and I create crystal report that get data from datagridview and show it
the problem is that I have three field in datatable but when field is empty it lefts empty space. I want to fit the field to other when empty, like this:
and when show up in report like this
I want to supress the blank field and my report designer
thank you so much for reading and answering ..
this is how look my report designer .
and i have two diffrent type of report look like this
and the other .

Put you ExParameter into separate section (you can have multiple sections from same logical part of report) and use suppress condition for entire section (or just check 'suppress blank section' in section expert).
In addition, you should group by Analyse and put Analyse value into group header - this way you won't duplicate this part of report either.

Right click on this field, click on Format Field, click on Common tab and then Check the Suppress If Duplicate

Related

How to suppress Details section based on value in database field

I am trying to make a report suppression of Detail B segment based on a value from a database field.
I tried to set the variable and suppress based on value of variable but it only shows for one Detail B. Maybe increment of value is not working?
Current state:
https://imgur.com/a/5bkAFle
Expected output will be that if database field will be 6 that section Detail b will appear six times in report.
Expected state:
https://imgur.com/a/fozburX
I am totally new in Crystal Reports so I prefer a simple solution.
Thank you very much.
Right click on Section and go to Section Expert and write the suppress formula by clicking the button on right side of Suppress option.

Crystal Subreport Common Headers

Maybe someone can Help me find the right technique.
I have a number of Crystal Reports that I am updating (Crystal Reports XI).
These reports each have an SQL Function associated with each that either retrieves records from the database (if any meet criteria) or returns an Empty Dataset (which happens daily).
These are executed in a batch process and directs the output to a PDF file which is emailed to users.
I am relatively new to Crystal Reports.
I am attempting to use a common SubReport to format/gather data for the Headers/Footers used in these documents. So far - most of this is working as I would expect. This allows me to use a single SubReport to generate the same Header/Footer in multiple reports (at least that's my goal).
However - I added a Report Footer section to the Main Report - my plan with this was to generate a Report Footer that would contain the following information:
A static Text Message that reads " --- END OF DOCUMENT ---"
The Report Title of the "Main Report"
The Date and Time that the Document was generated and Total Number of pages.
Sounds pretty simple.
So SubReport is named: "END-OF-DOCUMENT-SUBREPORT"
I used the "Special Fields" Data Date, Data Time, & Page N of M
Since the "Special Field" Report Title is returning me the "END-OF-DOCUMENT-SUBREPORT" value I used a Parameter field to pass the Report Title value from the Main Report to the SubReport.
This all works fine - HOWEVER - with the addition of the Linked Parameter Field from the Main to the SubReport - when I execute the report to generate the document - the SubReport ends up showing a blank Report Footer - that I can click on to reveal the "END-OF-DOCUMENT-SUBREPORT" in another Tab.
Without the Parameter field - it didn't do this and the information from the SubReport appeared on the last page of the document.
Is this a standard behavior of Crystal?
I'm not sure how to Suppress the "Drill Down" feature and still display the Report Section.
You can pass variable between you Main Report and sub Report. You can also create variable and assigned them to a sub report. As aMazing mention, creating Header and Report Footer sub report is not common. It is even messy. If you want something generic, I will create a report template that you will use in the future.
Have a good day!

All fields are not showing for Group and Sort Section

I have a report created in Crystal Report 7.
I have modified a view on which the report depends.
When I clicked Verify Database new fields are added in Field's list.
After modification of View now I need to change the Grouping Order of report. When I searched in Fields Explorer there were all the fields present, but in Group Box those fields are not coming. Am I missing something, please help.
Also In Visual Linking Expert tab Browse Field is disable and for rest are enable.
I have never worked with CR 7 but I suspect a field type/size/characteristics issue. Can you put these 'missing' fields in your detail section and have a look at the displayed values? If these look normal, what I would try are the following:
convert the missing fields into 'smaller' ones, by setting them in
the query the following way, just to check if the problem is linked to a field size
issue or something like that.
CONVERT(varchar(10), returnReason) as returnReason
Another try would be to create the grouping fields in the report, adding corresponding Formula Fields like
groupReturnreason = left(returnReason, 10)
No guarantee of course, just a trial.

How to show different icons in Crystal reports depending on the field value?

We are using Crystal Report 12 in one of our projects. Currently I need to create report template which should show different icons based on the some field value.
That field contains a number, storing some kind of status and I have several icons corresponding some statuses.
At the moment I can't figure out how to implement such a thing in Crystal Reports designer.
Could someone please help me?
Showing and hiding graphical objects in CR based on a formula is almost exactly like showing and hiding text labels based on certain criteria.
First, you need to add each icon to your report detail section by choosing the Insert menu, and then select Picture...
Once all your icons are inserted, you will need to edit the suppression formula by right-clicking on each icon and choosing Format Graphic. On the first tab of the Format Editor, you have a Suppress option just like you do for other report objects. Click on the formula button next to Suppress to add a suppression formula to the icon describing when it should be shown or hidden.
I was also searching for the similar solution and this helped me. These steps works.
To display a particular picture, based on a column value, right click on picture> Format Graphic> Suppress (do not check)
And write formula, for example
ColorCode= '110'
(Based on column name ColorCode if column value is '110' I am displaying the picture)

Suppress Crystal Reports section if there are no rows in a datatable

I have a section in a Crystal Report that I want to suppress. I need to suppress it if there are 0 rows in a particular table in the dataset I am using. How would I do this? The Record Number special field provided appears to be an internal count of records in the report, and does not relate to the rows in the underlying data table.
I am creating the report from C#, but I cannot suppress the section from the code (it doesn't fit the project structure) - I must be able to do it from the report itself. The table concerned is definitely being passed to the report in the dataset, but it contains 0 rows. There must be a way to establish this inside the report itself.....
Can anyone please point me in the right direction?
In the Crystal Reports designer, view the properties of your section and there should be an option to Suppress, which you can give it a formula to return the appropriate boolean value.
You could then use the Count() function within that formula and (I believe) you can pass the name of your dataset to the Count() function to get the number of rows in that dataset.
I did the same thing on a complex report about 3 months ago but I don't have access to the report any more having changed jobs so I'm sorry I cannot be more specific, but hoepfully this gives you a starting point.
Just had a quick Google - try this.
If the section does only contain database fields and f.e. no text fields, then you could use the setting "Suppress Blank Section" in the "Section Export" (rightclick section) for that section.
As an alternative you could use the following formula in the "Suppress" in the "Section Export" for that section:
IsNull({table.field})
"{table.field}" is one of the fields in the dataset.
Hope this helps.
Go to "Section Expert" and click "Supress (No Drill-Down)" and try adding this:
IF {"DragYourFieldHere"} = "" then true else false
Create one dummy group,check on its header for each page,add the header in the group header of the dummy group.