Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

distinguish between screen and printer

7 posts in DataWindow Last posting was on 2009-08-27 04:10:38.0Z
Sébastien Kirche Posted on 2009-08-26 08:53:18.0Z
From: =?iso-8859-1?Q?S=E9bastien?= Kirche <sebastien.kirche.no@spam.free.fr.invalid>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: distinguish between screen and printer
X-Face: ;T}O6aj2o*d:|9po%NCuYvExN3]<#cHr0"FaWCh[}WVn6&@L)YWO'&6AO5Ex:MX=H;.^e}o Td*OaFQEBc_xu%+ChwRl!KK`I'["$^aO1gIN{4OyBdO@1HHD5YO#[kiVCk|/-|mmYnU8yTp+eOv."d 1.G3;ro0Q/`,UY+vY/#5b/{OYxE+X\)tc~p~1vbmZ!o4sciW+e8MW|Pz|nl`l*}]8[#1zQO"]d2*{d wrTKu]5t<lBGxO->*Gy_pm3e8o=:(c_ju'zlQ<[oJ|\XjgQQmWZC7S]-Fmp\eBHnBO']/te~/;\@l" D#:h)8Q
Reply-To: =?iso-8859-1?Q?S=E9bastien?= Kirche <sebastien.kirche@free.fr>
Message-ID: <87d46j0xep.fsf@petisuix.seki.fr>
Organization: Aucune.
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (powerpc-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 26 Aug 2009 01:53:18 -0700
X-Trace: forums-1-dub 1251276798 10.22.241.152 (26 Aug 2009 01:53:18 -0700)
X-Original-Trace: 26 Aug 2009 01:53:18 -0700, vip152.sybase.com
Lines: 12
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89825
Article PK: 419013

Hi,

I would like to set an expression for the background color of a computed
field that should be different whether the DW is displayed on screen or
it is printed (and possibly also in print preview mode).

I have tried if ( describe('datawindow.print.preview') = 'yes', 1,0) but
it only works in preview...

How can I do ? Thanks for any help.
--
Sébastien Kirche


Jeremy Lakeman Posted on 2009-08-26 11:51:04.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: distinguish between screen and printer
Date: Wed, 26 Aug 2009 04:51:04 -0700 (PDT)
Organization: http://groups.google.com
Lines: 23
Message-ID: <583cd45a-47f0-4195-b57c-8e0d94ee802c@x25g2000prf.googlegroups.com>
References: <87d46j0xep.fsf@petisuix.seki.fr>
NNTP-Posting-Host: 122.49.168.173
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1251287464 28230 127.0.0.1 (26 Aug 2009 11:51:04 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 26 Aug 2009 11:51:04 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: x25g2000prf.googlegroups.com; posting-host=122.49.168.173; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!x25g2000prf.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89827
Article PK: 419015

On Aug 26, 5:53 pm, Sébastien Kirche

<sebastien.kirche...@spam.free.fr.invalid> wrote:
> Hi,
>
> I would like to set an expression for the background color of a computed
> field that should be different whether the DW is displayed on screen or
> it is printed (and possibly also in print preview mode).
>
> I have tried if ( describe('datawindow.print.preview') = 'yes', 1,0) but
> it only works in preview...
>
> How can I do ? Thanks for any help.
> --
> Sébastien Kirche

I would add a hidden computed field to the report with a constant 1 or
0 value that you set in code when the datawindow is printed or in
print preview mode, then restore afterwards.


Philip Salgannik Posted on 2009-08-26 15:40:55.0Z
From: "Philip Salgannik" <philip@MeMyselfAndI.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <87d46j0xep.fsf@petisuix.seki.fr> <583cd45a-47f0-4195-b57c-8e0d94ee802c@x25g2000prf.googlegroups.com>
Subject: Re: distinguish between screen and printer
Lines: 28
Organization: MeMyselfAndI
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a955787@forums-1-dub>
Date: 26 Aug 2009 08:40:55 -0700
X-Trace: forums-1-dub 1251301255 10.22.241.152 (26 Aug 2009 08:40:55 -0700)
X-Original-Trace: 26 Aug 2009 08:40:55 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89830
Article PK: 419018

You can easily do it in an expression
<DW Control Name>.Describe("DataWindow.Print.Preview")
"Jeremy Lakeman" <jeremy.lakeman@gmail.com> wrote in message
news:583cd45a-47f0-4195-b57c-8e0d94ee802c@x25g2000prf.googlegroups.com...
On Aug 26, 5:53 pm, Sébastien Kirche

<sebastien.kirche...@spam.free.fr.invalid> wrote:
> Hi,
>
> I would like to set an expression for the background color of a computed
> field that should be different whether the DW is displayed on screen or
> it is printed (and possibly also in print preview mode).
>
> I have tried if ( describe('datawindow.print.preview') = 'yes', 1,0) but
> it only works in preview...
>
> How can I do ? Thanks for any help.
> --
> Sébastien Kirche

I would add a hidden computed field to the report with a constant 1 or
0 value that you set in code when the datawindow is printed or in
print preview mode, then restore afterwards.


Sébastien Kirche Posted on 2009-08-26 16:40:53.0Z
From: =?iso-8859-1?Q?S=E9bastien?= Kirche <sebastien.kirche.no@spam.free.fr.invalid>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: distinguish between screen and printer
References: <87d46j0xep.fsf@petisuix.seki.fr> <583cd45a-47f0-4195-b57c-8e0d94ee802c@x25g2000prf.googlegroups.com> <4a955787@forums-1-dub>
X-Face: ;T}O6aj2o*d:|9po%NCuYvExN3]<#cHr0"FaWCh[}WVn6&@L)YWO'&6AO5Ex:MX=H;.^e}o Td*OaFQEBc_xu%+ChwRl!KK`I'["$^aO1gIN{4OyBdO@1HHD5YO#[kiVCk|/-|mmYnU8yTp+eOv."d 1.G3;ro0Q/`,UY+vY/#5b/{OYxE+X\)tc~p~1vbmZ!o4sciW+e8MW|Pz|nl`l*}]8[#1zQO"]d2*{d wrTKu]5t<lBGxO->*Gy_pm3e8o=:(c_ju'zlQ<[oJ|\XjgQQmWZC7S]-Fmp\eBHnBO']/te~/;\@l" D#:h)8Q
Reply-To: =?iso-8859-1?Q?S=E9bastien?= Kirche <sebastien.kirche@free.fr>
Message-ID: <87r5uyzfyk.fsf@petisuix.seki.fr>
Organization: Aucune.
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (powerpc-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 26 Aug 2009 09:40:53 -0700
X-Trace: forums-1-dub 1251304853 10.22.241.152 (26 Aug 2009 09:40:53 -0700)
X-Original-Trace: 26 Aug 2009 09:40:53 -0700, vip152.sybase.com
Lines: 13
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89832
Article PK: 419019

At 17:40 on aoû 26 2009, Philip Salgannik said :

> You can easily do it in an expression
> <DW ControlName>.Describe("DataWindow.Print.Preview")

But as I told in my original post, it does not work when printing. I
tried to show a text with the following expression in the 'visible'
property and it only shows in the preview display, not in the printed
data :

if ( describe('datawindow.print.preview') = 'yes', 1,0)
--
Sébastien Kirche


Philip Salgannik Posted on 2009-08-26 19:45:54.0Z
From: "Philip Salgannik" <philip@MeMyselfAndI.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <87d46j0xep.fsf@petisuix.seki.fr><583cd45a-47f0-4195-b57c-8e0d94ee802c@x25g2000prf.googlegroups.com><4a955787@forums-1-dub> <87r5uyzfyk.fsf@petisuix.seki.fr>
Subject: Re: distinguish between screen and printer
Lines: 24
Organization: MeMyselfAndI
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a9590f2$1@forums-1-dub>
Date: 26 Aug 2009 12:45:54 -0700
X-Trace: forums-1-dub 1251315954 10.22.241.152 (26 Aug 2009 12:45:54 -0700)
X-Original-Trace: 26 Aug 2009 12:45:54 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89835
Article PK: 419023

So you want it to look different 1 when displayed regularly, 2 when
displayed in printpreview and 3 on printed page?
Then you want an expression for display versus print preview 1 and 2) and a
modified dataobject for printing, for e.g. you can get a full state, set it
to a datastore, modify the appearance of objects you want to look different
on printed page and print from the datastore...

"Sébastien Kirche" <sebastien.kirche.no@spam.free.fr.invalid> wrote in
message news:87r5uyzfyk.fsf@petisuix.seki.fr...
> At 17:40 on aoû 26 2009, Philip Salgannik said :
>
>> You can easily do it in an expression
>> <DW ControlName>.Describe("DataWindow.Print.Preview")
>
> But as I told in my original post, it does not work when printing. I
> tried to show a text with the following expression in the 'visible'
> property and it only shows in the preview display, not in the printed
> data :
>
> if ( describe('datawindow.print.preview') = 'yes', 1,0)
> --
> Sébastien Kirche
>


Sébastien Kirche Posted on 2009-08-26 21:47:01.0Z
From: =?iso-8859-1?Q?S=E9bastien?= Kirche <sebastien.kirche.no@spam.free.fr.invalid>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: distinguish between screen and printer
References: <87d46j0xep.fsf@petisuix.seki.fr> <583cd45a-47f0-4195-b57c-8e0d94ee802c@x25g2000prf.googlegroups.com> <4a955787@forums-1-dub> <87r5uyzfyk.fsf@petisuix.seki.fr> <4a9590f2$1@forums-1-dub>
X-Face: ;T}O6aj2o*d:|9po%NCuYvExN3]<#cHr0"FaWCh[}WVn6&@L)YWO'&6AO5Ex:MX=H;.^e}o Td*OaFQEBc_xu%+ChwRl!KK`I'["$^aO1gIN{4OyBdO@1HHD5YO#[kiVCk|/-|mmYnU8yTp+eOv."d 1.G3;ro0Q/`,UY+vY/#5b/{OYxE+X\)tc~p~1vbmZ!o4sciW+e8MW|Pz|nl`l*}]8[#1zQO"]d2*{d wrTKu]5t<lBGxO->*Gy_pm3e8o=:(c_ju'zlQ<[oJ|\XjgQQmWZC7S]-Fmp\eBHnBO']/te~/;\@l" D#:h)8Q
Reply-To: =?iso-8859-1?Q?S=E9bastien?= Kirche <sebastien.kirche@free.fr>
Message-ID: <87iqgaz1sb.fsf@petisuix.seki.fr>
Organization: Aucune.
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (powerpc-unknown-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 26 Aug 2009 14:47:01 -0700
X-Trace: forums-1-dub 1251323221 10.22.241.152 (26 Aug 2009 14:47:01 -0700)
X-Original-Trace: 26 Aug 2009 14:47:01 -0700, vip152.sybase.com
Lines: 31
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89838
Article PK: 419026

At 21:45 on aoû 26 2009, Philip Salgannik said :

> So you want it to look different 1 when displayed regularly, 2 when
> displayed in printpreview and 3 on printed page?

Yes. Actually we can consider that cases 2) and 3) are same.

I have many DWs that for historical reasons show in the header band an
application related title (crossing the whole columns) and the columns
headers with a "button face" background color. The title is not always
adjusted with the same width than the columns. That setting is
acceptable in screen display but it is quite ugly in my application
print preview and in the final printed result. I have found that
print.preview property that let me hide some elements or change their
color but as told it is working only in preview.

> Then you want an expression for display versus print preview 1 and 2)
> and a modified dataobject for printing, for e.g. you can get a full
> state, set it to a datastore, modify the appearance of objects you
> want to look different on printed page and print from the datastore...

That is an interesting solution, that can be automated with some little
code. The titles and the columns headers should be discoverable in the
header band and hopefully all the DWs that should be revamped have a
common ancestor where the processing code could be placed.

I was looking for a simple solution based on a single property, but has
it appears not to exist I have at least some ideas to achieve it.
Thanks.
--
Sébastien Kirche


Jeremy Lakeman Posted on 2009-08-27 04:10:38.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: distinguish between screen and printer
Date: Wed, 26 Aug 2009 21:10:38 -0700 (PDT)
Organization: http://groups.google.com
Lines: 53
Message-ID: <4eedb0bf-2f6a-4c93-a263-9276553c82ff@g23g2000vbr.googlegroups.com>
References: <87d46j0xep.fsf@petisuix.seki.fr> <583cd45a-47f0-4195-b57c-8e0d94ee802c@x25g2000prf.googlegroups.com> <4a955787@forums-1-dub> <87r5uyzfyk.fsf@petisuix.seki.fr> <4a9590f2$1@forums-1-dub> <87iqgaz1sb.fsf@petisuix.seki.fr>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1251346238 5269 127.0.0.1 (27 Aug 2009 04:10:38 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 27 Aug 2009 04:10:38 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: g23g2000vbr.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!g23g2000vbr.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89840
Article PK: 419028

On Aug 27, 6:47 am, Sébastien Kirche

<sebastien.kirche...@spam.free.fr.invalid> wrote:
> At 21:45 on aoû 26 2009, Philip Salgannik said :
>
> > So you want it to look different 1 when displayed regularly, 2 when
> > displayed in printpreview and 3 on printed page?
>
> Yes. Actually we can consider that cases 2) and 3) are same.
>
> I have many DWs that for historical reasons show in the header band an
> application related title (crossing the whole columns) and the columns
> headers with a "button face" background color. The title is not always
> adjusted with the same width than the columns. That setting is
> acceptable in screen display but it is quite ugly in my application
> print preview and in the final printed result. I have found that
> print.preview property that let me hide some elements or change their
> color but as told it is working only in preview.
>
> > Then you want an expression for display versus print preview 1 and 2)
> > and a modified dataobject for printing, for e.g. you can get a full
> > state, set it to a datastore, modify the appearance of objects you
> > want to look different on printed page and print from the datastore...
>
> That is an interesting solution, that can be automated with some little
> code. The titles and the columns headers should be discoverable in the
> header band and hopefully all the DWs that should be revamped have a
> common ancestor where the processing code could be placed.
>
> I was looking for a simple solution based on a single property, but has
> it appears not to exist I have at least some ideas to achieve it.
> Thanks.
> --
> Sébastien Kirche

Here's a suggestion;

assuming all datawindows are inheritted from u_dw. override the 3
print functions, set a global boolean gb_printing, and then call the
ancestor like so;

public function integer print ();
integer il_ret

gb_printing = true
il_ret = super::print()
gb_printing = false

return il_ret
end function

Then create a global function boolean f_printing() that returns this
global.
You can then use this function in your visible expression.