I’ve searched and read about filtering reports and saving pdf files but I have not come up with a solution to my problem.
I have a report (SetListMaster) based upon a 1:M:1 set (Songs:Notes:Instrument). The Songs table has a field =Group that holds a text value for the Setlist to which the song has been chosen for (set1, set2, etc).
I use an embedded browse on a form based upon a second 1:M set (Band:Instruments) to select the instrument (inst_id) into a global variable- (vSinst) to filter the report. The filter works well for preview.
I want to email this report to the Members, so I want to save the report as a PDF file and sent it via email. So I try and save the report with the same filter:
The report saves but is empty… no records.
Now if I combine the two actions preview and then save the report as pdf file, it saves the report correctly filter with records as PDF file. But I don’t want to have to preview each report prior to saving, as I want my script to eventually cycle through all members and send each their respective setlists without having to preview.
How can I get the report to save a filtered report as PDF for email without having to preview it? I have tried shifting the filter to the report… didn’t work.
In the example, it opens to the main menu. Press red button ‘print/email Setlist which takes you to the Distribution form. Select any member/instrument and choose the preview or email button. The preview button runs UDF ‘distribute_preview’ and the other ‘distribute_email_one’. The preview button does the following:
1. Acuires the instrument id as vSinst and takes you to the report preview with the report filtered.
2. Saves the report as pdf after exiting preview
3. Displays a dialog that prompts the user to view or not view the pdf file.
4. Displays the saved pdf if YES is chosen.
The email button skips the preview event in step 1. Chose YES view PDF and you will see for the email script the saved report is empty.
I am at a loss and could use some help, please.
I have a report (SetListMaster) based upon a 1:M:1 set (Songs:Notes:Instrument). The Songs table has a field =Group that holds a text value for the Setlist to which the song has been chosen for (set1, set2, etc).
I use an embedded browse on a form based upon a second 1:M set (Band:Instruments) to select the instrument (inst_id) into a global variable- (vSinst) to filter the report. The filter works well for preview.
Code:
query.filter = "(( \"Set\" $ Group ) ) .and. (Notes->Inst_refno = Var->vSinst )" query.order = "pick" query.filter = convert_expression(query.filter,"V") :Report.Preview("SetListMaster",query.filter,query.order)
Code:
query.filter = "(( \"Set\" $ Group ) ) .and. (Notes->Inst_refno = Var->vSinst )" query.order = "pick" query.filter = convert_expression(query.filter,"V") dim shared veatt as C dim shared vSLRpdf as C vSLRpdf = a5.get_path() + "\SetListReport.pdf" veatt = report.saveas("SetListMaster", "PDF",query.filter, "", vSLRpdf, .F.)
Now if I combine the two actions preview and then save the report as pdf file, it saves the report correctly filter with records as PDF file. But I don’t want to have to preview each report prior to saving, as I want my script to eventually cycle through all members and send each their respective setlists without having to preview.
How can I get the report to save a filtered report as PDF for email without having to preview it? I have tried shifting the filter to the report… didn’t work.
In the example, it opens to the main menu. Press red button ‘print/email Setlist which takes you to the Distribution form. Select any member/instrument and choose the preview or email button. The preview button runs UDF ‘distribute_preview’ and the other ‘distribute_email_one’. The preview button does the following:
1. Acuires the instrument id as vSinst and takes you to the report preview with the report filtered.
2. Saves the report as pdf after exiting preview
3. Displays a dialog that prompts the user to view or not view the pdf file.
4. Displays the saved pdf if YES is chosen.
The email button skips the preview event in step 1. Chose YES view PDF and you will see for the email script the saved report is empty.
I am at a loss and could use some help, please.
Comment