Crystal report shows blank data - crystal-reports

I have crystal report that was working before database upgrade. It is only one report that doesnt work. So I would not think of a driver issue.
I am able to test this report using CRs client tools, design and then preview. The preview does not bring any data. A single parameter is used and I am sure there is data because the data is retrieved if I create a new crystal report and also verified the SQL. (So there is no question about the no data or any missing links -- its a simple view).
This cannot be a driver issue as well, as all other old reports still work.
Have also tried deleting all the field's from the report, then add a single/simple new table and preview, still no data is showing.
Are there any logs inside crystal to investigate ? have tried ODBC.logs doesnt help as doesn't say what happens inside crystal reports after retrieving the data from database.
Thanks.
Zain

I've had this problem multiple times where my report comes up with empty fields. This may not be your cause, but what fixes it for me is to make sure that the dataset/table matches is referred to by the same name everyplace. In the xxxxxxDataset.xsd file, that table that's pictured should be the same name that's used in the function GetData() As System.Data.DataSet in your .NET object that uses the stored procedure to get the data. (You may call your function something other than GetData().) So try changing the ds.Tables(0).Tablename = "xxxxxxxTable" to match what the table in the xsd file is called.

Related

Crystal Reports cannot map to new database server

I have performed this process numerous times with other Reports but this one Report is not working as it should.
Essentially, I am trying to point a report at a new server where the stored procedure is EXACTLY the same as on the previous server. I am using the Verify Database functionality to do this. But when I point at the new server and enter parameters, CR prompts me to re-map the fields. This would be only slightly annoying if the Map Fields window actually displayed the returned columns from the new server.
But, as you can see from the image, even with the 'Match type' unchecked, no columns from the stored procedure display to be mapped. I have clicked on every field in the report but none of them show any columns to map to.
I have also tried changing the Database Location first before trying to verify, but that doesn't make any difference.
Has anybody else seen this? Is there any sort of workaround?
​I found my solution. Kinda dumb, really.
My stored procedure calls another stored procedure. I commented that call out and tried to Verify the Database and it worked.
Apparently Crystal Reports doesn't handle procedures that call other procedures very well when trying to map fields.

Would anyone explain me how to add a data source to a "part" of a Report Book?

I am trying to add a data source to a "part" of a Report Book. Or I should say passing the information to the fields on that "part" of the ReportBook( or why not, the Main Report). I have come to realize that this is not exactly how things were done with MainReport and Subreport(s). This is a new concept of jasper 6.2.0, so is not exactly the old known subreport and traditional way of doing things(or is it? Do not know..., please if you don't main, explain that too, thanks).
I have read a lot of examples out there ( see one here), of how to pass data source through jasper parameters and then, utilize those parameters referenced in , but it does not seem to be the same way when working with "parts" of a Report Book.
I can provide more information, but essentially what I need is to pass that data source to the part, that refer to my other report (or subreport if you will) named Content.jrxml, so the other report can print/render the right information of those fields. This report contains fields and no information is passing to those fields there went I print the Report Book to pdf. those fields are showing as null.
However I am able to pass parameters successfully is just with passing the fields values and the data source in general, which I have a problem
Does anyone have done or deal with this before or knows of a good example/tutorial that could point me to the solution?
Please help me, I don't know what else to do :(
Thanks in advance!
Sorry, it took me a long time to post back. I find a solution after Theodor (Jasper API main author give me some insights) and here is it!
So, for the Jasper Report engine to handle multiple data sources passed to the report, you have to take into account 2 essential things:
First, for every data source that you want to pass to the Report, you will need to create a new instance. Jasper engine consumes each data source iterating over all the elements in it. When it gets to the next page, there won't be any data, fields or information to read from and fill up the fields on that particular page. Therefore, information won't show up (null) or "blank", depending on the report template configuration.
Last, make sure you pass a new JREmptyDataSource() when filling the report and pass the data sources instance as parameters, and later as sub-parameters for each individual page. Like this:
jasperPrint = JasperFillManager.fillReport(jasperReport, jasperParameter,new JREmptyDataSource() );//new JREmptyDataSource()
That way main report, or the wrapping report (the book), does not use any data source of the pages instances (if it does not need it, of course) and each page will get a data source, through the parameters.
Ultimately, on runtime, it the page of the book can consume individually each data source without affecting each other.
Let me know if this makes any sense?
Thanks

How to show data from a sub report which has multiple source

I have a sub report in my main report which has a multiple source, actually 3 stored procedures. All of them have the same parameters and each brings back one row. The problem is that I can not get the data in preview. I also tried to make a PDF, but I am having the same problem, no data. Anyway, I tried also "Browse Data..." option in database fields and I can see the data there, the only place where I can see it.
Does anyone know what could be the issue? Maybe it is something with multiple sources.
Thanks in advance.
I would suggest you to create 3 subreports with one stored procedure each . There will be the same number of calls to the database , but Crystal engine will not try to figure the links between the datasources

Browse Field Data contains value but nothing is shown on the report

I have annoying issue with CR 2011. We are trying to upgrade from very old CR8.5 (DBF files are used as source(s) for the reports) to CR2011 and right now strange issue has appeared.
There are several fields on the report and all of them contain some data (as can be seen in the dbf file itself and/or in Browse Field Data) but few of them are never "shown" on the report. (If I, however, browse the data within the preview in CR2011 designer, I can see the data with no problem.)
This report uses two (non-linked) tables.
If I try to create a blank report, add these two tables & format the report again, I'll get what I expect (i.e. all fields shown on the report). (But this is not a solution as we have hundreds of reports.)
It does not matter if I (re)save report in latest format.
Everything is shown when using CR8.5 (designer or "runtime")
Has anyone experienced similar behavior and/or some tips where to look?
Non-linked tables are "less" supported than before (whole support for dbf files is limited). So the only correct solution is to link non-linked tables together. In my case, as the "free" table was parameter table. I had to simply add "paramid" to both tables (always set to 0) and perform the linking.

Crystal Reports - Failed to open a rowset

What can be done to resolve the exception:
CrystalDecisions.CrystalReports.Engine.InternalException: Failed to open a rowset.
This is a generic error in Crystal Reports whenever the report query fails. There can be a number of causes. If your report was targeted to a specific database and then the database was changed without updated the report, this can cause it. It can also be caused by something in the query itself failing, such as if the report is based on a stored procedure that doesn't exist on the database against which the report is running. Try verifying the database for the report.
As said this is a generic error, and like all such errors it's a very frustrating one. The problem is that VS 2003 has no preview option for crystal reports so it's hard to track down the source of the problem. So best way to solve this is to create a blank project in vs 2005 or later, import the crystal report, and run preview. You will get a more specific error then.
I had the same issue, and received this error message:
One ore more fields could not be found in the result set. Use Verify Database to update the report.
Error in File filename {9FEE6406-1613-409A-B9BD-C5FDA24E3DEE}.rpt:
The rowset column could not be found.
I was using a stored procedure to collect data for the report, and sure enough I was passing an invalid parameter for the SP. Double check the type and value of the parameters if you are using a SP to populate the report data.
Good luck!
I have also gone through same error with report having sub reports. Issue resolved as i switch to each sub report and make it verify again with database/tables/views.
This is caused by some discrepancy in your relations, like opposite left joins or something similar. CR has also the bad habit to create 'default' links each time you modify the list of tables and views needed for the report. It can even sometimes automatically create recursive links that might not be viewable 'at once' in the relations screen.
If you cannot find which relation(s) is causing the trouble (sometimes it is not so obvious), you'll have to make some trial & errors test by adding/removing tables from your report.
Every time you add a new table in crystal it adds its own links on already linked tables, some times it even links the 2 fields from the same table.
Make sure you know your links in order to go through after you add a table and scroll all tables to see for any links create from to the same table
I received :
CrystalDecisions.CrystalReports.Engine.InternalException was unhandled
Message=The Report Application Server failed
Google brought me here. For those that have similar problems.
For the record: I had a byte[] array with an image and removed the log from the report and the error stopped. I now have to figure out what I have done wrong with the logo.
I had this problem - we use SQL logins for our security (not integrated / DSN connections)
By granting execute permissions to the user for my stored procedure I fixed the problem.
Really, really couldn't hate Crystal more for their exception masking - let this be a lesson to all programmers;
Try
'your code here
Catch
Throw new exception("Hey, here's a really friendly but completely useless error message")
End Try
will result in pain for future developers - DON'T DO IT!
When you verify your database it might tell you that it is up to date, in that case you have two more options to check for:
a) Refreshing the report (a lightning-shaped icon), if you have a problem with a field, such as a SQL Field, it will give you the error and then show you the edit window for the field.
b) Running the query directly on SQL, if there is a problem with the query itself you will also get this message in Crystal but SQL will tell you exactly what went wrong.
Check Changing Crystal Report Database logon information at runtime in VS2005 for help.
Important line in it is:
table.Location = Database & ".dbo." & table.Name
For me, the problem was fixed when I logged of and logged back to the SQL server that the report was connecting to
In your store procedure If you are using
SET NOCOUNT ON;
Then just remove this
--SET NOCOUNT ON;
Now verify your report database, build & run your solution.