- Posts: 26
Custom Report
- GabrielSimoes
- Topic Author
Less
More
06 Sep 2022 11:51 #11425
by GabrielSimoes
Custom Report was created by GabrielSimoes
Good Afternoon
At first, I wanna to confirm if SAM has the option to have the report custom into SAM's platform.
If it doesn't present this option, I would like to know if you know about a LK script on github already done that makes a custom report for SAM's results. I spent some time today searching for a script which fits in to this request, but no luck.
My custom report would just add some information to it, like as some graphs, maybe some tables.
Best Regards
At first, I wanna to confirm if SAM has the option to have the report custom into SAM's platform.
If it doesn't present this option, I would like to know if you know about a LK script on github already done that makes a custom report for SAM's results. I spent some time today searching for a script which fits in to this request, but no luck.
My custom report would just add some information to it, like as some graphs, maybe some tables.
Best Regards
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
07 Sep 2022 13:37 #11428
by pgilman
Replied by pgilman on topic Custom Report
Hi Gabriel,
SAM's report template editor is not available in the SAM user interface. We have received requests to make one available, but have not yet received funding to do this work: github.com/NREL/SAM/issues/308
In the meantime, you could use the ME Wave Report macro as an example of how to write a report generator in LK script. To see the macro, create a Marine Wave / LCE Calculator case, and click Macros under the Simulate button. Then click ME Wave Report and click View code at the top right of the Macros page.
If you want to convert that macro to an LK script, copy and paste the code starting from Line 58 into a text file with the .lk extension. Note that the script uses the 'macro' table to set the value of inputs, so you will need to set the values of those variables in your script. For example, replace Line 101
with
This example is for the Marine Wave Energy performance model with the LCOE Calculator financial model, so you will have to modify it to use with different models.
Best regards,
Paul.
SAM's report template editor is not available in the SAM user interface. We have received requests to make one available, but have not yet received funding to do this work: github.com/NREL/SAM/issues/308
In the meantime, you could use the ME Wave Report macro as an example of how to write a report generator in LK script. To see the macro, create a Marine Wave / LCE Calculator case, and click Macros under the Simulate button. Then click ME Wave Report and click View code at the top right of the Macros page.
If you want to convert that macro to an LK script, copy and paste the code starting from Line 58 into a text file with the .lk extension. Note that the script uses the 'macro' table to set the value of inputs, so you will need to set the values of those variables in your script. For example, replace Line 101
Code:
companyName = macro.companyName;
Code:
companyName = "My Company Name";
This example is for the Marine Wave Energy performance model with the LCOE Calculator financial model, so you will have to modify it to use with different models.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- GabrielSimoes
- Topic Author
Less
More
- Posts: 26
08 Sep 2022 05:14 #11430
by GabrielSimoes
Replied by GabrielSimoes on topic Custom Report
Thank you so much, Paul.
I'll try this
I'll try this
Please Log in or Create an account to join the conversation.
Moderators: pgilman