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
Created attachment 189633 [details] Base Test change Application-Background
@Pierre: shouldn't you be using : https://wiki.documentfoundation.org/Documentation/DevGuide/Office_Development#Window_Interfaces in particular, something like : xPeer.setBackground(0xFFFFFFFF)
(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.
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((
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 ?
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
(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.