10-03-2014 01:42 AM - edited 10-03-2014 01:43 AM
We upgraded one of customers from Saleslogix 7.2.2 to Saleslogix 8.1 (SNC 3b) last week and since then have encountered a number of issues with Crystal Reports. The latest one I have unfortunately not been able to find a solution to. I have been able to recreate the problem using a sample report within the Eval database.
To recreate: Add a button the Account detail form and it paste the code below under the OnClick event. The code will save and launch (for the purposes of the example) the Account Product List Sample report.
Dim objRDC, ReportFileName
ReportFileName = "C:\" & Application.BasicFunctions.CurrentAccountID & ".pdf"
Set objRDC = Application.BasicFunctions.GetCrystalReport("Accountupport Account Product List - Sample")
objRDC.RecordSelectionFormula = "{ACCOUNT.ACCOUNTID} = '" & Application.BasicFunctions.CurrentAccountID & "'"
objRDC.ExportOptions.DestinationType = 1
objRDC.ExportOptions.DiskFileName = ReportFileName
objRDC.ExportOptions.FormatType = 31
objRDC.Export False
Set objRDC = Nothing
Dim ws
Set ws = CreateObject("WScript.Shell")
ws.Run ReportFileName, 1
Set ws = Nothing
What you will find is that the first time you run the report (against Abbot Ltd for example) everything will run fine. However if you then change to another account (Abbott Worldwide for example) the report will be generated but will not contain any data. In fact, until you refresh the client the report will always be blank when run against any company except for the company you first ran it against (Abbot limited in this example).
On our customer's system the code above is used inside a custom form to save a custom report to a network share before attaching it to an email. This one of their key processes and so obviously they are not too happy that it is no longer working. Does anyone have an idea as to how we can work around this?
10-03-2014 12:28 PM
Hi Tom,
Please see the following example:
Thanks
Mike
10-03-2014 04:54 PM
That seems to do the trick. Thanks
10-03-2014 05:15 PM
Glad to help!
Thanks
Mike