LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with NiReports user formated HTML after LabVIEW v8.20

I'm using NiReports subVis to expose the "body text" of an HTML report to achieve very complex formating.

This needs the current input "body text" to be processed through loops before being re-inserted into the report.

LabVIEW 8.20 & earlier would have 2 sub Vis "Generate report get data to modify" and "Generate report set modified data" accessible, although I guess very few programmers go down that far for HTML editing. The trick at the time was to insert those Vis in the report creation thread.

See example implementation in LV8.20


Those Vis "Generate report get data to modify" and "Generate report set modified data" do not exist in more recent releases where the NiReports llb is managed as classes. See LabVIEW 2012 version.

 

I guess I need to implement a private Vi that allows retreiving the Body text from a report to be able to reinsert updated text. Just adding new text is not sufficient for my need.
Updating the "Append User Formatted HTML to report" to expose the body text as an output would do the job but I run into class conflicts on the reports-in / report out terminals. Same using global variable !

Any idea how to implement a workaround ?

Thanks in advance for your help.

Download All
0 Kudos
Message 1 of 7
(2,378 Views)

You already have a model of how to do it. There are currently functions that only do something useful when working with HTML reports. Look at Append Horizontal Line to Report.vi. It is implemented as a method for dynamic dispatch in the NI_Report class but is only overridden in the NI_HTML class. For the other report class, the parent method is executed, which generates an error.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 7
(2,364 Views)

Oh yes, one more thing...

 

As with anytime that you modify code that ships with LV, you need to make sure that you update the modified code somewhere because the next time you update/upgrade LV you will lose all your modifications.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 7
(2,362 Views)

Hi Mike,

thanks for this fast feedback.

Yes I see what you mean.

In fact my problem is that I need to extract the current report body text from the report within a rather large Vi where updates are recursives (for loops). Probably pretty hugly code of mine !

I would in fact need to call directly HTML Data Global first with the Get option, then with the Set option, as in the attached Vi.

Problem lies in the compatibility of the Unbudle by name with the actual Report out / Report in reference. In other words, how do I "down cast" (if this is the proper term) from the Green reference terminal to the Red reference terminal without breaking wires.

Sorry I'm not much used to dealing with class in LabVIEW...

 

Does this make sense ?

0 Kudos
Message 4 of 7
(2,356 Views)

To chaneg the class you would use the same To More Specific Class node that you use when casting VI Server references.

 

The problem is that you can't do it because only VIs that are in the class can unbundle the HTML refnum value.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 7
(2,352 Views)

Hi Mike, thanks for the follow up.

So you mean no other ways that fully including all the code I use to update the HTML text within a private & modified copy of "Append Horizontal Line to Report.vi" if I can manage. In this case, where should have save such a Vi, within the class or first duplicating the whole class under a different name. Looks like a lot of work !

 

I was also thinking of a copy of the NiReports library from LV8.20, renaming all Vis in order to have them upgraded independantly of the "original". Would that work ?

 

I'm surely quite old fashioned (early LabView adopter years ago), but I do not like the idea that it is very difficult to add a terminal to an existing Vi! Most of my work deals with prototypes, some of them becoming very stable over the years although they will not be recognized as implemented with good enough programming style & modularity!

 

What would you consider as the best option ?

 

Thanks again for your help.

 

CU

 

 

0 Kudos
Message 6 of 7
(2,344 Views)

The first step should be to learn a bit more about how the whole process of dynamic dispatch works. Basically, you can see it as a way of doing polymorphic VIs where the decision of which instance to run is made at runtime. This is why the inputs have to be exactly the same.

 

In the parent class you create a new VI for dynamic dispatch, this is called a method. Whatever you have on the front panel of that VI is what will be on override VIs in the subclasses. The subclass VIs (which also have to have the same name) are called override VIs because at runtime their functionality replaces or overrides the functionality of the parent method.

 

Also, a parent method doesn't need to be overidden in all subclases. For subclasses where the parent method is not overridden, the parent method will run.

 

Mike...

 

PS: if you can get the new LVOOP class from NI, it's actually pretty good. But make sure it is the new class. The original one pretty much stunk...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 7
(2,333 Views)