iReport presenting data horizontally back - jasper-reports

Using iReports, is there a way to display the data where it's going back and forth and pulling the data from one SQL statement?
Where an SQL query returned the following records
a0
a1
a2
a3
a4
a5
The report would be filled as follows ...
a0 a1
a2 a3
a4 a5
Normally I wouldn't have a problem doing a table, but I have to replicate someone's "application."

Yes, iReports allows you to fill your report so that the data is presented horizontally as you require in your question.
You can also specify how many columns you present in your report.
In the Report Inspector, right click on the report and select
Properties
In the Properties Dialog,
Click on the number beside Columns, enter 2.
Click on Print Order, select Horizontal
Click on Close
Press CTRL ALT PgDn to preview your report

Related

Scale header AND text in MS Word

In MS Word i have a big table to put in my document. The standard header made by the society is on A4 format. Since my table is quite big i want to put it on A3 page and I modify the header manually to adapt to the A3 format. To do this, I go to Insert > Header > Modify, then with the ruler i adapt the size of the header to A3 page. However, the text doesn't adapt to the modification of the header that I made. When I want to use the pre-processed style to insert title and subtitles, it seems it was design only for the A4 format. Is it possible to adjust the style format to my A3 page ?

How to rearrange mail merge documents in ms-word?

Requirement:
I have an excel file, which connects to Mail merge in word, which I already did.
Suppose there seems to be total 500 records in that excel, and have a field serial number, which seems to be unique from 1 to 500. I need to list the details of the 1st record in top of the 1st A4 page and 251st record in bottom of the 1st A4 page, and 2nd record in top of the 2nd A4 page and 252nd record in bottom of the 2nd A4 page and so on.. and in 250th page, 250th record in top and 500th record in bottom of that page..
My Requirement is, when I cut this A4 size to 2 parts, the page needs to be sort in the serial number order. Hope you understand my requirement.
Thank you in advance..

Crystal Reports: How to pass parameter values between subreports?

I've been working on a report that makes use of three subreports (A,B and C). The idea here is to locate the subreports side by side, where each one has its own list, but also this:
-A is located on the left (with columns c1, c2 and c3 where c1 is like customerID)
-B is located right after A and has columns (c1, c4 and c6) which should present data corresponding to the records of A according to the same value of c1 (customerID)
-C is located right after B, has the columns (c1, c7 and c8) and the same applies to it as in B.
I want it to look like one single table where c1 should only be visible once.
I also know there is the linking option but it doesn't seem to be working. If that's what you're gonna say, how can I configure the links? If not, how can I do this?
And no, there is no way this could be done in one single report.
To the extent I understand you want to pass the c1 value across 3 subreports. In this case link the subreports to main reports and pass the c1 value to the report selection formula of the sub reports so that all reports retrive only c1 value
Now in sub reports B and C .. don't keep C1 column just keep c1 column in sub report A.
But let me know any specific reason to use sub reports instead you can place coulms from c1 to 17 side by side in a main report

Hold column group together in crosstab

I created a report in iReport with a crosstab containing 2 ColumnGroups.
If the crosstab contains more columns than fitting on the page, they are (correctly) continued on the next page. But how can I prevent JR from splitting inside a column group (so if the next column group doesn´t fit on the page, start it on the next page).
Example of colGroups i my crosstab:
Category 1 Category 2 Category 3
C1 C2 C3 C1 C2 C3 C1
Category 3
C2 C3
hope this will useful; inside jasper report on crosstab option there's a checkbox called "keeptogether"; this chekbox keep table on the same page without splitting it

Dynamic parameter not pulling list of values out of field

I have two kinds of parameters in a specific Crystal Report I am making -- two dates that I use directly in the SQL query, and a parameter that will filter the report based on sales reps within the query.
I defined the two dates (date1 and date2, if you will) when I created the command, and those work fine. However, when adding the dynamic parameter to choose which values I want for the 'sales rep' field, only a text box appears, meaning the parameter list hasn't been generated dynamically like advertised.
I know the reason for this -- the query hasn't run yet, so there aren't any dynamic values to pull. The date range is a necessary evil as well, since the report takes five minutes to run if a date range isn't set due to so many older records (which need to stick around do to history purposes).
Is it possible to generate this list dynamically at all, or am I stuck having to update a list with static values?
Thanks.
To get the dynamic parameter to work, you'll have to add whatever table to the report that contains the 'sales rep' field. You can pull the table in next to the SQL Command that you're creating, and just link them however you want with an outer join so as not to limit your records (You could even not link them at all, but Crystal will complain about having "Multiple starting points" or whatever.
Now you can pull the sales reps into the dynamic parameter and use it in either the SQL Command itself as a parameter, or you can just use it in the record selection formula to filter results from the SQL Command. In both cases, CR will query the database twice; the first time to simply get the entire list of reps and the second time to run the SQL Command.
The main takeaway here is that the table, not a command, needs to be in the report in order to be a candidate to populate dynamic parameters... even if you won't use that table again in the report. Hopefully that helps, even if it is 7 months late.
Finally figured this out:
Using SQL create the stored procedure that gathers your report data. This stored procedure CAN NOT have parameters. It must generate all your report data upon execution
Example 1: Exec MyReportStoredProcedure
Create another stored procedure to gather your parameter list values. Again no parameters used in the stored procedure.
Example 2: Exec MyCrystalParameterList
In Crystal Reports under Database -> Database Expert add both stored procedures (Called tables) to the "Selected Tables" section. Click "OK". Crystal will then try to make links between the two tables. Click "Remove All Links". Click "OK" on all link warnings that follow.
Now build your report using the columns from MyReportStoredProcedure
Run you report. You will NOT get prompts to enter parameters. All possible data will be displayed in the report.
* Now time to link the parameter to the data. *
Crystal reports will execute both stored procedures as soon as you open the report.
Crystal reports does not pull data based on the parameter like reporting services (SSRS).
Crystal filters the data based on the parameter value you selected after all data is gathered.
Running MyReportStoredProcedure returns the following:
1 Stop XX 7A [columns5] [columns6] [columns7] [columns8]
1 Gone CC 88 [columns5] [columns6] [columns7] [columns8]
1 Gone CC 88 [columns5] [columns6] [columns7] [columns8]
2 Nice XX C3 [columns5] [columns6] [columns7] [columns8]
3 Loop EE C3 [columns5] [columns6] [columns7] [columns8]
3 Loop DD C3 [columns5] [columns6] [columns7] [columns8]
3 Loop DD C3 [columns5] [columns6] [columns7] [columns8]
...
... 700,000,000 Additional records
...
Running MyCrystalParameterList returns the following:
1 Stop XX 7A
1 Gone CC 88
2 Nice XX C3
3 Loop EE C3
3 Loop DD C3
>> A distinct list of values only 5 rows <<
* Link the parameter data column to the corresponding report column *
Now link the parameter Column1 to the report column1. This link ties the main report values (MyReportStoredProcedure) to the parameter values (MyCrystalParameterList).
In Crystal Reports under Database -> Database Expert Click the tab called Links.
In this section you link the tables/columns together. You could have done this in the steps above but for better understanding I want you to do it here after showing the data returned for both stored procedures (tables).
* Create your cascading parameter *
In Crystal Reports find the Field Explorer panel. Usually its on the right side of the screen.
Now Right click [Parameter Fields] and select [New]
Name the parameter
leave the type as [String]
set "List of Values" to [Dynamic]
set "Choose a Data Source" radial button to [New]
In the table below the radial button, click in the first row under the word "Value"
A drop down showing both tables will be displayed ([MyReportStoredProcedure and MyCrystalParameterList])
Select the columns for your first parameter from your MyCrystalParameterList stored procedure (table).
Your column is now listed in the first row.
Now click the next row and select your next column from your parameter stored procedure (table).
repeat until all of your desired parameters are displayed in the table rows.
On the right side of this table you will see a column called "Parameters" there is text in this column for each row.
Click each field in the "Parameters" column and a parameter is created in Crystal report that corresponds to your parameter stored procedure (table) column.
Click "Okay" to close the "Create New Parameter" dialog box.
If you run your report, you will be prompted to select values for your parameters and the parameters will list available values.
ALL OF THE DATA WILL BE RETURNED IN THE REPORT!!! We are not done.
* Last step (Finally!) *
Tell Crystal reports to filter the report data based on the parameter value.
In crystal reports, click on Report -> Select Expert -> Record
A "Chose field" dialog box will display
Fields panel Look for the report stored procedure and expand it so the columns are showing
Select one of the columns that linked to the parameter stored procedure (table).
You will now see a formula dialog box with a default value of "is any value".
change this value to "is equal to"
A drop down box will appear to the right.
The drop down box will show your parameters!!!!!!
Select the parameter that corresponds to the report field you select.
repeat for all of your parameters.
Now run your report. The data is now filer by your parameter value!!
You are done!!!! Thank GOD!
Note:
You can make a single stored procedure for each parameter. Just add them to the report using Database Expert.
In my example I made one stored procedure that pulls all possible parameter combinations.
DO NOT ADJUST YOUR REGISTREY SETTING AND MAKE CRYSTAL REPORTS READ MORE THAN 1000 RECORDS!!!
Your report stored procedure can return 1 Billion records but your list of parameters should not be more than 1000 unique values.
You cannot build your parameter list from the report stored procedure because crystal reports will only look at the first 1000 records.
Your parameter list must be a separate stored procedure that pull distinct values.
* You have the foundation, Now build the rest. Good luck. *