matlab report generator page number - matlab

I was trying to insert "Page x of y" in the report from report generator in Matlab. The page footer content does not have any options as such. How can I modify it in the custom section.
I was working in the report explorer.

As far as I know, page headers and footers can only be created for DOCX or PDF formatted reports.
Actually, I would write hundreds of line speaking about how to build up headers and footers in your report documents... but I think that reading this link for you will be more than enough to understand how to build them up.
A little excerpt:
This code defines a document part template Chapter that uses two page
footers: one for odd pages and one for even pages. The page number
format is Arabic numerals.
<dptemplate name="Chapter">
<layout style="page-margin: 1in 1in 1in 1in 0.5in 0.5in 0in;
page-size: 8.5in 11in portrait">
<pfooter type="default" template-name="MyPageFooter"/>
<pfooter type="even" template-name="MyEvenFooter"/>
<pnumber format="1" />
</layout>
<!-- Define content for your chapter here--fixed text and holes as needed -->
</dptemplate>
These document part templates define the page footers.
<dptemplate name="MyPageFooter">
<p style="text-align:right;font-family:Arial,Helvetica,sans-serif;font-size:10pt">
<page/></p>
</dptemplate>
<dptemplate name="MyEvenFooter">
<p style="text-align:left;font-family:Arial,Helvetica,sans-serif;font-size:10pt">
<page/></p>
</dptemplate>
The DOM API elements you are looking for are:
page for current page number
numpages the total number of pages in the document

Related

how to make doxygen use section numbering in html

when you declare in doxygen, in a markdown file:
#Section1 {#sec1}
##subsection 1.1 {#s_sec1}
It simply becomes in html:
Section1
subsection 1
while i'd like:
1. Section1
1.1 subsection 1
In pdflatex it gets numbered automatically. Is there a way to have numbers also in html ? I find the font size change not sufficient.
Thanks
I don't think that this is possible to get them numbered automatically for HTML pages. The reason is that in contrast to books HTML documents are organized and readed differently. Whereas you have in books a chronological order of chapters, the HTML documents are organized in unordered single pages where a page is not necessarily comparable to a chapter in a book. The main problem is that these pages are not ordered in any chronological way, the only way to access such a page is that this page is linked in any (ordered or unordered) index or linked from another page. Whereas books have only a (1-dimensional) sequence, a website is more organized like a mesh, where each page can reference each other page. This is the big advantage (or sometimes the big disadvantage) of a website, that the readers can decide themselfes in which order they want to read the information.
This can be done with doxygen using a style sheet.
Create a file containing:
body {counter-reset:section;}
h1 {counter-reset:subsection;}
h2 {counter-reset:subsubsection;}
h1:before
{
counter-increment:section;
content:counter(section) ". ";
}
h2:before
{
counter-increment:subsection;
content:counter(section) "." counter(subsection) " ";
}
h3:before
{
counter-increment:subsubsection;
content:counter(section) "." counter(subsection) "." counter(subsubsection) " ";
}
Then set HTML_EXTRA_STYLESHEET to point to the file you just created.

How to generate Confluence page based on tabular data

I have some tabular data about users. I would like to have a Confluence page generated based on it. But I don't want to show the data as it is but instead have a nice table made of it.
For example data includes user identifier. But on the page I would like to have it used for few things. For example make an anchor to the user entry/row, show the identifier in a column and generate link (in another column) to some other tools where the identifier is an argument in URL.
This goes in obvious direction of data vs. presentation separation with all its benefits.
Now the problem is that I don't know how to do that while I feel that it should be somehow possible with all that Confluence offers.
There are various reporting macros. But the problem is how to get the initial tabular data. I tried using Excel (or CSV) attachment. But I failed to extract data from it (otherwise than just showing a simple table based on it).
Any advice? I'm using Confluence 5.4.
I have asked about it previously on Atlassian Answers in question Reporting on spreadsheet data from attachment but there are no answers so far and I think there will be none. While I think Stack Overflow is more popular so I hope that maybe here someone will have any advices.
For the 'display table information on the page' part: This could be achieved with a user macro. The CSV macro and HTML macro can be used to pull data in from an attachment or other locations to display on a wiki page.
There are other ways to display this kind of data. This be done with information extracted from a database using the SQL macro. Confluence can read in from its own database or from external databases.
For example, let's say you wanted to list all pages in a space with hyperlinks using the key page information to edit, view, delete the target page. The information being extracted in this example is in the Confluence table.
{sql-query:dataSource=wiki|output=wiki}
SELECT
'['||B.spacename||'|'||B.spacekey||':]' "Space Name",
'['||A.parentid ||'|///pages/viewpage.action?pageId='||A.parentid||']' "Page Parent",
'['||A.contentid||'|///pages/viewpage.action?pageId='||A.contentid||']' "Page Id",
'['||A.title ||'|///viewpage.action?pageId='||A.contentid||']' "Page Title",
'[View Page |///pages/viewpage.action?pageId='||A.contentid||']' "View Page",
'[Edit Page |///pages/editpage.action?pageId='||A.contentid||']' "Edit Page",
'[Delete Page |///pages/removepage.action?pageId='||A.contentid||']' "Delete Page"
FROM wiki.CONTENT A, SPACES B
WHERE B.SPACEKEY = 'sp' -- Put the spacekey here
AND B.SPACEID = A.SPACEID
AND A.TITLE like '%this%' -- Optionally, only return results for pages with the word 'this' in them
-- AND A.CONTENTID = 125999877 -- optionally, only return results for a single page by id
ORDER BY A.TITLE
{sql-query}
Once you have the content on the page it is possible to post-render wiki content using a JavaScript via the html macro.
{html}
<script type="text/javascript">
AJS.$(document).ready(function() {
AJS.$('#tableid').find('tr > td').contents().html('Hello world'); // or whatever to find and change the html or text
});
</script>
{html}
I presume your Confluence is version 4 or later. The default editor is WISIWYG, but you can also enable Source Editor (read Confluence doc on how to do this).
You can create source of a page in external editor and then copy/paste it in to Confluence Source Editor (or use Confluence REST API if you need to import multiple files).
Create a page with sample table, then view source of this page. Copy/paste elements of this page to your tabular data. Use search and replace patterns to insert tags in right places.
For example, if you have CSV file:
- replace commas with </th><th>
- put <tr><th> at the start of each line
- put </th><tr> at the end of each line
This should create nice table in Confluence.

CQ Dialog: Possible to provide placeholder in text?

We have a requirement wherein a section of a page will be part authorable and part dynamic. What I mean by this is "You have 6 visits left out of 16." The 6 and 16 in the sentence are coming from a REST service call but the text "You have...visits left out of.." has to be authorable through dialog. Also, we are using AEM 6.
Thanks in advance
Maybe this solution will help others looking for simple placeholder text for their dialog textfields (OP not so much). Use an emptyText attribute...
<dialogText fieldLabel="AEM CLassic UI Text" jcr:primaryType="cq:Widget"
name="./nameOfText" emptyText="THIS IS THE PLACEHOLDER" xtype="textfield"/>
Perhaps you can start by extending foundation/components/text, where the user would be expected to enter a valid formatable string (i.e. "You have %d visits left out of %d").
In your component you would be implementing text.jsp therefore overriding the default behavior of foundation/components/text, in which you can do something like
<cq:text property="text" escapeXml="true"
placeholder="<%= Placeholder.getDefaultPlaceholder(slingRequest, component, null)%>"
tagName="span"
tagClass="myformatedmessage" />
You use tagName and tagClass which will wind up putting the formattable text in a <span class="myformatedmessage">...</span>. Then use jQuery to find it and populate the format placeholders after getting the data via ajax. All that jQuery code you can probably put into a clientlib folder within the same component you extended.
Based on your description, I think you are looking for replacement or substitution instead of placeholders.
"placeholder" generally refers to display text inside a form input that is displayed until the user enters data in the field (such as hint data).
You generally have 3 options for replacing parts of the data:
Server-side (prevents page from being cacheable in dispatcher). Requires parsing authored content & replace some kind of tags with desired REST data, such as "You have ${x} visits left out of ${y} total". Other ways of "tagging" substitution data could look like "You have %x% visits left out of %y%"
client-side JavaScript DOM manipulation once REST data returns. ie $el.html(newDomContentString)
client-side JavaScript templates (handlebars, dust, etc). Takes more initial setup in JS, but generally scales better.

How to use crystal report user defined page size?

I use
and set the page setup of .rpt
- I checked the No printer option and Dissociate formatting page size
- I chose User Defined Size in dropdown
- I set Unit in pixel (Horizontal: 1200px, Vertical: 816px)
But the report viewer still still shows Letter size and the remaining Columns are not being Displayed ...
you can use Cross-Tab on crystal report so that the page width will automatically adjust depends on number of column.
Interesting question!
I suggest forcing via javascript the width of elements in your page.
A script like this should work (the name of the elements could change, inspect you HTML),
//execute when page is displayed on screen
$(document).ready(function () {
$("#CrystalReportViewer1_toptoolbar").css("width", 1200);
$("#CrystalReportViewer1__UI").css("width",1200));
}
don't foget to add jquery
<asp:ScriptManager ID="ScriptManager1" EnableScriptGlobalization="true" EnableScriptLocalization="true" runat="server" AllowCustomErrorsRedirect="true">
<Scripts>
<asp:ScriptReference Path="~/Scripts/jquery.js" ScriptMode="Auto" />
</Scripts>
</asp:ScriptManager>

How to retain html values on returning with results from servlet

I have a jsp page with 2 textboxes and a submit button and on submitting i get the work done by a servlet based on the textbox values and displays the result retrieved from db in the same jsp page in html table format.
I want to achieve the following:
how to retain the same values in the text box? For example, I select march 3rd (txtbox1) to apr 4th (txbox2). After it returns after submission it should show the same march 3rd and apr 4th in the textboxes.
First time when i reach that page i want the current date to be displayed in those text boxes.
How can i extract the html table data (which i get after submission) as it is in excel and pdf files on button clicks?
Here are my thoughts.
1) how to retain the same values in the text box? For example, I select march 3rd (txtbox1) to apr 4th (txbox2). After it returns after
submission it should show the same march 3rd and apr 4th in the
textboxes.
To retain values in a textbox after back button is clicked or when page is refreshed:
Have the same servlet present the form, process the data, and present the results.
Have one servlet present the form; have a second servlet process the data and present the results. The transferring of variables from one servlet to another could be done using response.SendRedirect or RequestDispatcher.forward() or as HttpSession attributes.
Have a JSP page “manually” present the form; have a servlet or JSP page process the data and present the results.
Have a JSP page present the form, automatically filling in the fields with values obtained from a data object. Have a servlet or JSP page process the data and present the results. To achieve this we need to use JSTL and Struts.
2) First time when i reach that page i want the current date to be displayed in those text boxes.
Using JSTL,
<%# taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:useBean id="now" class="java.util.Date" scope="request" />
<fmt:formatDate value="${now}" pattern="MM.dd.yyyy" />
or Using Scriptlets,
<%#page import="java.util.Date"%>
<%
Date d = new Date();
%>
<%=d.toString()%>
3)How can i extract the html table data (which i get after submission)
as it is in excel and pdf files on button clicks?
What is the best way to convert HTML into Excel
and
Html to PDF