HTML does not support headers of tables - this is only supported by WPTools and a few RTF consumers.
I don't know what border flags you need. In special cases it makes sense to change the code in WPIOHTML.pas to writen the CSS styles you need. I do not exactly know which one you need-
Would it be possible to access the created table from within the implementation of wpMailMergeGetText? Then I could code styles into the bookmarks and implement them on the resulting table object using the power of WPTools.
As this is not processed on in wpMailMergeGetText I will collect the objects while merging and process them after the megre process is complete. This should work. Thanks.
I store all content.mergepar in wpMailMergeGetText for all tables I insert. Either in wpMailMergeGetText and after completion of the merge both parentRow and parentTable are NIL.
A template is loaded as docx, all the variables are just test phrases and are marked as bookmarks and get overwritten. One of the variables will be overwritten by a complete table served as html. I was hoping to find that table (or tables) later in the process along with theit bookmark names to do additional formatting like repeating headers and cell lines.
It would be great if I could somehow access the (table-)object that was created by the merge process.
Thanks. I created this loop and found the table(s). Sorry for bugging again, but I can not find out how to reformat the table to make the frst row recurring on subsequent pages and how to create grey lines between the rows. The examples worked with callbacks on page creation, this I cannot use here.
Would you mind helping me out and showing how to:
using the "par" below make the first row recurring
optinally draw lines between the rows
Thanks in advance
par := wp.firstPar;
while par <> nil do
begin
if par.IsTable then begin
// And now, what's next?
end;
par := par.nextPar;
end;
So finally I nearly got everything how I want it. The last thing I need help with: How do I make the first row of the table the repeating header.?I did not find a WPAT code for that. Would you mind helping me with this? Thanks in Advance!
par := wp.firstPar;
while par <> nil do
begin
if par.IsTable then
begin
first := true;
row := par.Childpar;
while row <> nil do
begin
//
if not first then
begin
cell := row.Childpar;
while cell <> nil do
begin
cell.ASet(WPAT_BORDERFLAGS, WPBRD_DRAW_TOP);
cell.ASetColor(WPAT_BORDERCOLORT, clSilver);
cell := cell.nextPar;
end;
end
else
begin
begin
row.ASetColor(WPAT_BGColor, clSilver);
row.ASet(WPAT_ShadingValue, 30);
first := false;
end;
end;
row.ASet(WPAT_ParKeepN, 1);
row := row.nextPar;
end;
end;
par := par.nextPar;
end;
wp.ReformatAll;
P.S. I am aware of the fact, that HTML does not support repeating headers, I was jiust thining that one could use <th> for Headers that are repeated in the document.