Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8066857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:07:21+00:00 2026-06-05T12:07:21+00:00

I have a printed export from an html file that it takes imports from

  • 0

I have a printed export from an html file that it takes imports from a Map as shown below

Template t = TemplateLoader.load("Printing/acount.html");
Map<String, Object> map = new HashMap<String, Object>();
map.put("accountName ", e.accountName);
map.put("accountAmount ", acAmount);
    return t.render(map);

And loads the parametres to the html file

<div>
     Account: <font size="3"><b>${ accountName }</b> ${accountAmount}</font> <br/>

And its export looks like

Account 15884 5.000

What if I want to have multiple records in my export?

Lets say

Account 15885 2.000

Account 15886 4.000

Account 15887 3.000

How should be the html and java code in the second case in order to pas an uknown number of records?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T12:07:22+00:00Added an answer on June 5, 2026 at 12:07 pm

    You are now creating a Map with values for accountName and accountAmount. What you should do is add a list of objects that each contain a value for accountName and accountAmount.

    It would look something like this:

    Map<String, Object> map = new HashMap<String, Object>();
    List<Account> accounts = new ArrayList<Account>();
    map.put("accounts", accounts);
    return t.render(map);
    

    In your template you can then iterate over the items in ${ accounts } (e.g., for each account in accounts) and print each value of account.name and account.amount.

    I’m not familiar with the exact syntax of these templates but the approach should be along these lines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that generates around 10000 printed pages per month. Each report
I have a project with graphs that can be printed. When you click the
If I have the following data that is printed seperated by tabs using print
I have a web application that has a report. I export this report as
I have a PHP script that uses cURL to access a file also located
I have some code that uses ctypes to try to determine if the file
We are using HTML/XML/CSS to export a table to excel 2007. I have the
i have printed out the contents of an array/object (named 'document') with print_r. it
i have checkbox list printed in one column, but i need it to print
I have clients who still using dot matrix for making copies of printed documents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.