Anomaly


Hello,

I need to create a cursor to store information of two tables. This I can do, but how do I take the information I pulled into the cursor and apply it to a report I am having difficulties coming up with a solution.

Thank you in advance,
Anomaly



Re: Cursors Help

Lightening


......

Select yourCursorName

Report form YourReportFileName nonconsole preview






Re: Cursors Help

Naomi Nosonovsky

Don't use aliases for fields in the report (make sure that all fields just referenced by names and not Table.name). Use default DS for report. Now, as already said, simply do

select myCursor

report form myReport preview

One little caveat for forms with grids - make sure to move focus off the grid before doing it, since grids have a tendency to select their alias and thus you may have problems.






Re: Cursors Help

dni

You may try:

Code Snippet

SELECT ALIAS1.field1,ALIAS2.field1,ALIAS1.field2, ALIAS1.field3 FROM table1 ALIAS1, table2 ALIAS2 ;
[ WHERE ALIAS1.field1 = ALIAS2.filed1 ;]
INTO CURSOR TEST [READWRITE]

you may use cursor test in report.






Re: Cursors Help

Anomaly

Lightening wrote:

......

Select yourCursorName

Report form YourReportFileName nonconsole preview



Ok, but don't I need to have the table in the data environment I am new to reports




Re: Cursors Help

Naomi Nosonovsky

No, don't use DE for reports, use form's DE This is a general advice. I think Alias and DE may be automatically added for Wizard-generated reports, in this case you may need to remove table from report's DE and make sure you're not using Alias in field names.



Re: Cursors Help

Anomaly

Ok, ok, I think I got it. The cursor must be open and it will assume that is what your referring to in the detail band. Is that right




Re: Cursors Help

Naomi Nosonovsky

Yes. Simply have a cursor created in the form/program that calls the report and it would be visible in the report. You can also create the cursor in the command window when you're testing your report.

Don't forget about grid's problem, so it would not bite you.





Re: Cursors Help

Anomaly

Ok thanks alot, and yea it seems pretty simple. I couldn't grasp the concept that the report would see the cursor. Glad I got it thanks again.