"The Report is empty" - is bug? - jasper-reports

I've created report with 3 parameters in iReport and it's running successfully. The report is execute MS SQL stor proc with 3 parameters:
startdate;
enddate;
dept_nm (department name);
iReport gives good result. As soon as I exported jrxml file to JasperReports Server 4.1 I have message "The report is empty".
In the Repository under JasperReports Server I've created controls for dates parameters and single list values for dept_nm parameter.
Do you know how to debug and trace this message coming from???

Your query is returning no data. The message appears when the report result is null.
The quickest way to debug this in JasperReports Server is to modify the report's behavior when no data is returned. The default behavior is "No Pages". Change it to "All Sections, No Details". That way you'll get at least the report title and summary band.
Display your parameters in the title band to see what their values are. Often they aren't what you expect. For example, your input control is "StartDate", but your parameters is "startdate". So the parameter doesn't get the value you thought it would.

I get this a lot. E.g if you have sub reports only, it thinks the main report is blank. You have to do something silly like insert a dummy SQL into your report such as "select 1" then populate a hidden part of the report with the result. When it works on in report studio, but gives you the report is empty on the server (with a good data source - other reports working) is when you have real trouble. Not solved those yet.

Maybe you did not connect your report to any Data Source.

Related

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!

Trying to remove exisitng parameters in Crystal Report 10 report by creating new subreport to provide the parameter data

Hello: I am trying to run crystal report 10 report from command line (and I'm new to crystal). The report has two date parameters ?from and ?to. I can query a different database to get the ?from and ?to parameters. So what I'm trying to do is get rid of the external parameters by generating the dates from within the report to replace/populate ?from and ?to.
Can I somehow add a sub-report to query Oracle to get the ?to and ?from dates? This new sub-report would need to run first since the other four reports (3 subs and 1 main report hitting SQL server) all use these date parameters?
Thanks for any help.
To the extent I know, Whether you use sub report of main report if a user needs to enter his own parameters to query the database then you need to create external parameters
Edit------------------------------------------------------------------------------------------------
Since you are trying to get the date input from different database... your approach is correct to create a sub report for this.
Make sure to place the sub report first in order from where you are taking the values.
Either use a shared variable or through parameter linking get the date values to main report and pass the values to remaining sub reports through linking option in sub report links.

JasperReports parameters works in iReport but fails on JasperReports Server (II)

I have a very similar problem to the one described at [JasperReport parameters works in iReport but fails on JasperServer] post.
The report works properly within the iReport environment using Preview option but fails within JasperReports Server
The comments suggest that iReport does not create the InputControl within JR Server. So I verified that the server contained the proper InputControl (that apparently solved their issue).
The input control called sk serial selection :
ID: ic_sk_serial
Name: sk serial selection
Type: Single Select Query
Mandatory: false
Read Only: false
Visible: true
Query resource:
From repository (pointing to *q_sk_serial* see below)
Value and Visible columns:
Value column: id
Visible query columns: serialnr
The input control query called q_sk_serial (populate the inpute control with a list of alphanumeric serial numbers, items are unique):
select id,serialnr from "public"."serials" order by serialnr;
The parameter name:
ic_sk_serial
The report query:
select * from "public"."datas" datas where datas."serialnr" like $P{ic_sk_serial}
In my case, input control seems to work properly in both environments (within iReport preview and JasperServer): I populate a list of items coming from the same database; I see that dropdownlist as expected within iReport but also on with JR Server.
Within iReport, the drop-down list returns the correct selected value in a report parameter which lead to the correct report. In JasperReports Server I only get a "The report is empty" message. So I tend to think the report parameter is not properly passed through within JasperServer.
Hardcoding the "Input control" output value, shows expected report.
Side note: I am using iReport 4.7.1 in compatibility mode with JasperReports Server 4.5.0.
I would be glad to hear if anybody ran into the same problem?
How can I debug further the report execution in JR Server?
Is compatibility mode susceptible to cause that issue?
What about the input parameter type? I use a query that return a string. However my input data type is text (closest match to string). My parameter type is java.lang.string. Does this make sense?
Actually that is a simple bug:
I just found out that:
value column: id
Should be
value column: serialnr
Still, I do not understand why the report was working in preview mode? Such big mistake should fail on preview no?
In anycase thanks to everybody to lead to my mistake ;)
In my point of view, there are two types of parameter within a jasper report including: Report parameter and Dataset Paramter.
Firstly, you must create both parameters and then map the one of Dataset to the one of Report.
I encountered the same problem to you thus that resolved my case.

No data returned in Crystal Reports

I have a Crystal Report I'm working on; last week it was returning results but when I fired it up this morning I was no longer getting anything. Checking the SQL query, I show that the table name is listed twice, for some reason:
SELECT "WMS_TESTINFO"."RECORD_NAME"
FROM "TestEnv"."dbo"."WMS_TESTINFO" "WMS_TESTINFO"
Any thoughts on what could have broken? I've checked that the database is connected and my data is still there.
The table name is listed twice as Crystal Reports creates an alias for every table.
This Crystal generated SQL:
FROM "TestEnv"."dbo"."WMS_TESTINFO" "WMS_TESTINFO"
Is in the format of:
FROM DATABASE.OWNER.TABLENAME ALIAS
This is normal for Crystal.
I would run that SQL in SSMS (remembering to remove all of the " first) to check that the data really is still there.
If it is, check that a filter hasn't been added to the report, via the Select Expert menu opton, to filter out all the data.
Lastly, go to Database > Set Datasource Location and re-apply the connection to ensure that the report is definitely pointing at the right location.

Crystal Reports V11 Showing different boolean values per machine

I'm getting a weird issue with Crystal - I have a basic report that displays records dependant on a boolean value ('open') being true. However, on some PCs it works fine, on others it just shows displays a blank report.
Having done a bit of checking into this, viewing the SQL query seems to indicate that there's an issue with how Crystal is interpreting the boolean value on different machines.
If we select 'Show SQL query' on each of the machines, the ones that don't work show the boolean section as:
`support`.`open`=1
The ones that work show:
`support`.`open`=.T.
...which seems more realistic due to the datasource being a VFP table via an ODBC driver.
I can't quite figure this one out - I suppose it's possible it's something to do with the ODBC driver. Does anybody have any clues as to why this might be happening?
Thanks
The boolean should be directly interpreted through the ODBC... I would change the query to just have
Where 'support.open'
If logical, it will only be .T. / .F. or true / false or 1 / 0... Let the ODBC handler handle it for you.
--- Edit via comment.
I wasn't referring to Crystal's report formula, but the query... But if thats the issue in Crystal, I would change the query that is RETRIEVING the data to be...
IIF( support.open, "YES", "NO " ) as ItemIsOpen
VFP OleDB / ODBC should recognize the IIF() and return the column to a string of "YES" or "NO " respectively... Then use the "ItemIsOpen" column in your report instead of the "support.open" column.