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: Please hepl with Record Selection Formula
Leonid
Posts: 32
 
Please hepl with Record Selection FormulaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Nov 07 9:44 AM
Dear all.
Please, advice me a solution for my problem.
I am trying to export a report from SLX 6.2.5 to PDF by pressing button from a custom form.
I've tried everything.
Tried these
'Set CRXReport = objRDC.OpenReport("\\kfsvrmow04\SLX_PROPERTY\passports.rpt")

'CRXReport.RecordSelectionFormula = "{spk_retail.spk_propertyID} = '" & fldPropertyID.text & "'"
'CRXReport.ExportOptions.DestinationType = 1
'CRXReport.ExportOptions.DiskFileName = strReportFile1
'CRXReport.ExportOptions.FormatType = 31
'CRXReport.Export True
and these
Application.BasicFunctions.DoInvoke "CrystalReportPreview","Personal:Passport"
With Application.BasicFunctions
.ReportClearConditions
.ReportAddCondition "spk_retail:spk_propertyid", "=", "'" & fldPropertyID.text & "'" , "string", ""
End With

The first one is only working for the first time. Exports great, but if u press button one more time it says that "No rowset was selected" and in Script Debugger is obvios that Record Selection Formula is "" (????? why it is so).
Ctrl+F5 does not help, but when u close and then open it works for one more time.
The second variant is working all the time, but does not sets conditions at all.


The second va
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Please help with Record Selection FormulaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Nov 07 4:17 PM
As the first one works only the first time, you have to track down what is not being cleared/initialised - something is persisting in memory/cache that is messing up run #2 and onwards.

Idea 1
Have you tried
set CRXReport = nothing
at the end to clear the object reference?

PP
[Reply][Quote]
Leonid
Posts: 32
 
Re: Please help with Record Selection FormulaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Nov 07 1:25 AM
I've tried to set CRXReport and objRDC to nothing..
nothing happened =)))
The same Error
Crystal Database Error: No rowset was returned for this table, query or procedure.
Then a script Error. In debugger: Crystal Reports Active X Designer - Error detected by database dll.

Any other ideas?

Here is the full sub:

Dim objRDC
Dim strReportFile1
Dim strReportFile2
'Dim strReportName
Dim WshShell
strReportFile1 = Application.BasicFunctions.GetPersonalDataPath & "\"& Application.BasicFunctions.GetIDFor("SPK_MANAGE") &".pdf"
strReportFile2 = """" & strReportFile1 & """"
set objRDC = Application.BasicFunctions.GetCrystalReport("Personal:Passports")
objRDC.RecordSelectionFormula = "{spk_retail.spk_propertyID} = '" & fldPropertyID.text & "'"
objRDC.ExportOptions.DestinationType = 1 'File
objRDC.ExportOptions.DiskFileName = strReportFile1
objRDC.ExportOptions.FormatType = 31 'PDF
objRDC.Export False
set WshShell = CreateObject ("WScript.Shell") 'DNL
WshShell.Run strReportFile2, 1 'DNL
Application.MainViews.ActiveView.Refresh
Application.MainViews.ActiveView.Refresh

set objRDC = nothing
set WshShell = nothing

One more question.
What is main table in this case? A main table for a report? or a main table in SLX structure?
[Reply][Quote]
Snow Monkey
Posts: 214
 
Re: Please help with Record Selection FormulaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Mar 08 12:06 PM
This has to work. You only can say what your maintable should be..Where are the links starting from?

Dim objReport, objReportMV, strFilter
Set objReport = Application.BasicFunctions.GetCrystalReport("Account:report")
With objReport
.DiscardSavedData
If Trim(cboTierLevel.Text) <> "" Then
strFilter = "{vsdsd.Tier}= ('" & cbosdsl.Text & "')"
Else
strFilter = "{vsdsdsd.Tier}= ('tier 1') and {vererer.Tier}= ('tier 1')"
Exit Sub
End If
objReport.RecordSelectionFormula = strFilter
End With
Set objReportMV = Application.MainViews.Add("Personal:form with crviewer control on it", 0, False)
On Error Resume Next
objReportMV.DetailsView.Script.ShowView objReport
objReportMV.Caption = "sdsdsd"
objReportMV.Maximize
objReportMV.Show
Set objReport = Nothing
[Reply][Quote]
Matt Dockins
Posts: 159
 
Re: Please help with Record Selection FormulaYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 08 3:08 PM
set objRDC = Application.BasicFunctions.GetCrystalReport("Quote:Quote Detail")

objRDC.RecordSelectionFormula = "{QUOTE.ACCOUNTID} = '" & strAID & "' and {QUOTE.QUOTEID} = '" & strQID & "'"' and {?FaxCoverID} = '"& strFaxCoverID &"'"
'end if
objRDC.ExportOptions.DestinationType = 1 'File

strFileName = Application.BasicFunctions.GetAttachmentPath & "Quote(" & edtQuoteNumber.Text & ").pdf"

objRDC.ExportOptions.DiskFileName = strFileName
objRDC.ExportOptions.FormatType = 31 'PDF
'objRDC.ExportOptions.FormatType = 14 'Word Document (RTF)

objRDC.Export False
objRDC.discardsaveddata
set objRDC = nothing

'note the objRDC.Discardsaveddata - NOT Application.basicfunctions.discardsavedata


[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 10:29:58 AM