Reports with pandas, nympy and weasyprint

colseq = (1,2,3,4,5,6,10,8,9)I had an issue with printing the date in a report in the French dd-mm-yyy fromat.

I could not find a way to change the format of a date to the correct format as the original field was a date field. I tried using a format function, but that function was not called for date fileds.

The solition was simple, add a new column to the pandas array.

cost['TransDt'] = pd.Series(cost['TRANS_DT'].dt.strftime('%d-%m-%Y'), index=cost.index)

and then hide the original date column from the output.

colseq = (1,2,3,4,5,6,10,8,9)

template_vars = {"title" : "Gezinsuitgaven", "uitgaven": cost.to_html(formatters=fmt, decimal=',', columns = colseq, escape=False) ,"results": get_summary(cost) }

html_out = template.render(template_vars)