Jump to content

Suppress FP Expression resource


fheuvel

Recommended Posts

I am trying to suppress a FP Expression image, but can't get it working with the following OnRecordStart script because the SetGraphic function only seems to work with graphic resources. The error message says that a FP Expression resource is not a graphic resource:

 

var boyframe = FindGraphicFrame("shirt");

var girlframe = FindGraphicFrame("tattoo");

 

if (Field("gender") == "m")

{

boyframe.SetGraphic(Resource("shirt"));

boyframe.suppress = false;

girlframe.suppress = true;

}

else

{

girlframe.SetGraphic(Resource("tattoo"));

girlframe.suppress = false;

boyframe.suppress = true;

}

 

Is there another function? I can't find it.

Any idea is very welcome.

Link to comment
Share on other sites

While I'm not familiar with FP Expression, I do know that if you don't have the graphic linked as Resource your code will not work.

 

Are "shirt" and "tattoo" field names in your data file that reference the entire file name of the image you're wanting to bring in? If so, CreateResource may be the solution you're searching for:

 

boyframe.SetGraphic(CreateResource(Field("shirt")));

Link to comment
Share on other sites

Thanks for your reply.

Unfortunately it won't work because shirt and tattoo are not fields but FP Expression resources. This is a special type of resource because they need to pass a datafield to FP Expression.

Link to comment
Share on other sites

Oh, okay. I may be over my head with this FP Expression dilemma but my last ditched effort would be to try:

girlframe.SetGraphic(Resource("tattoo").content);

 

Or, could you not apply the rule to the graphic frame and then just suppress it with the OnRecordStart rule?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...