PDA

View Full Version : cSigCJReportControlFieldChooser



chuckatkinson
8-Apr-2009, 08:03 AM
I've seen the above in the demo programs and have added it (or it was added) to my view with the cSigCJReportControl but it doesn't seem to do anything as no fields are shown.

How do I use it ?

Peter Bragg
8-Apr-2009, 08:46 AM
Chuck,

Can I just clarify - when you say that there are "no fields shown", do you mean initially? Or after you removed fields from the Report Control at runtime?

The FieldChooser (as things stand) is there to 'catch' columns that are removed (dragged off) the report control at runtime. So if at design time you add 5 columns to the report control, initially at runtime the report control will have 5 columns and the field chooser will be empty. If at runtime the end-user removes some columns then this is the point at which they should appear in the FieldChooser object. I suspect that it is on our 'to do' list to have a way of registering fields with the field chooser that are not initially added to the report control (not sure).

Anyway, assuming that you are saying that the field chooser remains empty after you have removed columns at runtime, I would check how you have the objects coded. I believe (though Ian or Martin will correct me if I am wrong) that the Field Chooser object currently has to be defined (coded) above the report control object, so you might want to check this in your code.

The code should look something like:



Object oSigCJFieldChooser is a cSigCJReportControlFieldChooser
End_Object

Object oSigCJReportControl is a cSigCJReportControl
Set pbPX_Save_Layout to True
Set psPX_Tag to (Label(Parent(Self)))
Set phoFieldChooser to (oSigCJFieldChooser(Self))

etc.
End_Object


Note the phoFieldChooser property of the report control is set with the object name of the field chooser object and that the field chooser object is defined above the report control.

Note also the 'PX' property settings. These are set (see above code) such that if the end-user chooses to remove columns at runtime then the report control will 'remember' this the next time the application is run, and any removed columns should appear in the field chooser object.

That all said I believe that Ian or Martin were planning on looking at how we implement the field chooser - the plan is that you shouldn't have to code the field chooser object, but rather just set a property to determine whether it is included or not. Not sure whether they have done this already or not - I am sure that they will chip in and update us! :rolleyes:

Ian Smith
8-Apr-2009, 09:29 AM
We are planning on embedding the Field Chooser, but have not done so yet.

The position of the PX properties is not important they can be above or below phoFieldChooser. The PX properties are a separate feature and can be used without the Field Chooser. If the PX properties are set the layout of the report will be saved when the view containing the Report Control is deactivated. If there is a saved layout it will be applied the next time the Report Control is built.

Peter Bragg
8-Apr-2009, 09:45 AM
Chuck,

Just to avoid confusion I will amend my reponse. When I wrote:

"Note also the 'PX' property settings. These are set above such that..."

I was using the word "above" meaning that I was refering to the code snippet above. I didn't mean that the properties had to be set above the setting of other properties. Ian is correct - the position of the properties is not important. What IS important is the position of the Field Chooser object (I think).

Ian Smith
8-Apr-2009, 09:55 AM
Peter is correct, at present the Field Chooser object has to be manually coded above the Report Control. I’m glad English is so unambiguous:rolleyes:

chuckatkinson
8-Apr-2009, 10:11 AM
Thanks guys. I really had no clue how it worked. I just fired up my app and dragged some columns off the report and voile' there they were in the field chooser. Wonderful !

Great work. My users testing the program are just amazed at what the ReportControl can do.