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

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

Related

Crystal report shows blank data

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.

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 two different datasources in Activereport

I have a report file . I have to show the data in this report from two different datatable . I have to show the data from one datatable after another . I don't want to use sub report . Is there another way to solve it?
With Regards
The way to solve this with ActiveReports is with a subreport. Other than using subreports, you could use the "unbound mode" to programmatically combine the records from both datatables into a single rowset. See this walkthrough for an example of using unbound mode (see the DataInitialize and FetchData events for the meat of the matter).
It is difficult to say for sure how best to go about this without more information though. For example, some info that might useful:
Are the data tables in the DataSet?
Are the datatables joinable? In other words, is there a relation between them?
Why don't you want to use subreports? This is truly the way a banded report writer like ActiveReports is meant to handle multiple data sources.
Also, you might check out our Data Dynamics Reports product. It uses a different paradigm than banded reports where you lay out data regions (e.g. table, chart, etc.) on a page. Each data region can be bound to a separate data source without using a subreport. Maybe that would be a better fit for what you need.
Scott Willeke
GrapeCity inc.

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.

Eclipse Birt Reports, Creating report from SQL database, (user key?)

I'm fairly new to using the Birt Report Designer and need to figure out how to generate a report from a SQLite database. I have suceeded in getting it to connect to the DB but am now unsure how to generate a report and the tutorials that I have found aren't of much help so far.
I have a template that was given to me by my employer that has a few fields, I'm wondering if these fieldnames (in the template) are supposed to match field names in the DB.
Also, when I go to Run->View Report-> As PDF I am unsure what I am supposed to enter for the field "User Key", does this correspond to a table name in the DB or something along these lines?
As of now, I have tried entering a table name but just a blank report is generated.
If anyone can point me to a good resource or help with this I would greatly appreciate it. Thanks
There are two books i could really advice:
BIRT - A Field Guide to Reporting
Integrating and Extending BIRT
and the Eclipse Help containing BIRT documentation.
I suppose the User Key could be report parameter (listed in Data Explorer window), which is passed to Data Set to select appropriate data. If I'm guessing right, check within a Data Set editor ("Parameters" tab and "Query" tab) where the User Key parameter goes in - probably to one of the table field in a WHERE clause. Parameters in a query are represented by question marks: SELECT * FROM fooTable WHERE barColumn = ?. Hope tracking this would lead to find out, what to enter to the parameter.
Additionally, ensure if your Data Set(s) is(are) connected correctly to your SQLite Data Source ("Data Source" tab in a Data Set editor).
Being as new as you are to BIRT, I would suggest building a couple of reports with the sample DB (Classic Models). There are many, many samples out there for you to use as a guide. Additionally, most tutorials will use the Classic Models data so you can follow right along. After you create a couple of practice reports (this should not take more than 30-45 minutes) the template you have been given will likely make A LOT more sense and allow you to make progress almost immediately.
If you are looking for a nice collection of tutorials and samples, be sure to check out Birt Exchange for Dev Share (samples) & tutorials.
As for the "User Key" this is almost certainly a report-level parameter used to filter the data set (as the previous answer points out).
Good Luck!