How to create multipage report using Spring? - spring

How do I generate a multipage report in iReport where each page contains different invoice of a customer?
Also, each invoice will get its own datasource which is the detail as well as a support form of payment.
I've found how to implement a subreport here:
http://krams915.blogspot.com/2010/12/spring-3-mvc-jasper-sub-reports-using.html but I don't know how to create the multipage.

You can use page break after subreports. The contents after page break will be displayed in another page .

Related

Printable templates for Custom Modules

I have a requirement to setup customized printable for few Custom Modules to let the record owner print  the details of the currently opened record, similar to Invoice Template or Sales Order Template. 
Use Case:
Record Owner opens a record from Custom Module
A custom button Print Record will appear when a record is opened
On clicking the Print Record button, a PDF document with data of the opened record must be generated  based on a template (similar to Invoice template) and either download the generated PDF record owner's local drive or send the generated PDF to a specific email address 
Is there a way to set up Invoice Templates for Custom modules? It can be achieved with Mail Merge but I need the outcome as a PDF document and with Mail Merge doing that would require several clicks. I need the PDF to be generated on a single button click.
Also, can the aforementioned use case be automated? Automatically generate a PDF based on a template periodically and send it by email without the user having to navigate the record and print the PDF manually?
I would appreciate any guidance on this use case.

Liferay 7.2: Open asset publisher viewURL in a Display Page Template

I am using Liferay 7.2. I want to display the viewURL link of an asset publisher in a Display Page Templates page. I couldn’t solve the problem. After searching, I realized that this problem can be solved in three ways:
Method 1:
1- As and admin, in Web Content>Structures create a structure (News Article) and make a Template for that structure.
2- Create page A and add an asset publisher. In this asset publisher: In Asset Selection choose Web Content Article as Asset Type and choose News Article as sub structure. In Display Setting tab choose View in Context as Asset Link Behavior.
3-In Site Builder>Pages create a Display Page Template (page B). Edit it and add an asset publisher similar to page A. However, in page B, in Configuration of asset publisher, in Display Settings choose Show Full Content as Asset Link Behavior and tick Set as the Default Asset Publisher for This Page and Show only assets with Page B as its display page template.
4-Create some News Article. In Display Page Template section, choose Specific Display Page Template and Page B.
In page A, everything is OK. However, when I click on ViewURL of an asset entry, it will redirect to page B. But, in asset publisher section of page B, no results is shown (There are no results.). Means that the chosen asset of page A is not shown in Display Page Template of page B.
Method 2:
Maybe the simplest method is editing Display Page Template (page B) in Section Builder>Content Display add Display Page Template. However, as stated in this issue , the display page content section only shows the summary and no style can be shown. Maybe it is necessary to edit abstract.jsp file. But, I don’t know how to do this.
Method 3:
Create a Widget Template and add it to page B. The article data of the selected asset can be obtained from the URL. However, I couldn’t get the data of the selected article.
I appreciate for any help in this regard.
An Asset Publisher instantiated in a Display Page Template won't show the page Web Content. One way to show an Web Content in a Display Page Template, is to instantiate a Fragment and map the Web Content fields to it, as shown here.
So, to solve your problem, you would need to change Page's B Asset Publisher to one or more Fragments, and map your News Article fields to them.
You could also map the Web Content to your own custom Fragmets, using Fragments lfr-editable fields
<lfr-editable id="unique-id" type="text">
This is editable text!
</lfr-editable>
Another way is to get the Web Content Java Object instance inside a Freemarker (a Fragment, Widget Template, Web Content Template, etc) with this snippet (only works for 7.3+)
${Request.INFO_ITEM}

Facebook feed dialog deprecating custom fields

Facebook Feed Dialog 2.9 has deprecated the custom fields (name, caption, picture, description) - https://developers.facebook.com/docs/sharing/reference/feed-dialog.
I'm working on an AJAX site where all content and metadata is loaded dynamically. If I just use the link property, the metadata isn't set on initial retrieval of the page so the post doesn't contain the right content.
How can I share an AJAX page on Facebook without having to go down the route of prerendering static pages server side? Thanks
If you can program your page to populate the appropriate metatags on the page load based off of a variable http:/yoursite.com/yourpage.php?thisversion=1 then when you want to share version 1 of the page, you just share the URL with the appropriate variable to populate it. You can still remain on your current version of the page but when you share the URL that would prompt that specific version, facebook makes a call to that respective URL and pulls the appropriate metatags that would be populated by your variable without having to reload the page your are currently displaying. Sorry I don't have time at the moment but will try and comeback and add some sample code for clarity.

Joomla component - how to convert standard php form into joomla component

Currently i have been using an iframe component to display a php page that i have written. the reason i used iframe rather than writing a joomla component in the first place was for 2 reasons, the information that is displayed in that page is from a remote mssql sever and the second was that i didnt really understand how to write one.
Now i have completed the creation of the php page that i display within the iframe, but now i need to be able to have it inherent within the joomla site, for both display reasons and security.
basically its a single page that displays information in a bunch of drop down boxes and then a submit button is clicked and it posts that information to another php page that again queries the mssql server and displays the results based on the post from the previous page.
query.php, posts some variables to results.php and is displayed in a table.
i have the functionality perfect, but i dont understand the documentation i have read so far. is there any simple component i can see the code of so that i can try and work out whats going on?
You might want to look at http://docs.joomla.org/J3.1:Developing_a_MVC_Component/Introduction and follow the process outlined.

Generate PDF from view using iTextSharp

My requirement is to have a button in my view and clicking on that should generate a PDF report from that view. (Should avoid making another trip to database to get data for the PDF report).
I decided to use iTextSharp. Could some body please post some examples or direct me to a proper article?
I answered something similar on this link.
You will need to sort out the caching of the data from the DB though, this version just queried it again.
How to make a pdf report of a particular view in mvc3

Resources