Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help displaying data on a Visual fox pro report

Status
Not open for further replies.

Luiz Eduh

Technical User
Jan 10, 2012
51
US
Hello,

I'm currently running a report and displaying data from 1 table. The table contains a field that is either transactions = 't' and credits = 'c' I would like to print and separate the sections on the same report. On the top I would like to displays the data where the expression equals transactions = 't' and on the bottom of the report where the expression = 'c'. Can this be done? if so can someone guide me on how I can accomplish this?

Thanks
 
There are many ways to do this, but one obvious would be to sort by that field containing either 't' or 'c' descending and report on that data:

Code:
SELECT * FROM yourtable ORDER BY expression DESCENDING, RECNO() INTO CURSOR crsReport
REPORT FORM yourreport

You likely will want to sort by more than just that one column, eg in a chronological order, put other fields instead of RECNO() for that secondary sorting., RECNO() is just an example working, if physical order is chronological order.

Bye, Olaf.
 
Thanks for your prompt reply Mr Olaf,
Im able to sort the data on the table just fine. Probably I didn't explained my self right. I've attached a sample of how I would like the report to show the data. My question is more base on the design of the report.

Thanks
 
 http://files.engineering.com/getfile.aspx?folder=8f0a9479-547c-4516-9f70-4f25ceb5708f&file=report_sample.jpg
For two sections you'd define two group bands, one for the 't' group, one for the 'c' group.

Bye, Olaf.
 
Hello,

Im not sure how to do this, this is where I need some help if possible.
I've attached the current layout of my report, it works but it display the data in only 1 section, I would like to have it on 2 sections.
 
 http://files.engineering.com/getfile.aspx?folder=a39eb53d-b1e4-499d-98aa-dff647ff1920&file=report_layout.jpg
Looking over the image of your Report Form, I see that you already have a Group for Header1.
But you have no space in the Group Footer to separate the various groups when printed.
That being so, you might not need a 2nd Group or 2nd Detail Band

What it looks like you want is
Group1
Data Line1​
Data Line2​
Data Line3​
Space between Detail bar and Group Footer bar
Group2
Data Line1​
Data Line2​
Data Line3​

If that gets you what you need, then great.
If you should want Group-specific Sub-totals, they too would go into the Group Footer followed by blank space to separate the Groups on print out.

If you need something else, then we need a better explanation.

Good Luck,
JRB-Bldr

 
Well, you have a group by cuscode, now you need another grouping within this grouping by the expression for t vs c records.
Open Report propeties and in Data Grouping use the Add buttin to add another sub grouping.

Bye, Olaf.

 
Hi,

Thanks for the suggestions, unfortunately I can't get it to work, it either prints double lines of the same data or it prints fine but doesn't separate the groups. If is not much to ask, I've uploaded my report, would you please reformat it for me and send it back to me, I'm sure once I see a sample I will get it.

Thanks
 
 http://files.engineering.com/getfile.aspx?folder=ed4e5d28-8bcb-4190-9e72-5e70236f22b4&file=report.zip
it either prints double lines of the same data or it prints fine but doesn't separate the groups

Based on your description above, before blaming the Report Form, you should review how the report's data is prepared and organized.
Have you either Sorted or Indexed the data such that the records are organized like follows and that there are data fields and their values representing each separate Group (cuscode & transactiontype):
Code:
cuscode1 records
[indent]transaction_type1 records[/indent]
[indent]transaction_type2 records[/indent]
cuscode2 records
[indent]transaction_type1 records[/indent]
[indent]transaction_type2 records[/indent]
cuscode3 records
[indent]transaction_type1 records[/indent]
[indent]transaction_type2 records[/indent]
etc.

Once that is confirmed then you can look at your Report Form
On that form, you should have your Groups organized as:
Group on cuscode
Group on transaction_type
Detail
Group on transaction_type Footer
Group on cuscode Footer

Obviously you won't have a field named: transaction_type1 (too many characters). I merely use that as a generic reference.
Instead of that you might have a field named Transaction whose value represents the 'type': "t" or "c" or whatever.

Good Luck,
JRB-Bldr





 
if you have not solved your issue yet, then
1. show sample data
2. show how you need to separate
3. how you index it i mean index expression




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top