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

Stop exporting blank report

Status
Not open for further replies.

dataent

Programmer
Jun 19, 2001
29
0
0
US
Using VB6 & CR8.5, I am generating a report for department totals and emailing the reports to the department head. If there are no transactions for a department, I do not want the report to be sent. Using the export command, is there any way to find out if there are no detail lines in the report and not send it?

Thanks for any help.
Jeff
 
Jeff, use the RDC to find out how many records are in the report and then branch based on that number:
--------------------------------------------
Report.PrintingStatus.NumberOfRecordSelected
--------------------------------------------

I do this in my Visual CUT software to let users indicate
what should happen to empty scheduled reports:
-e switch causes empty reports not to be processed
-E switch causes empty reports to be processed.

I suggest you allow for similar logic because you may find that some users do want empty reports e-mailed to them (that way they can be sure the process is working).

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Ido,
Thank you for the suggestion. I am using the following code and I am not sure how to use the PrintingStatus.NumberOfRecordSelected when the export is done "unattended".


Rep.RecordSelectionFormula = SF & " and {CCO.MST_DEPT_ALL} = """ & Dpt & """" '*** Add dept as part of selection
Rep.ExportOptions.DestinationType = crEDTEMailMAPI
Rep.ExportOptions.FormatType = MailType
Rep.ExportOptions.MailSubject = "ATICTS - Consumable Usage"

Rep.ExportOptions.MailToList = MainEmail
Rep.ExportOptions.MailCcList = CCMail

Rep.Export False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top