Finding an object in a report by type
I see from the manual that you can find an object in a report by name, i.e.
TfrxMemoView * Memo = dynamic_cast <TfrxMemoView *> (frxReport1->FindObject("Memo1"));
This does not really help if you are parsing a user designed report and they have assigned some arbitrary name to a component.
However I have a custom component that can be used in a report and I just want to know if this component has been used in a particular report. So I am after something along the line sof
TfrxMemoView * Memo = dynamic_cast <TfrxMemoView *> (frxReport1->FindObjectType(TfrxMemoView));
Can this be done?
TfrxMemoView * Memo = dynamic_cast <TfrxMemoView *> (frxReport1->FindObject("Memo1"));
This does not really help if you are parsing a user designed report and they have assigned some arbitrary name to a component.
However I have a custom component that can be used in a report and I just want to know if this component has been used in a particular report. So I am after something along the line sof
TfrxMemoView * Memo = dynamic_cast <TfrxMemoView *> (frxReport1->FindObjectType(TfrxMemoView));
Can this be done?
Comments
- Give your component a special Type,
- Search through ALL objects of the report,
- Check if any of its object is of Type you've created for your component.
You can search for knowledge: in manuals, in this forum, through tickets support, and ... hours of testing by yourself.
No way of those above gives one the whole solution :-(
My suggestion for an iterating (I did for FastReport script, didn't try to see that in compiler):