Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Reporting & Notification Forums - Reporting
Forum to discuss reports for SalesLogix including Crystal, SQL Reports, etc. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Reporting | New ThreadView:  Search:  
 Author  Thread: Multiple execution of Report, blank after first execution, via vbscript
James Jury
Posts: 23
 
Multiple execution of Report, blank after first execution, via vbscriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Sep 10 4:36 PM
Hi All,

I am trying to run a Crystal report to loop through a recordset and execute for each record, exporting to PDF. I have the code blow, which executes without issue on the first loop and then produces empty PDFs on every loop after that. Is there a reset/Close that I am missing? Anybody seen this before? (This is within SLx v7.2 LAN)


for intloop = 1 to intLoopMax
strAccountID = rsRead.fields(0).value & ""
strAccountName = rsRead.fields(1).value & ""

Set report = Application.BasicFunctions.GetCrystalReport(ReportName)

Report.DiscardSavedData

ReportFileName = leFileOutput.Text & "\" & strAccountID & " - " & strAccountName & " – exported.pdf"

Report.RecordSelectionFormula = _
"{ACCOUNT.ACCOUNTID} = '" & _
strAccountID & "'"

Report.ExportOptions.DiskFileName = ReportFileName
Report.ExportOptions.DestinationType = crEDTDiskFile
Report.ExportOptions.FormatType = crEFTPortableDocFormat

Report.Export False

rsRead.movenext
pbPdf.Position = intLoop

Set Report = nothing
Next
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Multiple execution of Report, blank after first execution, via vbscriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Sep 10 6:15 PM
You can't have a filename with a backslash in it ?
[Reply][Quote]
James Jury
Posts: 23
 
Re: Multiple execution of Report, blank after first execution, via vbscriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Sep 10 3:40 AM
It's part of the directory path. The PDFs are being generated, but with no data in them.
[Reply][Quote]
James Jury
Posts: 23
 
Re: Multiple execution of Report, blank after first execution, via vbscriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Sep 10 9:03 AM
In the end I resolved by changing the SQLQuery, as detailed in http://www.slxdeveloper.com/forum.aspx?forumid=2000&postid=9391

Thanks
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/25/2024 2:38:32 AM