incorrect position of the value in crystal report - crystal-reports

I am using crystal reports 11. I have placed a database fields some where in the report designer. But when printing, the value for that field is printed somewhere else. Lock position and size, keep together isnt working. what could be the reason behind this?

Related

Border around blank data in Crystal Reports

I'm currently creating a report in Crystal Reports and each item has a border. The problem is that some of the fields can have a NULL value. When a field has a value of NULL the border doesn't show up, leaving an unsightly gap in the data.
The only solution I was able to come up with is that I create a formula for each column that displays the value if it's not null or displays a blank space when it's not null to trick crystal into thinking there is a value. This would be a major pain and definitely be confusing to anyone trying to modify the report. Is there a better solution to this problem that I might have missed?
Note: I'm unable to modify the SQL.
You can change the report options to give the default value to the null fields. But it may be not desirable for other cases.
If you wanna try it, right click the report and select "report options". Check the options "convert database null values to default" and/or "convert other null values to default".
You can insert a textbox on the report, then place the field inside that textbox. The borders would be placed on the textbox and would always appear regardless of the field value.
A few drawbacks to this,
Formatting cannot be done on the field any more (e.g. if you needed to display 123 as $123.00 you'd need to create a formula to perform the formatting then insert that formula into the textbox)
Export the data to Excel would not respect the data type - any numbers would come over formatted as text (though displayed exactly as you formatted them on the report) with that little green arrow in the cell
I found that method from https://archive.sap.com/discussions/message/9923668#9923668

Crystal report - Null fields not shown

I have, problem with and empty field as they disappear from reports.
I'm able to see only fields with data in them.
if isnull ({orddet_user.orddetlookup2})
then "No Reason"
else {orddetlookup2.descr}
It returns on report {orddetlookup2.descr} but all blank fields doesn't show up,
Maybe someone has faced this before.
I'm using crystal 2008

Hide Empty Subreport in SSRS2008 R2

I have added a subreport to my report. The aim is simply to hide the subreport if there is no data in it.
NoRows property was mentioned on this thread on Microsoft forums, but I guess it is for SSRS 2005 as the thread as quite old.
Isn't there any obvious way to hide subreport if there is no data in it? I could hide the tablix in the subreport itself, but I also need to hide the row where subreport placed. To do this I need an indication whether the subreport has data or not in the main report.
Could you give a clue to sort this out?
I had a similar problem a year ago or so. My vague recollection of this:
The default behavior as I recall was that SSRS won't show the subreport if the datasets in the subreport return no rows. This accomplishes half of what you want, but doesn't let the parent report know whether to hide the subreport area or not. IIRC, the NoRows property only controls what will be shown in this case, but it's not easily checked at run-time to change other properties.
My final solution was to create a stripped down query in the parent report that would indicate whether or not the sub report would have any rows. I used this to control row and subreport visibility.
I suspect there's a more elegant answer...
I placed the subreport in a row of its own. Then I edited the rdl file in a text editor and set the row height to 0 (The designer will not let you do this).
With the row height at 0, the row is practically hidden, until the subreport gets data, at which point, the subreport determines the row height, and it all looks normal again.
An alternative to editing the rdl may be to set the height of the row in code, I haven't looked into that though.
I ran into this issue and none of the answers worked for me. In my case I was converting a Crystal Report to an SSRS report and was using a sub-report that could occur for every group. This was fairly simple in Crystal Reports because you could suppress empty sections with a checkbox.
What worked for me in SSRS and was very clean was to add a subquery/CTE to my main report query that got a count of the number of rows that would be present in the sub-report data. For example:
SELECT CommonCriteria, Count(*) [RowCount]
FROM TableUsedInSubReport
GROUP BY CommonCriteria
Then just join this subquery/CTE to your main query on the common criteria. Once you have this it is very simple as you just right click on the far left of the row in the tablix and select Row Visbility. Then you use an expression such as...
=IIF(Sum(Fields!RowCount.Value) > 0, false, true)
That way if there are any rows to display in the sub report it will display them and if there are no rows in the sub report it will hide it and not leave white space.
i ended up using rectangle underneath the subreport - that way if subreport returns nothing, rectangle underneath it will control appearance of the cell - in my case I needed to grey out the cell if subreport returns nothing.
This thread gave me an idea How to supress empty subreports in SSRS 2008 but I did not even have to use expressions because by default SSRS won't render subreport if it returns nothing.
The more easy solution is:
Sanjay Kumar Rajarao responded on 16 Oct 2013 12:15 AM Access sub report properties - visibility - show based on expression. Enter this
code:
=IIF(RowNumber(Nothing)>0,False,True)
https://community.dynamics.com/gp/f/32/t/114129
AnarchistGeek
Hello,
I had just run into this issue myself. The ugly error along the lines of "Error: Subreport could not be shown" was really annoying me.
Solution:
To solve this, I simply nested the subreport within a rectangle and used an expression on the visibility for that rectangle like so.
ex.
=IIF(Fields!Field1.Value IS NOTHING,true,false)
(Field1 in my case was a returned data column from the parent report.)
Make your changes accordingly :)

Crystal Reports 2008: field shows as blank even when data is returned from the database?

Issue
I have a report in CR 2008 that I inherited from someone else
A sub-report in the report pulls its data from a database view
A field exists, "TRANSCBFLAG" in the view -- it's a string with values of "Y", "N", or "D"
The view has these values
The report displays every other value, but not this one field.
Attempted Resolutions
Suppression attribute? -- No, it's unchecked
Field type issue? -- No, it's a string
Font and background? -- No, it's black font / white background
Suppression / formatting formulas? -- no formulas on display or suppression in subreports or report
Space constraints? -- stretched the field out below all other fields -- still shows as blank
Check to make sure Crystal can see the data -- right-clicked field, select "Browse Field Data", and it came back with the three potential values. So, it can see them in the DB at least, and potentially even in the fields itself.
Just a local Crystal Issue? -- No; I uploaded the report to Business Objects XI for a test and all fields still display except that one.
Question
Where in the process could I be going wrong? It shows when I run the view directly from the database, and every other field shows perfectly in Crystal the first time.
I would assume you did 'Verify Database' but if not that's the first thing I would have tried.
And just a piece of advice... always, always, always run your reports off of a command you write yourself instead of using Crystal's GUI to let you select tables/views/procs. This allows you to make pretty much any kind of change to the query you want and even completely change the source from where your data is coming without wiping all your report controls away. If the modified query has the same field names it will always work seemlessly and if not it will give you a chance to redirect which fields are supposed to come from where. Otherwise... you will have to recreate everything as you just experienced.
There may be a more correct answer, but in a pinch, removing the view from my report (thus removing all fields), adding the view again, and redoing all fields caused the field to display correctly. Not sure how or why.
A further explanation would be appreciated, but for now, that's all I've got.
I had the same issue on a new report I'd created and finally found that the issue was in one of the parameters I used in my command SQL - it had double }} at the end. Eliminating one of the }s allowed the query to return data.
That said, go over the SQL in your database expert with a fine toothed comb, and you'll likely find the issue!

a SSRS 2008 problem:How to off freeze pane

I have a SSRS 2008 Report and whenever exported to excel by default it's top rows become freeze.I don't want so.how can i?
The renderer will always freeze whatever rows it produced from the Header of your SSRS report. I don't think you can avoid the freezing unless you remove the Header section of your report.
There is, after doing some research, a Device Information flag for SimplePageHeaders, which
Indicates whether the page header of the report is rendered to the Excel page header. A value of false indicates that the page header is rendered to the first row of the worksheet. The default value is false.
Maybe you can use that to prevent the report header from showing up in the Excel document at all. There is another SO post that sort of describes how to reconfigure the Excel renderer on the server (or create a custom one) that will omit the header using the SimplePageHeaders device information flag for Excel.