Ah yes, sorry I didn't see the HTMLReportGenerator in your first screenshot. There are a few ways you can still use fme_basename. One method is using a VariableSetter and VariableRetriever. The following should work:
Another way is using a FeatureMerger to merge the basename attribute onto the output feature of the HTMLReportGenerator (similar to this post).
Rather than using the published parameter for the source dataset (called $Source_Dataset_GEOJSON_3), you'll want to use the fme_basename format attribute. The fme_basename attribute contains a dataset's filename without the path or extension whereas the source dataset published parameter contains the full path to the source file (i.e. C:\Users\data\example.geojson). In order to use fme_basename, you'll need to expose it either in the reader feature type or using something like an AttributeExposer. The path for your destination HTML file will look something like this:
Rather than using the published parameter for the source dataset (called $Source_Dataset_GEOJSON_3), you'll want to use the fme_basename format attribute. The fme_basename attribute contains a dataset's filename without the path or extension whereas the source dataset published parameter contains the full path to the source file (i.e. C:\Users\data\example.geojson). In order to use fme_basename, you'll need to expose it either in the reader feature type or using something like an AttributeExposer. The path for your destination HTML file will look something like this:
.\HTML report\@Value(fme_basename)_Level.html
Hi @chrisatsafe , thank you for your prompt response. However, I still have an issue as I tried your steps, as attached below.
The html file name is now become @fme_basename_level.html
Hi @chrisatsafe , thank you for your prompt response. However, I still have an issue as I tried your steps, as attached below.
The html file name is now become @fme_basename_level.html
Do I missed any steps in order to make it happen?
Thank you!
Zach
My apologies, looks like the value didn't paste in nicely. It needs to be .\\HTML report\\@Value(fme_basename)_Level.html so the writer knows to use the value of that attribute rather than the literal string. I've fixed that in the comment above as well.
Sometimes it can be easier to open the text editor from the drop-down menu and double-click on the attribute name so it formats everything for you.
Hi @chrisatsafe , thank you for your prompt response. However, I still have an issue as I tried your steps, as attached below.
The html file name is now become @fme_basename_level.html
Do I missed any steps in order to make it happen?
Thank you!
Zach
Thanks @chrisatsafe and sorry for keep bothering you.
I think the problem is when I go through the transformer HTMLReportGenerator, the "@Value(fme_basename)" will be gone. I tried to use transformers "attributeKeeper and DuplcatFilter", the html file's name can be exported as I wanted.
However, I must go through the HTMLreportGenerator, as I have certain data I would like to show. Do you have any solution for this problem?
Ah yes, sorry I didn't see the HTMLReportGenerator in your first screenshot. There are a few ways you can still use fme_basename. One method is using a VariableSetter and VariableRetriever. The following should work:
Another way is using a FeatureMerger to merge the basename attribute onto the output feature of the HTMLReportGenerator (similar to this post).
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.