Support Forums
Need Custom Report to CSV additional information to it

Hiii
i just discussing with user to replace the DAS software for oil industry with VTScada,
all feature in VTScada already meet except the custom report.

in their software they can add information like customer name, location, service order etc to their csv report.

best regards,

Hiii i just discussing with user to replace the DAS software for oil industry with VTScada, all feature in VTScada already meet except the custom report. in their software they can add information like customer name, location, service order etc to their csv report. best regards,

I’ve been messing with custom report scripting the last couple weeks using the examples in the help file. I think this is doable. You can access tags in the report script and print them to a line in the csv file it outputs. I think you use the scope(vtsdb,…. function. Something like that.

I haven’t figured out how to make the tags relative yet. Just absolute.

Other option may be for them to just open the csv and type it in manually.

I’ve been messing with custom report scripting the last couple weeks using the examples in the help file. I think this is doable. You can access tags in the report script and print them to a line in the csv file it outputs. I think you use the scope(vtsdb,…. function. Something like that. I haven’t figured out how to make the tags relative yet. Just absolute. Other option may be for them to just open the csv and type it in manually.

Following - this would be really useful to customise the "standard report". Cardsfan - let us know if you get any further.

Following - this would be really useful to customise the "standard report". Cardsfan - let us know if you get any further.

So, doing this now (also for oil and gas), works quite well with the Example Custom Snapshot Report in the help. I previously used a "Standard report" and just reported a few string tags for additional info alongside the trend I wanted, however this goes against the Help recommendations, then used a macro in Excel to create a nice PDF report.

After playing with the example custom report in the Help, I use the below lines in the custom report - while increasing the array size to allow for extra info, and increasing the write to the report. Then in the macro I can just pull the info into the format I want.

{additional info can be added to reports by reading a tag value and naming
a column title after the value in the snapshot report - ensure the data array is increased
in size to accomodate these columns and the write}
    Titles[NTags + 2] = PickValid(Scope(\VTSDB, "AdditionalInfoTag1")\Value,"-");
    Types[NTags + 2] = "TEXT";
    Formats[NTags + 2] = TEXTFMT;

If anyone can recommend a better way, I'd love to hear it.

So, doing this now (also for oil and gas), works quite well with the Example Custom Snapshot Report in the help. I previously used a "Standard report" and just reported a few string tags for additional info alongside the trend I wanted, however this goes against the Help recommendations, then used a macro in Excel to create a nice PDF report. After playing with the example custom report in the Help, I use the below lines in the custom report - while increasing the array size to allow for extra info, and increasing the write to the report. Then in the macro I can just pull the info into the format I want. ```` {additional info can be added to reports by reading a tag value and naming a column title after the value in the snapshot report - ensure the data array is increased in size to accomodate these columns and the write} Titles[NTags + 2] = PickValid(Scope(\VTSDB, "AdditionalInfoTag1")\Value,"-"); Types[NTags + 2] = "TEXT"; Formats[NTags + 2] = TEXTFMT; ```` If anyone can recommend a better way, I'd love to hear it.
edited Oct 23 '23 at 11:42 am

I found the same thing. Then as you probably found out the Reporter\Dataline(...) function needs to have the actual data in an array the same width as the titles. The bad thing is if the "number of previous periods" is greater than 1, it runs through the script that many times and re-prints your titles. You can also use \propertyname instead of \value and it will look for that tag property in that tag or its parents.

I wish there was a better solution for anywhere thin clients. I can't get excel templates to work on there. Screen and csv do work.

I found the same thing. Then as you probably found out the Reporter\Dataline(...) function needs to have the actual data in an array the same width as the titles. The bad thing is if the "number of previous periods" is greater than 1, it runs through the script that many times and re-prints your titles. You can also use \propertyname instead of \value and it will look for that tag property in that tag or its parents. I wish there was a better solution for anywhere thin clients. I can't get excel templates to work on there. Screen and csv do work.
135
4
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft