General information
Category:
Reports & Report designer
Hello Barbara,
I read your reply last Friday night but I didn't have a chance to work on the computer(at work) until today.
Just like you said, I am calling the reports from a form method. But there is something more than that. On my menu form, I have a button for printing reports. I didn't create this button, it is Print button from the default buttonset. That is why when I click on that, the OUTPUT screen appears(which comes along with the Print button). From here I choose the sources(the report's name) and Output Type(Preview or Print,...). Click "OK" button(on that Output screen then a "View Parameter" shows up for me to enter the product name and quality.
Because I don't know how to create a "View Parameter" by my own for the reports so I have to do it like the above way. I don't think the "View Parameter" is a class so I can't modify it into the way I want.
I read your reply, I understand what you said but I am stuck with my situation. I really need your advice here Barbara. If I stick to the way I set up the reports(like I told you above), is there any way that I can use _tally? Or if I change to a form method, how to create a View Parameter for each report?
Please, be patient with me. Thank you so so much for your help.
Diane.
*********************
>>I'm assuming you're calling the report from a form method (like a Button Click() ) or a PRG. You should remove the code from the report INIT and put it into the calling program.
1) Remove all tables from the report DE
2) Remove all code from the report Init()
3) In the code that calls the report, put your View requery() and your check for data:
** Set the parameters and update the view
cProdName = "Widgets"
cQuality = "Good"
sele v_MyView
requery()
** Now you have the view with the correct parameters, so you check it to see if there are any records
if _tally = 0
=Messagebox("No Records Found", 16, "Report")
else
Report Form MyReport Preview
endif
>>Finally, if you are putting code in the INIT() method of a form or report and you don't want to run it (as when there are no records) you add a RETURN .F. to your code:
If _tally = 0
=Messagebox("No Records Found", 16, "Report")
return .F.
** Report has now exited back to the calling program.
endif
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only