|
-
Apr 18th, 2005, 05:45 AM
#1
Thread Starter
New Member
Accessing remote report with TTX fails when empty
Hi,
I have a report designed with TTX (field file definitions database). When I try to open it from a REMOTE machine (the rpt and the ttx is in my machine), it gives me an error when there is no data.
In VB code, I set the Database.SetDataSource property to an ADODB Recordset and when it has data everything goes well, but when the recordset is empty, the report looks for the TTX and it does not find it (it looks for it on the remote machine and it is in my machine) and shows nothing in the CRViewer.
How can I do to show an empty Report without fail ?
Thanks
Last edited by nuria; Apr 18th, 2005 at 07:20 AM.
Reason: [Resolved]
-
Apr 18th, 2005, 06:13 AM
#2
Thread Starter
New Member
Re: Accessing remote report with TTX fails when empty
I forgot to say than the rpt works fine if it has no formula but fails with formula fields.
-
Apr 18th, 2005, 07:17 AM
#3
Thread Starter
New Member
Re: Accessing remote report with TTX fails when empty
Hi all !
I have found the solution ! I have to pass to the rpt a sql that brings empty fields (you know, SELECT ' ' FROM X) and get the formulas from the report and set them to a value.
This is the thing:
VB Code:
Sub SetFormulas(ByVal iReport As Integer, ByVal sFormula As String)
Dim CrystalReport As CRAXDRT.Report
Dim FormFieldDefn As CRAXDRT.FormulaFieldDefinition
Set CrystalReport = GetReportobject(iReport)
For Each FormFieldDefn In CrystalReport.FormulaFields
FormFieldDefn.Text = " " ' or the value of your choice
Next
Set FormFieldDefn = Nothing
Set CrystalReport = Nothing
end sub
I hope this can help !
Last edited by nuria; Apr 18th, 2005 at 07:21 AM.
Reason: adding [vbcode]
-
Oct 24th, 2005, 04:28 PM
#4
New Member
Re: Accessing remote report with TTX fails when empty
 Originally Posted by nuria
Hi all !
I have found the solution ! I have to pass to the rpt a sql that brings empty fields (you know, SELECT ' ' FROM X) and get the formulas from the report and set them to a value.
This is the thing:
VB Code:
Sub SetFormulas(ByVal iReport As Integer, ByVal sFormula As String)
Dim CrystalReport As CRAXDRT.Report
Dim FormFieldDefn As CRAXDRT.FormulaFieldDefinition
Set CrystalReport = GetReportobject(iReport)
For Each FormFieldDefn In CrystalReport.FormulaFields
FormFieldDefn.Text = " " ' or the value of your choice
Next
Set FormFieldDefn = Nothing
Set CrystalReport = Nothing
end sub
I hope this can help !
Hi,
Can you provide me information how you connected TTX file to the report??
Thanks,.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|