Word 2010 Show Table only in footer of last page - ms-word

I've a template for word. In header and footer I've got logos of my company. The data of word is generating automatically from ERP program (that works great).
I only want to show some table with data on last page. I've tried this this method But it only works for text. When I'm updating the field the table and it's content disappear.
Anyone knows how to apply this method on table? It must to be automatic.

The same method works for block level content such as paragraphs or tables. Simply follow the same steps but instead of typing "Initials" insert your table there. Make sure to use speechmarks in the conditional e.g it should look like this { IF {PAGE} = {NUMPAGES} "" "(table)" }

Related

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.

Merging documents using OpenXml and section breaks causes empty paragraphs

I am stitching a couple of documents together with a requirement that each document should retain its header and footer information in the final document. Using AltChunk instead of raw OpenXml or DocumentBuilder saves a lot of effort with regards to styles, formatting, references, parts, etc.
Unfortunately, after a couple of days I can't seem to get a 100% working version due to a small and frustrating issue and I need some insight.
My code is loosly based on this article
I modify each sub document, prior to appending it (as an AltChunk) to a working document, by moving the last section properties into the last paragraph (in order to retain header and footer references), but Word seems to be adding a blank paragraph to each of these documents as it renders them in the final document. I end up with:
document 1 with correct header and footer
section properties/break
blank paragraph
document 2 with correct header and footer
section properties/break
blank paragraph
etc.
I cant remove the blank paragraphs afterwards, as I ideally don't want to use WAS to render the document first.
It seems as if you cannot have a next-page section break without a following paragraph?
After further investigation, it seems that will not be away around my usage scenario. I would need to place the last section properties in the body element, but due to my way of processing with nested AltChunk, it would not work.
I have changed my approach completely and went back to a more detailed append procedure using OpenXml Power Tools and some LINQ to Xml.
I'm using Document Builder and works perfectly for me!
var sources = new List<OpenXmlPowerTools.Source>();
sources.Add(new OpenXmlPowerTools.Source(new WmlDocument(#tempReportPart1)));
sources.Add(new OpenXmlPowerTools.Source(new WmlDocument(#tempReportPart2)));
var outputPath = #"C:\Users\xpto\Documents\TestFolder\myNewDocument.docx";
DocumentBuilder.BuildDocument(sources, outputPath);
I have the similar empty paragraph issue while importing HTML files.
My solution is,
After inserting HTML AltChunk, I add a GUID place holder. After processing the file, I will open the file again, locate the GUID and check if there is a empty paragraph before it, if so remove the empty paragraph and GUID. it seems work perfectly in my solution.
Hope it helps.

Table of contents with page number - how to implement

Is it possible to implement Table of contents with page number on first page of the PDF report?
I've read the below links and refered in google:
1) http://community.jaspersoft.com/questions/541300/table-contents-ireport
2) http://community.jaspersoft.com/questions/529040/generation-page-numbers-table-content
On first link, They are using scriptlets for this. I want Table of contents with page number on the first page of pdf report. But I do not understand where to start. Any ideas?
I would recommend you checking this sample from the original documentation.
There is no way (or at least I don't know/haven't found how) to generate the Table of Contents at the beginning (since there is no way to know the pages numbers). So you will have to generate it at the end (in the summary band) and move it afterwards to where you want to place it. To move it use JasperPrint class, methods getPages, addPage, removePage.
I guess you will have subreports, if so, you need to pass the JRBeanCollectionDataSource you will be filling during runtime to each subreport (and return the value back to the master report).
Hope that helps.

How to add a simple text label in a jqGrid form?

When using the Add or Edit form from the pager I'm wondering how a simple static label can be added in the form without it creating any additional columns in it's affect on colNames[]'s and colModel[]'s. For example I have a quite simple typical Add form which opens from the pager containing a few label's and form elements: Name, Email, Web Site, etc., and then the lower section of the form has a few drop down menus containing the number 1 through 10 with the idea being to ask the user to pick a value between 1 and 10 to put a value on the importance to them about the product or service which is listed beside it. Just above this section I want to add some text only to give a brief instruction asking the user to "Choose the importance of the following products and services using the scale: [1=Low interest --- 10=Very high interest]". I cannot figure out how to get a text label inserted in the form without having to define a column with a formoption{} etc which is not needed for just some descriptive text. I know about the "bottominfo: 'some text'" for adding text to the bottom of the form but I need to insert some text similar to that mid-way (or other positions) in the form without it affecting the tabular structure of the grid. Is this even possible? TIA.
You can modify Edit or Add forms inside of afterShowForm. The ids of the form fields are like "tr_Name". There consist from "tr_" prefix and the corresponding column name.
I modified the code example from my old answer so that in the Add dialod there exist an additional line with the bold text "Additional Information:". In the "Edit" dialog (like one want in the original question) the input field for one column is disabled. You can see the example live here. I hope that a working code example can say more as a lot of words.

How to change the SSRS input parameters position in report

My SSRS report contains 7 input parameters and while running my report the size of the parameter(i.e. length) is increasing.
One of my input parameter(drop down list) may contain 100 characters so the size is not constant but i want to place all parameters in 2 lines or 3 lines(in a row).
Now it is coming 2 parameters per a row
Please advice
As gbn indicates, it's not easy to change the built in report server method of presenting the parameters. SSRS likes to always use two parameters per line, presented in the order that they exist in the report (which must match the dependency order.)
So the alternatives that gbn mentions: Both involve building a "Wrapper" application: some custom code or a web page that you can code however you like to get the parameters. Then you call Reporting Services, either in code or by passing a formatted URL with your parameters. The report can be displayed in a frame, new window, or passed as a stream to where ever you'd like.
The URL access is pretty straightforward and reliable: I often use it either by hand (to create "favorites") or in code.
http://msdn.microsoft.com/en-us/library/ms153586.aspx
For what you are looking for, these might be more work than you expected, but they will be extremely flexible for your interface.
Jamie
You can certainly do that, just right click on the RDL file in the solution explorer and select view code. then move the XML tags named <ReportParameter Name="Nameofparameter"> under <ReportParameters> according to where ever you want to position. And then save it. thats it!!!
The report parameters are kind of floating in values of 2, so if u have 4 report parameters then it will be shown as 1,2 next line 3,4. Best of luck!!
Use ASP.NET for the paramaters and a ReportViewer control or URL access to render. Seriously.
I don't know of any option to present parameters any way other then the default
I believe you could try using jQuery. The report parameters are rendered in a table under a div tag with class sqlrv-ParameterContainer. Write a jQuery or JavaScript function that will extract the full innerHTML from this div ie. the table content and then extract the table row information like the <label> or <input> tags.
Create your desired table structure with <table><tr><td>{extracted sections}</td><td></td></tr></table> or leave it to your requirement...
Then just append this new HTML structure in place of the original default structure.
In jQuery it will be like
$(".sqlrv-ParameterContainer").html();
which will give you the entire table structure that comes inside the parameter. Use XML parsing and get the input controls and all. Extract these controls as-is, don't change anything.
$(".sqlrv-ParameterContainer table").remove(); // it will remove the SSRS rendered default table from DOM
$(".sqlrv-ParameterContainer table").appendChild('<table><tr>......</tr></table>'); // Append your custom html structure here....
This was something that came to my mind quickly... I would suggest you test it... :)
This doesn't help the OP with SSRS-2008 but in case it helps others - Microsoft have improved this in SSRS 2016 - parameters can now be easily managed via the GUI in Report Builder / Visual studio:
https://www.intertech.com/ssrs-parameters-2016-update/