crystalreports in vs2005 - crystal-reports

I need to create a crystal report that shows the address label of the employee, By using crystal reports in vs2005 I had created the crystal report and connect to the data source and every thing goes fine and the report generated correctly, it displays like
name
father name
address1 address2 city
state pin.
in the above format the report was generated. a single employee address in a single section
But my client want
name(of first employee) name(second employee)
fathername fathername
address1 address1
address2 address2
city city
state state
pin pin
againg below third employee and fouth employees address label should generate. Can any one help me how to generate report in the fashion.
Thanks in advance.

I had a similar requirement and stumbled across this question. I tried all but none of the suggestions worked. Not sure how you managed to solve it.
Im posting a solution that worked for me. Hope it would help anyone arriving here.
When you add a new report, please select "Use the Report wizard option" and select "Mail Label" option in the "Choose an Expert" tab as below.
In the following pages, choose your appropriate data Source and select "User defined Label"
and specify your height and width.
Play with these options to get the optimal number of employees per page and this should create a report as per your requirement.
Hope that helps.

Right click in the details section, select Section Expert.
Check the tick box "Format with multiple Columns". A new tab should appear after Color.
Using the settings on this tab, can generated columned data.
BASED ON OP COMMENT:
What need to do is:
Add the fields to the report (if planning 2 columns, use only the left half of the report, 3 columns only left third, and so forth).
Right click details and select section expert.
Check Format with Multiple Columns, this should show the Layout tab next to Color tab.
For this example, under Layout tab, Change Printing Direction from Down then across to across then Down. Change Detail size to half of the Report width.

Related

How to repeat table in jasper report based on grouped data from SQL

This is the output from my SQL query
I am trying to create a report in Jasper Studio which will create a separate table for each city.
Right now, what I have created is something that looks like below. It shows all the data with the City listed as St. Louis. What features in Jasper will allow me to do as above?
Finally figured this out.
Create a group band for your report in Jasper. (Right click report Outline-> Create Group)
Next you have two options - create group from a report object or create group from expression. I used the first option and selected City from the list of group objects displayed. Click Next.
Selected the checkbox Add the group header and click finish.
The other change I did was - Previously my headers were under column header, I moved them under the new band group header. Now it works exactly like how I wanted.

How to get a page per register stored in DDBB in jasperreports?

I have a report with the following structure:
PAGE HEADER
DETAIL BAND (12 of those)
SUMMARY BAND
The detail bands show depending on expressions I specified. Also, the content of the detail bands are subReports, one per detail band (don't know if that is relevant or not here).
What I'm trying to achieve is to execute the report without any filter as the ID or any other field of the table. Instead, I want to extract the information of all the registers of one specific table (let's name the table USER).
What I'm expecting to find when I execute the report is something like the following:
PAGE HEADER
detail sections (shown depending on the expressions )
SUMMARY
What I'm getting looks similar to the following:
PAGE HEADER
DETAIL 1 (for user1)
DETAIL 2 (for user1)
DETAIL 1 (for user2)
DETAIL 4 (for user3)
and never the summary band (just at the end of the report)
As you can see, all the users are getting mixed while what I want to do is to start a new page for each one of them.
QUESTIONS:
How can I get the report to show each one of the users from the table
in separate pages?
Is there some property I missed that allows me to
do that?
Thanks!
I think I found a way to solve this challenge. I just made a group (Group1) based on the ID's of the users and put the content of my Page Header inside the Group Header just created. Did the same with the Summary band, put all it contents inside the Group Footer.
Then, selecting the Group Header (or the Group Footer) I checked the Keep Together and the Start New Page checkboxs from the Appearance tab.
Furthermore, for each one of the detail bands, selected the Group1 just created for the Group Changes selection combo in the Appearance tab.
I didn't do much testing yet but it seems like it's working as I wanted it to. If I find any other (better) solution I'll update the answer. Still open to hear advices though.

"Stretch With OverFlow" option overlaps another text field

I have set the "Stretch With Overflow" option True to some text fields (Denomination, From, To, Stock, Amount). There is one text field which is placed below these text fields ($F{grandTotal}). The below situation occur when I generate the report.
Can anyone please suggest what should I do to avoid this circumstance?
And this is the scenario of my report design.
I have found the answer to this problem. Here is what I've done-
Right click on report name and select Add Report Group
Select a group name and click next.
Check Add Group Footer option.
Then place the $F{grandTotal} in the group footer and Voala! it's done.
Here is what happens: The group is added with respect to the detail band. So, my $F{grandTotal} field is placed perfectly after the detail band column values are generated.
Thanks...
Move grandTotal to summary or ColumnFooter Band. In this use case I would suggest using a variable that aggregates "total" field so You don't need grandTotal field, unless grandTotal aggregates values not shown on report...

Crystal Reports: Showing only first record in each group

I searched to get the required answer but not found exactly what iam looking for - please help me.
Please follow the steps i made in crystal report:
Using crystal report command (i created a query to get the required business number)
--> which gets 5 Business numbers
Note: Every business is having many receipt numbers (1st installment receipt, 2nd installment receipts... like that....) - these receipt details are stored in table_receipts.
In table_business - i have all details about business number, customer, product details...
Please understand the links:
table_business - table_customer - table_product - table_receipts
Relationship between tables are:
table_business.Bno=table_receipts.Bno
table_customer.Cno=table_customer.Cno
table_product.Pno=table_product.Pno
After creating the crystal report command; i just drag the required table in crystal report (table_business, table_customer,table_product,table_receipts)
Now i created a group for Business Number "BNo"
I need to display all the required details about that selected Business Number using parameter - its coming fine except receipts.
I mean its showing all receipts (all installment receipts). I need to display only the first receipt only (i.e: receipt number starst with letter "F" )
Hope you understand my requirement - Please help me in this regard.
Expecting your valuable reply.
Regards,
Sensa.
Here is what I tried for the same issue and it worked. It's a 2 step process involving using Running Total Fields and Suppressing in Section Expert.
First step is to create a Running Total Field (Right under Parameter Fields)
Right click on it and click New and name your field i.e. CountFirstOnly
On the left you will see the fields you can perform functions on.
Select the receipts field. Bring that over to field to summarize and select count.
Under Evaluate select For Each Record
Reset on Change of Group and select your grouping, in this case business number and click OK
Drag that field into your report.
Part 2: Section Expert
Bring up the section expert on details and click on the suppress X-2 button
Your formula should be: CountFirstOnly >1
Click OK
Refresh your report
Hopefully this did the trick.
You should be able to do this by creating a forumla for suppressing the field (table_receipts.Rno).
Right-click the {table_receipts.Rno} field and select Format Field...Common tab...Check the 'Suppress' box and then click the X-2 box to the right. When the new window appears paste this:
not ({table_receipts.Rno} startswith "F")
I might have a solution for you.
1)Open the ‘Report’ menu then select ‘Section Expert’
2)Select the ‘Details’ section from the left hand menu
3)Tick the ‘Suppress No Drill-Down’ option and click on the icon to the right of it and in the formula option put
4)RecordNumber > 1
This should suppress the whole ROW/Record and not just the field. I saw your problem from this thread, I needed the exact same solution and this worked.
show only in the first row in crystal reports details section
It sounds as though the simplest way to meet this requirement would be to add a selection condition to the report - something like:
Left({table_receipts.Rno},1) = "F"
This should ensure that only the associated products and customers for the first receipt for each business are reported.

crystal report to print details of employees side by side

I need to create a crystal report that shows the address label of the employee, By using crystal reports in vs2005 I had created the crystal report and connect to the data source and every thing goes fine and the report generated correctly, it displays like
Ashok(1st emp)
Station Road
Hyderabd
.........
Kiran(2nd emp)
Air port road
Mumbai
..........
Ravi (3rd emp)
address1
address2
............
suresh 4th emp)
add1
add2
etc in the linear way only but i want side by side of two employee details like
...............
Ashok(1st employee).................................Kiran(second employee)
Station Road..............................................Air port Road
Hyderabd........................................... .......Mumbai
etc.
Ravi(3rd employee)...................................Suresh(4th employee)
Address1...................................................Address1
Address2..................................................Address2
Thnks in advance
Right click in the details section, select Section Expert.
Check the tick box "Format with multiple Columns". A new tab should appear after Color.
Using the settings on this tab you can generated columned data.
Yesterday I had spent a lot of time time with the sol you provided, but I am unable to see the report in my desired format again all the results are coming one under one, But I want first emp details side second emp details down thrid emp details side of third emp fourth emp details, I am suffering a lot with this problem, All the project was completed, But I was stuck with this small problem on just printing the report. Please Help Me, Regards
Right click in the details section, select Section Expert.
Check the tick box "Format with multiple Columns". A new tab should appear after Color.
Using the settings on this tab you can generated columned data.
BASED ON OP COMMENT:
What you need to do is:
Add the fields to the report (if you are planning 2 columns, use only yhe left half of the report, 3 columns only left third, and so forth).
Right click details and select section expert.
Check Format with Multiple Columns, this should show the Layout tab next to Color tab.
For your example, under Layout tab, Change Printing Direction from Down then across to across then Down. Change Detail size to half of the Report width.
That should be it.