Bug 157279 - EDITING : ReportBuilder : Can't change the Application-BackGround of preview report
Summary: EDITING : ReportBuilder : Can't change the Application-BackGround of preview ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.6.0.3 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Reports-Builder
  Show dependency treegraph
 
Reported: 2023-09-16 21:01 UTC by TISSENDIER Pierre
Modified: 2024-12-21 10:31 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Base Test change Application-Background (14.64 KB, application/vnd.oasis.opendocument.database)
2023-09-16 21:05 UTC, TISSENDIER Pierre
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TISSENDIER Pierre 2023-09-16 21:01:57 UTC
Description:
I would like to be able to change the color of the background (Writer) when the report appears.
In Basic I use the instruction: Frame.containerwindow.setbackGround (0) to have a black background, but it does not work.
Is it normal?

Steps to Reproduce:
1.Open my base
2.open Basic EDI
3.launch "openreport" (F5)

Actual Results:
Application Background is white

Expected Results:
Application background dark or other color


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.6.0.3 (X86_64) / LibreOffice Community
Build ID: 69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265
CPU threads: 4; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 1 TISSENDIER Pierre 2023-09-16 21:05:47 UTC
Created attachment 189633 [details]
Base Test change Application-Background
Comment 2 Alex Thurgood 2023-09-17 16:45:26 UTC
@Pierre: shouldn't you be using :

https://wiki.documentfoundation.org/Documentation/DevGuide/Office_Development#Window_Interfaces

in particular, something like :

xPeer.setBackground(0xFFFFFFFF)
Comment 3 TISSENDIER Pierre 2023-09-17 20:35:41 UTC
(In reply to Alex Thurgood from comment #2)
> @Pierre: shouldn't you be using :
> 
> https://wiki.documentfoundation.org/Documentation/DevGuide/
> Office_Development#Window_Interfaces
> 
> in particular, something like :
> 
> xPeer.setBackground(0xFFFFFFFF)

thank you. @alex
It's very hard for me, i'm not very experimented LO's API. In xray i see com.sun.star.awt.xWindowPeer only in ContainerWindow.Toolkit.DesktopWindow but this property is <null> 

Really, i thing, it is not possible. It is LO who create the container "writer" before include the report, so I don't see how to intervene on the container, before.
Comment 4 TISSENDIER Pierre 2023-09-17 21:03:43 UTC
I experimented : 
1-Change application-background in menu Tools>options>Interface colors> application background, choice any color
2-Execute routine "openreport"
Result :
First the background container writer is ok
When report is include background is set blank (automatic)
if you want, you can reset the right background color with Tools>options>Interface colors> application background :o((
Comment 5 Alex Thurgood 2023-09-19 15:54:37 UTC
I can confirm that the preview report doesn't open with the changed application background colour preferences when I set it to a colour other than the default before loading the preview report from the ODB file.

I couldn't find where your macro was in the test ODB file in order to test whether execution of the macro changes the background colour.

The question remains as to why the preview report doesn't adopt the default application background colour even when this is set application-wide and LO restarted ?
Comment 6 Alex Thurgood 2023-09-19 15:55:07 UTC
Tested with 

Version: 7.6.1.2 (AARCH64) / LibreOffice Community
Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674
CPU threads: 8; OS: Mac OS X 13.4; UI render: Skia/Raster; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 7 TISSENDIER Pierre 2023-09-19 16:03:37 UTC
(In reply to Alex Thurgood from comment #5)
> I can confirm that the preview report doesn't open with the changed
> application background colour preferences when I set it to a colour other
> than the default before loading the preview report from the ODB file.
> 
> I couldn't find where your macro was in the test ODB file in order to test
> whether execution of the macro changes the background colour.
> 
> The question remains as to why the preview report doesn't adopt the default
> application background colour even when this is set application-wide and LO
> restarted ?

"I couldn't find where your macro was in the test ODB"
Normally it is a basic macro named openreport in Standard/module1/OpenReport

Sub OpenReport
Dim oDoc As Object 
Dim oRpt As Object 

'Eventually launch Xray
With GlobalScope.BasicLibraries
	If .hasByName("XrayTool") Then 
		.loadLibrary("XrayTool")
	End If 
End With 

'connect base
ThisDataBaseDocument.CurrentController.connect()


oRpt =ThisDataBaseDocument.ReportDocuments.getByName("rptSoldeEvenement").Open 

'xray oDoc
'oRpt =oDoc.Open

oRpt.CurrentController.ViewSettings.ZoomValue=60
With oRpt.CurrentController.Frame
	.ContainerWindow.setBackground(clng("&H00FFFF80")) 'mon vert
'	.ContainerWindow.setBackground(0) 'noir
	.ContainerWindow.isMaximized=False
	.ContainerWindow.setPosSize(250,250,500,700,15) 'x,y,largeur,hauteur,flag
	.LayoutManager.HideCurrentUI=True 'pour supprimer les barres d'outils
	.LayoutManager.hideElement("private:resource/menubar/menubar") 'pour supprimer la barre de menu
'	.LayoutManager.showElement("private:resource/menubar/menubar") 'pour afficher la barre de menu
	.Title ="Test Background Report"

End With 

End Sub


Thank for your investigation.