Jump to content

Stufenprojekt - Reportseiten auf Flipbook stellen / stage project - set reportpages on flipbook


Recommended Posts

Hallo Zusammen,

hat jemand zufälligerweise ein Python-Script, welches bei einem Stufenprojekt alle Reportseiten einzeln auf Flipbook stellt?

Über die Makroaufzeichnung bekomme ich den Befehl leider nicht getracked.

 

Hello together,

does anyone coincidentally have a python script that will set each report page to flipbook?

Unfortunately, I do not get the command tracked via the macro recording.

 

  • 3 weeks later...

Danke Hanno.

Anbei das fertige Programm, wenn jemand mal Bedarf haben sollte:


# -*- coding: utf-8 -*-

import gom

reportPages = []
selectedPages = []
indexSelectedPages = []

# Auslesen der Reportseiten
for t in gom.app.project.reports:
	reportPages.append(t.name)

# Dialog
RESULT=gom.script.sys.execute_user_defined_dialog (content='<dialog>' \
' <title>Automatsierung Flipbook</title>' \
' <style></style>' \
' <control id="OkCancel"/>' \
' <position>automatic</position>' \
' <embedding>always_toplevel</embedding>' \
' <sizemode>automatic</sizemode>' \
' <size height="163" width="255"/>' \
' <content rows="1" columns="1">' \
'  <widget columnspan="1" row="0" rowspan="1" type="display::text" column="0">' \
'   <name>text</name>' \
'   <tooltip></tooltip>' \
'   <text>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">' \
'&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">' \
'p, li { white-space: pre-wrap; }' \
'&lt;/style>&lt;/head>&lt;body style="    ">' \
'&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- bitte Reportseiten auswählen!&lt;/p>' \
'&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">- mit &amp;quot;OK&amp;quot; bestätigen!&lt;/p>' \
'&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;br />&lt;/p>' \
'&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;br />&lt;/p>&lt;/body>&lt;/html></text>' \
'   <wordwrap>false</wordwrap>' \
'  </widget>' \
' </content>' \
'</dialog>')

# Auslesen der Selektion
for elem in gom.ElementSelection ({'category': ['key', 'elements']}):
	if elem.is_selected:
		#print (elem.name)
		selectedPages.append(elem.name)

# Indexsuche der Selektion
for t in selectedPages:
	#print(t)
	indexSelectedPages.append(reportPages.index(t))

# Umstellen auf FlipBook
for t in indexSelectedPages:
	print(t)
	gom.script.report.update_report_page (
	pages=[gom.app.project.reports[t]], 
	flipbook=True)

 

  • 3 months later...

Hallo,

dann wird flipbook auf 'false' gesetzt:

import gom

gom.script.report.update_report_page (
	pages=[gom.app.project.reports['report 3']], 
	used_alignments='report', 
	used_digits='report', 
	used_legends='report', 
	used_stages='report', 
	used_units='report',
	flipbook='false')

Gruß,
Nanno

×
×
  • Create New...