on ‎2011 Oct 19 5:39 PM
I'm using Crystal Reports 2008 service pack 4 and am displaying my reports using the dot.net viewer.
I'm attempting to move a textbox that contains the horizontal page number as well as the total page count on a crosstab report.
The reason is I allow the user to change the orientation from portrait to landscape as well as the papersize and I always want the page number to print in the bottom right hand corner.
I can find the textboxes that I wish to change the position of by using the following code
'rpt is defined earlier and the report is loaded
For Each rptObj As Object In rpt.ReportDefinition.ReportObjects
Debug.Print(TypeName(rptObj) & ": " & rptObj.name)
If TypeName(rptObj) = "TextObject" Then
Dim rptText As TextObject = CType(rptObj, TextObject)
Debug.Print("TextObjectName: " & rptText.Name & " TextObjectText: " & rptText.Text)
If rptText.Name Like "PageNoOfM" Or rptText.Text Like "PageNumber*" Then
'the next line fails with the error "Field not found"
rptText.left = rpt.PrintOptions.PageContentWidth - rptText.Width
End If
endif
next
I can look at all the properties for the textbox I just cant set any.
I did a stack trace and here is the dump.
System.Runtime.InteropServices.COMException was caught
ErrorCode=-2147213282
Message="Field not found."
Source="rptcontrollers.dll"
StackTrace:
at Microsoft.VisualBasic.CompilerServices.Symbols.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean OptimisticSet, Boolean RValueBase, CallType CallType)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateSet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments)
at TouristTrackerDotNet.rfPrintPreview.rpt_InitReport(Object sender, EventArgs e)
InnerException:
When searching around on the net I found that an error changing the properties on the textobject was fixed in
BOXIR2_Jupiter FixPack2.6 but I don't know what product this is although the error I'm having is in the same dll
rptcontrollers.dll.
Here is the text regarding the fix.
ADAPT00684695 FixPack2.1
Description:
When a text object contains a summary, users cannot manipulate the text field at run time (for example: myTxtObj.Left =
100).
The following error message appears: "COMException was unhandled Field not found."
New Behavior:
This problem is resolved.
Components:
win32_x86
RptControllers.dll
I think this is a bug in this version of Crystal, any ideas?
Thanks in advance for any help on this.
Request clarification before answering.
Crosstabs only have one page, the page may extend across multiple pages when printed but inside CR it only has one page. You'll see this in the viewer.
Which is why you are getting the error, I assume you are trying to set the filed location outside of the first page area.
Try it with a report that is not a crosstab report, it should work.
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.