Header and Lines in HTML form question

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Markfre1
Posts: 221
Joined: Sun Mar 11, 2012 10:15 pm
Location: United States

Header and Lines in HTML form question

Post by Markfre1 »

Created a beautiful Invoice in HTML. The InvoiceHeader prints all the data but am not sure how to get the LineItems detail to print. In a REPORT - you can specify the LineItem query as a table or subreport. But in the HTML in AIM there are no options. I tried something like <<InvoiceHeader.LineItems.ProductDescription>> and it just prints the last line of the invoice detail.

Not sure if I somehow have to make the table repeating (know limited html). Or requires javascript? I'm thinking, maybe it's reading the lines since I get the last one? but not repeating?

Basically, I want to send out HTML invoices, with a 'Pay' option in them.

Any direction on this is greatly appreciated. Thank you. Mark
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Header and Lines in HTML form question

Post by Jaymer »

LIST_TABLE_START / END
in User Guide

jaymer...


the cycle:
edit html in editor and save
import the Document Template, overwriting the prior one
save, run
repeat

1. be sure the START and END "cells" have a field in them , exactly like it shows in docs. This is pickier than Magic HTML Merge.
2. When it craps out due to a synatx error, mispelled field, not following step 1, etc., you might just get a spinner and control never comes back to your web screen. I know this happens when doing a merge in excel
3. After a step 2 error, you might find a process running, hogging CPU, that you manually need to kill.
4. Start with two, simple fields before getting more complex.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Markfre1
Posts: 221
Joined: Sun Mar 11, 2012 10:15 pm
Location: United States

Re: Header and Lines in HTML form question

Post by Markfre1 »

Jaymer. I thought those functions were for Excel spreadsheets I must have read wrong we'll look at that when I get back next to a computer. Thank you
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Header and Lines in HTML form question

Post by Jaymer »

LIST_TABLE_START, LIST_TABLE_END
Description:
Whereas the LIST_TABLE function prints the entire table including the header, the combination of LIST_TABLE_START and LIST_TABLE_END functions allows using an existing header of the table. Just like the LIST_TABLE function it prints out members of a list of query results. However, you create the table in the document itself and only mark the start and end of the data. All tags in between the markers represent attributes to be printed (see example). Aware IM automatically inserts extra rows as required.
These functions can only be used inside tags in MS Word, Excel or HTML documents!
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Markfre1
Posts: 221
Joined: Sun Mar 11, 2012 10:15 pm
Location: United States

Re: Header and Lines in HTML form question

Post by Markfre1 »

Excellent. Will try it.

Why were on the subject of header and lineitems, I have a problem with the Report. In the Detail section I created a table to read the detail lines of the invoice. FIND LineItems WHERE LineItems IN InvoiceHeader.LineItems.

I have:
1. Query of Invoices with Multiple checked
2. Have button to print selected invoices
3. Have Document template which has the header and footer info, and the table for the lines items mentioned above.

What happens is if I print 1 invoice it works fine.

If I print two invoices, it prints the correct header, it prints the table linesitems from the first invoice, and right under it, it prints the table for the second set of line items. Then under that it prints the totals for the second invoice.

Like:
Invoice 1
ABC customer Inv 1
Date inv 1

Product, Price, Quantity, Amount (Table header)
Widget 10.00 4 40.00 (inv 1)
Hammer 5.00 3 15.00 (inv 1)

Product, Price, Quantity, Amount (Table header)
Widget 2 10.00 3 30.00 (inv 2)
Hammer 5.00 4 20.00 (inv 2)

Then the comment prints: but it is the comment for invoice # 2

Then the total prints - And its 50.00 which is the total for Inv # 2.

So its like it reads the lines, skips the footer info, jumps to the next set of lines, and then it seems its on that invoice so it prints the totals of the last invoice in this case # 2.

My understanding is if I use a query and multiple is checked, it should process one invoice at a time and my query should be correct for the detail? FIND LineItems WHERE LineItems IN InvoiceHeader.LineItems.

Thanks for any feedback. Mark
Markfre1
Posts: 221
Joined: Sun Mar 11, 2012 10:15 pm
Location: United States

Re: Header and Lines in HTML form question

Post by Markfre1 »

I'm looking at the library sample. The whole report including the sub report is in the Title band. I'm wondering if using a table in the detail band would cause issues???? Mark
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Header and Lines in HTML form question

Post by Jaymer »

Mark, I’m not a super expert on the built in report writer, but in that situation I have the main file of the report as the line items. And the group is on the header.
So group header for the invoice information, then all the line items, then a sub total area,. Works exactly like it should.
It may be able to work with the sub report, etc., but I’ve never done it that way. Just my two cents
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Markfre1
Posts: 221
Joined: Sun Mar 11, 2012 10:15 pm
Location: United States

Re: Header and Lines in HTML form question

Post by Markfre1 »

:( No Luck. I moved the table into the title. Better results but still not right. Sub-report uses the detail band in the Library, but it seems to cause other problems.

Remember when I select 1 Invoice from Query (multiple allowed) it works perfectly. But when checking two invoices the lines and totals of the second are showing on the first. Wondering if its a bug or maybe a different approach. But being able to just click off invoices you want to print it a great and must have feature.

If its a bug, I might be able to take a different approach but not as clean. Maybe click on a field attribute (print), do a query for all checked invoices and print those. Not sure if this would be the same problem, and not as clean. Prefer to use AIM built in multiple allowed functions.

Any further advice is appreciated. Thanks. Mark.
Markfre1
Posts: 221
Joined: Sun Mar 11, 2012 10:15 pm
Location: United States

Re: Header and Lines in HTML form question

Post by Markfre1 »

Jaymer, Did a lot of experimenting. I wanted to have a query where you check off the invoices you want to print. Also, I want 'invoice batch printing' where it prints all the open invoices. After much trial and error and consultation with support, I ended up putting everything in the detail band and the line items as a table. It let me print a batch of selected invoices or all invoices. I thought I solved my problem. Beautiful. Then I made an invoice with more than a page of line items.

It ends up the table just continues and writes over the bottom area.

So my original method using headers, detail, and footer handles the overflow correctly to the next page with a new header, lines and footer, but it will not work on multiple invoices in the print run.

It's a catch 22 at the moment and I am forced to just print 1 invoice at a time. Maybe someone else has a method for printing a bunch of invoices in batch and handle the overflow.

Regarding your method. Could you clarify the steps a little better? Are you doing a FInd of All LineItems, and working from there. Little confused, and maybe you can number the steps. Greatly appreciated.

Mark
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Header and Lines in HTML form question

Post by Jaymer »

sending u a pm to call me
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Markfre1
Posts: 221
Joined: Sun Mar 11, 2012 10:15 pm
Location: United States

Re: Header and Lines in HTML form question

Post by Markfre1 »

Solved. If anyone needs to print invoices in batch, or be able to select multiple invoices from a query for printing or emailing do the following. Query the header. Put everything in the Detail Band. Put a Table for the LineItems also in the Detail band. Make the Detail Table and all attributes after the Detail Table as floating. By making the attributes after the detail band as floating, it handles the situation where the LineItems exceed the page size. Took about a week of experimenting but this works. Mark
Post Reply