I have created one JasperReports's report in iReport designer. I have added one crosstab to it and added one data source which contains one parameter.
When I run the report the value from prompt is not passed to query and result is not displayed accordingly in crosstab.
I have created same parameter in main report, datasource and crosstab. But its simply not passing to query in datasource.
Question: What is the problem?
Have you mapped the data source to crosstab..
Actually you don't really require datasource for crosstab. You can directly write the query in main report and add parameter in main report itself.
Check that.It works fine for me without datasource.
Related
Using Crystal Reports XI, I have a main report. In this report, I have a Formula Field named XXXCompanyFilter. This is set programmatically at run time and I want to pass it to a subreport.
I add a subreport that has a stored procedure as an input parameter. The parameter is named #co.
A Parameter Field is automatically created in my subreport called #co.
I return to my main report and right-click the subreport and choose Change Subreport Links. I choose the Formula Field XXXCompanyFilter from the Available Fields list and move it to the Field(s) to link to: list.
At this point I expect to be able to choose the subreport's #co parameter in the Subreport parameter field to use: drop down, but it is not there. I have unchecked the Select data in subreport based on field: checkbox.
I've tried selecting the ?Pm-#XXXCompanyFilter option, and that (I think) causes a new subreport parameter to be created:
After that, I do get the new subreport parameter to show in the drop down:
However, this new parameter doesn't seem to do anything, and I'm still prompted to enter the #co subreport parameter whenever I run the report. If I enter a value for the #co parameter the report returns the data I expect.
I've created several subreports to see if the behavior changes. I've tried it with the subreport wizard and with subreports I've created normally. I always get a 2nd, non-useful subreport parameter and the #co parameter is never set, so I am prompted for it.
I feel like if I could select the #co parameter in the drop down list it would work as needed.
I've checked out multiple SO posts, and I've googled the issue but everything I find says I'm doing it right. What am I doing wrong, or what do I need to do to make the #co parameter available in the drop down?
I solved this by specifying a database field in the Available Fields list when creating the subreport link and following the instructions in my original post.
Apparently it just won't work if you specify a Formula Field in the Available Fields list. I can't find any documentation on this but that's the conclusion I come to after reaching a solution by trial and error.
Is it possible to create a subdataset and call it's query only once while using it to fill a table that is located in details band?
I don't want to call the database again for each row in main dataset, instead I want to filter the table with main dataset's field. I have managed to filter it, but in my db logs, I noticed that the query was executed for each row in main dataset. I am using JasperSoft studio 6.3.
I have a simple select sql query with 2 parameters that I want it to be in my query text in main report. It returns about 100 values that I want to put in 10 subreports (10 values per subreport). On main report I need to display only one parameter. All the values from query I need to be in subreports. How do I pass them?
Connection to database is returned to me from application, parameter values also. I'm using iReport 4.7.0.
Parameters are attached to the dataset, if you expand the dataset itself, you'll find a section there for parameters, just like in your main report.
You'll need to link the parameters together though, using the connection properties where you're actually using the dataset, eg, in a chart or a table. For example, in the table, you go to the dataset tab of the properties pane, and click on the parameters button to map the parameters between your main report and your sub dataset.
More here.
Crystal Reports is used to create templates for another application in my case. A value is passed from the other application to a specific table, which I can then, in crystal, use with inner joins to other tables to specify the values on the rest of the report.
This has worked well in situations where I have not being using subreports. In my main report, I have 4 tables inner joined, and they are correctly being passed a certain value from this program.
My problem lies with attempting to create a coverpage for this particular report. I needed a detail section on the coverpage, so I looked to creating a subreport on the report header of the main report. I used the same tables in the subreport itself with the same inner joins. It receives extra values. This is the exact inner join design with the same tables from the main report, yet it is showing different results.
Does anyone have a solution to this? I am particularly new to crystal reports, and have just avoided subreports to avoid deeper complication. I believe I may just be able to pass the criteria value from the main report through a shared variable or parameter as an alternative to my current attempt, but I am not sure how.
Thanks.
It sounds like you are taking the right approach by using a subreport. You did add the parameter to the subreport and linked it through from the main report?
I suggest you view the SQL query for both the main report and subreport to identify the discrepancy.
We are generating reports based on iReports and JasperReports for web application.
Using iReports I found I am struck with big problem.
I want to use two SQL query to fill up my main report...
In query designer I can only write one query..
For another query I cannot use sub-reports...
How do I write second query which will return different fields and include them in my report..
Please guide...
I cannot use sub-reports...
Yes, adding a table to your report is as easy as adding a field. Just drag it from the palette and drop it in the report where you need to have it.
Add a new Table data source. I assume this was done.
Once the data source is configured, you could design your table UI using the wizard.
just click on next or finish to close the wizard.
To add a parameter in data set (if needed), Navigate to your data set using the report inspector. Expand your data set. You would find the parameters menu. Right click to add the new parameter.
Now right click on your table and select edit table data source. Here you will find options to pass parameters to your table from the main report. Passing parameters to your table should be as simple as you do in sub reports. Select the parameter just created from the drop down list box and pass the required value.
In the Data set run Dialog box that appears, please make sure of the data set and the report connection you are using.
You are done configuring the table with this, next you will place the fields in the cells of table for displaying the data.
You are getting your document has no pages since the main report query does not return any rows i guess. For your table to be executed your main report must return at least a row
Hope this helps you.
Good Luck!!
As far as Ireports are concerned, the main report can comprise only one query. And if you wanna use multiple queries in your report, it is possible in the following ways.
Sub Report
Table Dataset.
sub Dataset.
since you don wish to use a sub report, you can go for a Table Dataset. Anything you would do with a sub report is possible with table dataset too(Except for returning variables). You can use sub datasets with charts and graphs. Table set will be of use to you i hope.