[Solved] Autorefresh plus formatting of pivot report

Creating and using forms
Post Reply
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

[Solved] Autorefresh plus formatting of pivot report

Post by gkick »

Hi all,

This should be in Calc, but no idea in which subforum to post this.

My reportmenu in base has a button which calls up a calc file containing a linked pivot amongst other stuff.
Is it possible to first do a autorefresh and then apply a standard format since the refresh kills the original format.
If so in calc would one do that with recording a macro ?

Thanks
Last edited by gkick on Tue Nov 12, 2019 4:20 am, edited 1 time in total.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: autorefresh plus formatting of pivot report

Post by Villeroy »

Pivot table number formats are broken when data come from database queries. No way to configure anything.
Anything else (font, size, color) can be configured through styles.

I use this with my report spreadsheet to refresh all database ranges and all pivot tables.:

Code: Select all

Sub Main
	for each dbr in ThisComponent.DatabaseRanges
		dbr.refresh()
	next dbr
	for each sh in ThisComponent.getSheets()
		for each dp in sh.DataPilotTables
			dp.refresh()
		next dp
	next sh
End Sub
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
gkick
Posts: 324
Joined: Wed Aug 07, 2019 5:24 pm
Location: Chile

Re: autorefresh plus formatting of pivot report

Post by gkick »

Thank you, oh well at least we have a pivot. Very interesting, hardly any of the heavy duty dbs seem to support pivots, exception being H2 (not sure if that one is heavy duty though.
Libre Office 6.4.6 on Windows 10 HSQL 2.51 backend
Post Reply