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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Made2Manage / Accessing the Data Environment in a Report 1

Status
Not open for further replies.

klmnop

MIS
May 4, 2006
167
US
I am supporting Made2Manage 5.6 and was asked to modify the balance sheet report, rpfbsh_l.frx . I do not remember how to access the data environment and would very much appreciate assistance.

Working in VFP 9, I opened the original report, then saved as v2, then tried to open and modify the frx copy with:

MODIFY REPORT m:\m2mdata\reports\template\rpfbsh_l_v2.frx

If I right-click the report and choose data environment, the data environment is empty. Note that it is also missing with the original report.

I think I'm looking for csrSheet; an example of an expression is: DisplayVal('POP','GLREPORT.SECTION',csrSheet.fcsection,'60')

(I've tracked down DisplayVal as a user defined function in SQL.)

Thanks in advance!

Karen
 
Karen,
I have absolutely no idea what Made2Manage 5.6 is, googling I noticed this is somekind of ERP software.
I notice you are working with VFP9 and you are asked to modify a report, rpfbsh_l.frx.
Reports in VFP9 are based on a cursor or a table. (DBF) in case of a table you could find that table in the Dataevvironment of the .FRX file, but not ness. In case of a cursor you will not find anything at all in the DE of the .FRX file. The cursor is created by the coding prior to opening a report. So if you want to change something of your rpfbsh_1.frx and it is not data related you dont need the cursor, just change your report. However if it is data related you can change the report but than you should also change the cursor.
Regards,
Koen
 
Judging by the name, I would guess that csrSheet is a cursor rather than a physical table. A cursor is similar to a table, but it is created on the fly and disappears once it is closed. For those reasons, you can't add a cursor to the data environment.

However, that doesn't really matter. Provided the cursor is available when you run the report, everything should be OK. If you are just amending existing reports, you should be fine.

The disadvantage is that you can't use the Expression Builder within the report designer to access the names of the fields in the cursor. When adding a field to a report, you will have to manually type the field name rather than using the Expression Builder to do that for you.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
If you do not have access to the coded part of the project...

I would use the init event of the report to copy the cursor to a freetable somewhere you can find it and see what is there …

Code:
select csrSheet
copy to c:\temp\csrSheet
go top

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
I would be surprised if DisplayVal() was a SQL user defined function - to used as an expression in your report, it probably need to be a VFP visible function

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
That you don't find something visual in the data environment of a report doesn't necessarily point out the report is fed from data previously fetched. The data environment also has a code section. If that's empty and no query code fetches the data, and the report properties Data Environment tab has its "Report uses a private data session" option NOT checked, then the data can be prepared before the run and you only can adapt the layout with all the cursors, fields and expressions there will be and all you have at hand what already is used, you can't deduct what other fields might also be in the cursor(s) yet just not used in the report fields. You can add report variables and calculations done on the fly when the report runs. You may come up with additional data via code or the data environment, even restructure the cursor, but it's unfortunate to do, you don't ever have an overview about the data source and queries making up the report.

And Mike, just like the report doesn't run standalone in such designs, you can't design it with some tools relying on the data being present at design time, but if you have the data preparation code you can let that run and use it during design time, you just MODIFY REPORT instead of DO REPORT FORM and the expression builder will work with whatever cursors you have. What you don't have that simple is drag and drop of the visual table representations to the report canvas.

Bye, Olaf.

Olaf Doschke Software Engineering
 
I really appreciate all the feedback, will look into the suggestions and reply back.

Thanks, Karen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top