Just to add info on my question. I am creating a ZenReport that prints data to pdf. Now i am using the code I have provide like this < item special=“page-number” /> inside the table. That code display page number after creating/rendering the pdf.
How will it be triggered in the ZENReport without calling it in the display? below is my sample.
Import User
///Test.TestReport
Class Test.TestReport Extends ZenReport
{ /// This XML defines the display for this report. /// This is used to generate the XSLT stylesheets for both HTML and XSL-FO. XData ReportDisplay [ XMLNamespace = "http://www.intersystems.com/zen/report/display" ]
<!-- Optional Pagefooter element. Does not apply in HTML output. -->
<pagefooter>
<item special="page-number"/>
</pagefooter>
Doesn't support roman numeral conversion. Now there's a billion ways to do this yourself, and I was inspired by the unary method in one of the answers here, instead of complex loops:
So I made something similar for ObjectScript, and it gets the job done in a very simple way. Note that it doesn't use a full Subtractive method for conversion, for that you'll need more cases. The replaces could be structured differently too but I wanted it to be as understandable as possible. Call it in your report however you like.
ClassMethod RomanNumeralConversion(pNum) As %Status {
set roman = ""
for x=1:1:pNum {
set roman = roman_"I"
}
set roman = $REPLACE(roman,"IIIII", "V")
set roman = $REPLACE(roman,"IIII","IV")
set roman = $REPLACE(roman,"VV","X")
set roman = $REPLACE(roman,"VIV", "IX")
set roman = $REPLACE(roman,"XXXXX", "L")
set roman = $REPLACE(roman,"LL", "C")
set roman = $REPLACE(roman,"LXL", "XC")
set roman = $REPLACE(roman,"CCCCC", "D")
set roman = $REPLACE(roman,"CCCC", "CD")
set roman = $REPLACE(roman,"DD", "M")
set roman = $REPLACE(roman,"DCD", "CM")
return roman
}
Unfortunately I don't know how to go about altering that value after or before it's been generated. You may have to experiment with including custom functions in your tags that output page numbers, or try to get the value from the special tag into one of your custom tag functions. Whatever you do, there doesn't seem to be a native way and you'll have to do something custom.
add the parameter XSLFOSTYLESHEET and recompile the class again
/// If defined, this provides a reference to the external
/// stylesheet to use in generating the XSL-FO (PDF) report.
/// If it is not provided, a stylesheet will be generated
/// from the ReportDisplay XData block.
Parameter XSLFOSTYLESHEET As String = "MyApp.ReportDemo.xsl";
Now open the report in your browser/command line/etc. Profit!
Important: if you change something in ReportDisplay, you need to repeat the steps again.
Please share the usecase.
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
Hello David,
Just to add info on my question. I am creating a ZenReport that prints data to pdf. Now i am using the code I have provide like this < item special=“page-number” /> inside the table. That code display page number after creating/rendering the pdf.
There are system implementations too:
Instead of:
for x=1:1:pNum {
set roman = roman_"I"
}
Try:
set roman = $Translate($Justify("", pNum)," ","I")
This can be used to generate an arbitrary number of any arbitrary character.
How will it be triggered in the ZENReport without calling it in the display? below is my sample.
Import User
///Test.TestReport
Class Test.TestReport Extends ZenReport
{ /// This XML defines the display for this report. /// This is used to generate the XSLT stylesheets for both HTML and XSL-FO. XData ReportDisplay [ XMLNamespace = "http://www.intersystems.com/zen/report/display" ]
<!-- Optional Pagefooter element. Does not apply in HTML output. --> <pagefooter> <item special="page-number"/> </pagefooter>
}
{
blahblahblah
}
///Closed
}
I'll try to answer just the conversion question. It looks like someone has asked about roman numerals before here:
https://community.intersystems.com/post/roman-number-converter
However the conclusion was that the referenced article in that question here:
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.FrameSet.cls?KEY=GVRF_basicfeatures
Doesn't support roman numeral conversion. Now there's a billion ways to do this yourself, and I was inspired by the unary method in one of the answers here, instead of complex loops:
https://stackoverflow.com/questions/12967896/converting-integers-to-roman-numerals-java
So I made something similar for ObjectScript, and it gets the job done in a very simple way. Note that it doesn't use a full Subtractive method for conversion, for that you'll need more cases. The replaces could be structured differently too but I wanted it to be as understandable as possible. Call it in your report however you like.
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...
Unfortunately I don't know how to go about altering that value after or before it's been generated. You may have to experiment with including custom functions in your tags that output page numbers, or try to get the value from the special tag into one of your custom tag functions. Whatever you do, there doesn't seem to be a native way and you'll have to do something custom.
You can change the XSLFO Stylesheet dynamically or statically. See XSLFOSTYLESHEET
So, there is a class-report, for example MyApp.ReportDemo.
Series of steps:
Now open the report in your browser/command line/etc. Profit!
Important: if you change something in ReportDisplay, you need to repeat the steps again.
How about on PDf rendering?
Not in InterSystems IRIS though.
incredible. %bi.* is still around !!
Page numbering in Roman Numerals
Need add the attribute format to the element <fo:page-sequence>, i.e.
Possible value format:
Example:
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue