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.

Use datastore in Web form code-behind

10 posts in DataWindow .NET Last posting was on 2004-09-15 19:48:03.0Z
Colin Bradley Posted on 2004-09-08 07:34:00.0Z
Sender: 5468.413c1993.1804289383@sybase.com
From: Colin Bradley
Newsgroups: sybase.public.datawindow.net
Subject: Use datastore in Web form code-behind
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <413eb785.6fba.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 8 Sep 2004 00:40:56 -0700, 10.22.241.42
Lines: 37
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 8 Sep 2004 00:22:35 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 8 Sep 2004 00:34:00 -0700
X-Trace: forums-1-dub 1094628840 10.22.108.75 (8 Sep 2004 00:34:00 -0700)
X-Original-Trace: 8 Sep 2004 00:34:00 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:322
Article PK: 124755

I am developing a new web application. I have some reports
in old legacy system that are written in PB but have to
migrate to web. So I migrate the old dw by Datawindow
Designer first. And I decide to instance a datastore in web
form code-behind, set its datawindow object and retrieve,
then save the output as pdf or excel and redirect the saved
file back to the browser. The following is the piece of C#
codes:

Sybase.DataWindow.DataStore ds = new
Sybase.DataWindow.DataStore();
this.oleDbConnection1.Open();
Sybase.DataWindow.AdoTransaction tran = new
Sybase.DataWindow.AdoTransaction(this.oleDbConnection1);
tran.BindConnection();
ds.LibraryList = "D:\rpt.pbl";
ds.DataWindowObject = "d_customer_list";
ds.SetTransaction(tran);
ds.Retrieve();
ds.SaveAs(@"D:\customerlist.xls",
Sybase.DataWindow.FileSaveAsType.Excel, true,
Sybase.DataWindow.FileSaveAsEncoding.Utf8);
Response.Redirect(@"D:\customerlist.xls");

However, the saved excel file must be corrupted. But the
same piece of codes work well in Winform (no
response.redirect certainly). Would anyone can tell me what
is happening in Webform leading to the excel format
corruption?

On the other hand, when I save the same datastore as pdf in
web, a saveas exception is thrown. But I've followed what
is described in manual and put Ghostscript 705 folder into
the Datawindow.NET folder.

Thanks,
Colin


dfish Posted on 2004-09-08 13:31:40.0Z
From: dfish@_no_spam_sybase.com (Dave Fish [Team Sybase])
Newsgroups: sybase.public.datawindow.net
Subject: Re: Use datastore in Web form code-behind
Organization: Sybase Professional Services
Reply-To: nospam_dfish@sybase.com_nospam
Message-ID: <413f04f3.79794278@forums.sybase.com>
References: <413eb785.6fba.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vpn-dub-063.sybase.com
X-Original-NNTP-Posting-Host: vpn-dub-063.sybase.com
Date: 8 Sep 2004 06:31:40 -0700
X-Trace: forums-1-dub 1094650300 10.22.120.63 (8 Sep 2004 06:31:40 -0700)
X-Original-Trace: 8 Sep 2004 06:31:40 -0700, vpn-dub-063.sybase.com
Lines: 56
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:326
Article PK: 124757

I think this may be related to how the code is accessed in an ASP .NET
application. I see similar issues and I wonder if it is a permissions
thing. What user is invoking the code-behind at runtime? Does that
user have permission to write to the file system? I'll play around
with this and see what I come up with. In the meantime look into the
permissions settings.

Regards,
Dave Fish
Sybase

TeamSybase blogs: http://www.teamsybase.net/blogs

DataWindow.NET code examples available on CodeXchange:
http://datawindownet.codexchange.sybase.com

On 8 Sep 2004 00:34:00 -0700, Colin Bradley wrote:

>I am developing a new web application. I have some reports
>in old legacy system that are written in PB but have to
>migrate to web. So I migrate the old dw by Datawindow
>Designer first. And I decide to instance a datastore in web
>form code-behind, set its datawindow object and retrieve,
>then save the output as pdf or excel and redirect the saved
>file back to the browser. The following is the piece of C#
>codes:
>
>Sybase.DataWindow.DataStore ds = new
>Sybase.DataWindow.DataStore();
>this.oleDbConnection1.Open();
>Sybase.DataWindow.AdoTransaction tran = new
>Sybase.DataWindow.AdoTransaction(this.oleDbConnection1);
>tran.BindConnection();
>ds.LibraryList = "D:\rpt.pbl";
>ds.DataWindowObject = "d_customer_list";
>ds.SetTransaction(tran);
>ds.Retrieve();
>ds.SaveAs(@"D:\customerlist.xls",
>Sybase.DataWindow.FileSaveAsType.Excel, true,
>Sybase.DataWindow.FileSaveAsEncoding.Utf8);
>Response.Redirect(@"D:\customerlist.xls");
>
>However, the saved excel file must be corrupted. But the
>same piece of codes work well in Winform (no
>response.redirect certainly). Would anyone can tell me what
>is happening in Webform leading to the excel format
>corruption?
>
>On the other hand, when I save the same datastore as pdf in
>web, a saveas exception is thrown. But I've followed what
>is described in manual and put Ghostscript 705 folder into
>the Datawindow.NET folder.
>
>Thanks,
>Colin


Jim O'Neil [Sybase] Posted on 2004-09-08 14:30:13.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.datawindow.net
Subject: Re: Use datastore in Web form code-behind
Message-ID: <s15uj01iughirrv3us29anvkgfl5aa4g9q@4ax.com>
References: <413eb785.6fba.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: joneilw2k.sybase.com
X-Original-NNTP-Posting-Host: joneilw2k.sybase.com
Date: 8 Sep 2004 07:30:13 -0700
X-Trace: forums-1-dub 1094653813 10.18.63.187 (8 Sep 2004 07:30:13 -0700)
X-Original-Trace: 8 Sep 2004 07:30:13 -0700, joneilw2k.sybase.com
Lines: 48
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:328
Article PK: 124759

Well, WebForms aren't supported in this release, but I don't see
anything you are doing that wouldn't allow it to work. Have you tried
comparing the output .xls file from the WinForm case with the WebForm
case (using WinDiff, for example)? I'm presuming you can't open the
customerlist.xls directly with Excel either - in other words, confirm
that the file is truly corrupt versus the Redirect somehow not working
correctly?

On 8 Sep 2004 00:34:00 -0700, Colin Bradley wrote:

>I am developing a new web application. I have some reports
>in old legacy system that are written in PB but have to
>migrate to web. So I migrate the old dw by Datawindow
>Designer first. And I decide to instance a datastore in web
>form code-behind, set its datawindow object and retrieve,
>then save the output as pdf or excel and redirect the saved
>file back to the browser. The following is the piece of C#
>codes:
>
>Sybase.DataWindow.DataStore ds = new
>Sybase.DataWindow.DataStore();
>this.oleDbConnection1.Open();
>Sybase.DataWindow.AdoTransaction tran = new
>Sybase.DataWindow.AdoTransaction(this.oleDbConnection1);
>tran.BindConnection();
>ds.LibraryList = "D:\rpt.pbl";
>ds.DataWindowObject = "d_customer_list";
>ds.SetTransaction(tran);
>ds.Retrieve();
>ds.SaveAs(@"D:\customerlist.xls",
>Sybase.DataWindow.FileSaveAsType.Excel, true,
>Sybase.DataWindow.FileSaveAsEncoding.Utf8);
>Response.Redirect(@"D:\customerlist.xls");
>
>However, the saved excel file must be corrupted. But the
>same piece of codes work well in Winform (no
>response.redirect certainly). Would anyone can tell me what
>is happening in Webform leading to the excel format
>corruption?
>
>On the other hand, when I save the same datastore as pdf in
>web, a saveas exception is thrown. But I've followed what
>is described in manual and put Ghostscript 705 folder into
>the Datawindow.NET folder.
>
>Thanks,
>Colin


Colin Bradley Posted on 2004-09-09 07:05:26.0Z
Sender: 5468.413c1993.1804289383@sybase.com
From: Colin Bradley
Newsgroups: sybase.public.datawindow.net
Subject: Re: Use datastore in Web form code-behind
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41400259.7e22.1681692777@sybase.com>
References: <s15uj01iughirrv3us29anvkgfl5aa4g9q@4ax.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 9 Sep 2004 00:12:25 -0700, 10.22.241.42
Lines: 72
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 8 Sep 2004 23:53:55 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Sep 2004 00:05:26 -0700
X-Trace: forums-1-dub 1094713526 10.22.108.75 (9 Sep 2004 00:05:26 -0700)
X-Original-Trace: 9 Sep 2004 00:05:26 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:332
Article PK: 124763

Thanks for your kind response.

The whole thing is still under development stage. All
things including IIS, database, VS.NET and IE are running on
my W2K workstation. I've no idea how permission affects the
output but I can still save the file in my local hard disk
from the code behind call. Even if I tried using local
admin to lauch the ASP.NET process, I still couldn't save a
correct xls.

I am using Excel 2003 and it tells me it tries to repair the
xls that I directly open from my local drive. The xls even
can' t be opened in Excel 2000.

It is interesting that the xls saved from code-behind has
file size sightly smaller (711KB) than the one saved in
winform (776KB), provided that they must come from the same
database result set and the same datawindow object.

For pdf, I still can't make it in both winform and webform
solution... Nothing but only a "saveas failure" exception is
thrown...

> Well, WebForms aren't supported in this release, but I
> don't see anything you are doing that wouldn't allow it to
> work. Have you tried comparing the output .xls file from
> the WinForm case with the WebForm case (using WinDiff, for
> example)? I'm presuming you can't open the
> customerlist.xls directly with Excel either - in other
> words, confirm that the file is truly corrupt versus the
> Redirect somehow not working correctly?
>
> On 8 Sep 2004 00:34:00 -0700, Colin Bradley wrote:
>
> >I am developing a new web application. I have some
> reports >in old legacy system that are written in PB but
> have to >migrate to web. So I migrate the old dw by
> Datawindow >Designer first. And I decide to instance a
> datastore in web >form code-behind, set its datawindow
> object and retrieve, >then save the output as pdf or excel
> and redirect the saved >file back to the browser. The
> following is the piece of C# >codes:
> >
> >Sybase.DataWindow.DataStore ds = new
> >Sybase.DataWindow.DataStore();
> >this.oleDbConnection1.Open();
> >Sybase.DataWindow.AdoTransaction tran = new
> >Sybase.DataWindow.AdoTransaction(this.oleDbConnection1);
> >tran.BindConnection();
> >ds.LibraryList = "D:\rpt.pbl";
> >ds.DataWindowObject = "d_customer_list";
> >ds.SetTransaction(tran);
> >ds.Retrieve();
> >ds.SaveAs(@"D:\customerlist.xls",
> >Sybase.DataWindow.FileSaveAsType.Excel, true,
> >Sybase.DataWindow.FileSaveAsEncoding.Utf8);
> >Response.Redirect(@"D:\customerlist.xls");
> >
> >However, the saved excel file must be corrupted. But the
> >same piece of codes work well in Winform (no
> >response.redirect certainly). Would anyone can tell me
> what >is happening in Webform leading to the excel format
> >corruption?
> >
> >On the other hand, when I save the same datastore as pdf
> in >web, a saveas exception is thrown. But I've followed
> what >is described in manual and put Ghostscript 705
> folder into >the Datawindow.NET folder.
> >
> >Thanks,
> >Colin
>


Jim O'Neil [Sybase] Posted on 2004-09-09 13:41:23.0Z
From: "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com>
Newsgroups: sybase.public.datawindow.net
Subject: Re: Use datastore in Web form code-behind
Message-ID: <njm0k01mfbpefa7n2o1jtov2mao7k7ssmc@4ax.com>
References: <s15uj01iughirrv3us29anvkgfl5aa4g9q@4ax.com> <41400259.7e22.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: joneilw2k.sybase.com
X-Original-Trace: 9 Sep 2004 06:48:22 -0700, joneilw2k.sybase.com
Lines: 82
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Sep 2004 06:29:50 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Sep 2004 06:41:23 -0700
X-Trace: forums-1-dub 1094737283 10.22.108.75 (9 Sep 2004 06:41:23 -0700)
X-Original-Trace: 9 Sep 2004 06:41:23 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:333
Article PK: 124764

I'm not sure what to tell you about the Excel output, I can't see
anything that should change the way it behaves just b/c it's being run
under webforms.

As for the PDF, can you save the PDF in DataWindow Designer? If not,
it may be a configuration issue with Ghostscript.

On 9 Sep 2004 00:05:26 -0700, Colin Bradley wrote:

>Thanks for your kind response.
>
>The whole thing is still under development stage. All
>things including IIS, database, VS.NET and IE are running on
>my W2K workstation. I've no idea how permission affects the
>output but I can still save the file in my local hard disk
>from the code behind call. Even if I tried using local
>admin to lauch the ASP.NET process, I still couldn't save a
>correct xls.
>
>I am using Excel 2003 and it tells me it tries to repair the
>xls that I directly open from my local drive. The xls even
>can' t be opened in Excel 2000.
>
>It is interesting that the xls saved from code-behind has
>file size sightly smaller (711KB) than the one saved in
>winform (776KB), provided that they must come from the same
>database result set and the same datawindow object.
>
>For pdf, I still can't make it in both winform and webform
>solution... Nothing but only a "saveas failure" exception is
>thrown...
>
>> Well, WebForms aren't supported in this release, but I
>> don't see anything you are doing that wouldn't allow it to
>> work. Have you tried comparing the output .xls file from
>> the WinForm case with the WebForm case (using WinDiff, for
>> example)? I'm presuming you can't open the
>> customerlist.xls directly with Excel either - in other
>> words, confirm that the file is truly corrupt versus the
>> Redirect somehow not working correctly?
>>
>> On 8 Sep 2004 00:34:00 -0700, Colin Bradley wrote:
>>
>> >I am developing a new web application. I have some
>> reports >in old legacy system that are written in PB but
>> have to >migrate to web. So I migrate the old dw by
>> Datawindow >Designer first. And I decide to instance a
>> datastore in web >form code-behind, set its datawindow
>> object and retrieve, >then save the output as pdf or excel
>> and redirect the saved >file back to the browser. The
>> following is the piece of C# >codes:
>> >
>> >Sybase.DataWindow.DataStore ds = new
>> >Sybase.DataWindow.DataStore();
>> >this.oleDbConnection1.Open();
>> >Sybase.DataWindow.AdoTransaction tran = new
>> >Sybase.DataWindow.AdoTransaction(this.oleDbConnection1);
>> >tran.BindConnection();
>> >ds.LibraryList = "D:\rpt.pbl";
>> >ds.DataWindowObject = "d_customer_list";
>> >ds.SetTransaction(tran);
>> >ds.Retrieve();
>> >ds.SaveAs(@"D:\customerlist.xls",
>> >Sybase.DataWindow.FileSaveAsType.Excel, true,
>> >Sybase.DataWindow.FileSaveAsEncoding.Utf8);
>> >Response.Redirect(@"D:\customerlist.xls");
>> >
>> >However, the saved excel file must be corrupted. But the
>> >same piece of codes work well in Winform (no
>> >response.redirect certainly). Would anyone can tell me
>> what >is happening in Webform leading to the excel format
>> >corruption?
>> >
>> >On the other hand, when I save the same datastore as pdf
>> in >web, a saveas exception is thrown. But I've followed
>> what >is described in manual and put Ghostscript 705
>> folder into >the Datawindow.NET folder.
>> >
>> >Thanks,
>> >Colin
>>


vsv Posted on 2004-09-11 00:55:12.0Z
From: "vsv" <nospam@nospam.com>
Newsgroups: sybase.public.datawindow.net
References: <s15uj01iughirrv3us29anvkgfl5aa4g9q@4ax.com> <41400259.7e22.1681692777@sybase.com> <njm0k01mfbpefa7n2o1jtov2mao7k7ssmc@4ax.com>
Subject: Re: Use datastore in Web form code-behind
Lines: 91
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4927.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
NNTP-Posting-Host: 164.110.202.154
X-Original-NNTP-Posting-Host: 164.110.202.154
Message-ID: <41424cf0$1@forums-1-dub>
Date: 10 Sep 2004 17:55:12 -0700
X-Trace: forums-1-dub 1094864112 164.110.202.154 (10 Sep 2004 17:55:12 -0700)
X-Original-Trace: 10 Sep 2004 17:55:12 -0700, 164.110.202.154
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:345
Article PK: 124775

Colin,
On interest of our own, did you have it working?
If yes, what was the problem?
VSV

"Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in message
news:njm0k01mfbpefa7n2o1jtov2mao7k7ssmc@4ax.com...
> I'm not sure what to tell you about the Excel output, I can't see
> anything that should change the way it behaves just b/c it's being run
> under webforms.
>
> As for the PDF, can you save the PDF in DataWindow Designer? If not,
> it may be a configuration issue with Ghostscript.
>
> On 9 Sep 2004 00:05:26 -0700, Colin Bradley wrote:
>
> >Thanks for your kind response.
> >
> >The whole thing is still under development stage. All
> >things including IIS, database, VS.NET and IE are running on
> >my W2K workstation. I've no idea how permission affects the
> >output but I can still save the file in my local hard disk
> >from the code behind call. Even if I tried using local
> >admin to lauch the ASP.NET process, I still couldn't save a
> >correct xls.
> >
> >I am using Excel 2003 and it tells me it tries to repair the
> >xls that I directly open from my local drive. The xls even
> >can' t be opened in Excel 2000.
> >
> >It is interesting that the xls saved from code-behind has
> >file size sightly smaller (711KB) than the one saved in
> >winform (776KB), provided that they must come from the same
> >database result set and the same datawindow object.
> >
> >For pdf, I still can't make it in both winform and webform
> >solution... Nothing but only a "saveas failure" exception is
> >thrown...
> >
> >> Well, WebForms aren't supported in this release, but I
> >> don't see anything you are doing that wouldn't allow it to
> >> work. Have you tried comparing the output .xls file from
> >> the WinForm case with the WebForm case (using WinDiff, for
> >> example)? I'm presuming you can't open the
> >> customerlist.xls directly with Excel either - in other
> >> words, confirm that the file is truly corrupt versus the
> >> Redirect somehow not working correctly?
> >>
> >> On 8 Sep 2004 00:34:00 -0700, Colin Bradley wrote:
> >>
> >> >I am developing a new web application. I have some
> >> reports >in old legacy system that are written in PB but
> >> have to >migrate to web. So I migrate the old dw by
> >> Datawindow >Designer first. And I decide to instance a
> >> datastore in web >form code-behind, set its datawindow
> >> object and retrieve, >then save the output as pdf or excel
> >> and redirect the saved >file back to the browser. The
> >> following is the piece of C# >codes:
> >> >
> >> >Sybase.DataWindow.DataStore ds = new
> >> >Sybase.DataWindow.DataStore();
> >> >this.oleDbConnection1.Open();
> >> >Sybase.DataWindow.AdoTransaction tran = new
> >> >Sybase.DataWindow.AdoTransaction(this.oleDbConnection1);
> >> >tran.BindConnection();
> >> >ds.LibraryList = "D:\rpt.pbl";
> >> >ds.DataWindowObject = "d_customer_list";
> >> >ds.SetTransaction(tran);
> >> >ds.Retrieve();
> >> >ds.SaveAs(@"D:\customerlist.xls",
> >> >Sybase.DataWindow.FileSaveAsType.Excel, true,
> >> >Sybase.DataWindow.FileSaveAsEncoding.Utf8);
> >> >Response.Redirect(@"D:\customerlist.xls");
> >> >
> >> >However, the saved excel file must be corrupted. But the
> >> >same piece of codes work well in Winform (no
> >> >response.redirect certainly). Would anyone can tell me
> >> what >is happening in Webform leading to the excel format
> >> >corruption?
> >> >
> >> >On the other hand, when I save the same datastore as pdf
> >> in >web, a saveas exception is thrown. But I've followed
> >> what >is described in manual and put Ghostscript 705
> >> folder into >the Datawindow.NET folder.
> >> >
> >> >Thanks,
> >> >Colin
> >>
>


Colin Bradley Posted on 2004-09-11 04:32:47.0Z
Sender: 4c94.41319db5.1804289383@sybase.com
From: Colin Bradley
Newsgroups: sybase.public.datawindow.net
Subject: Re: Use datastore in Web form code-behind
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41428199.1d2d.1681692777@sybase.com>
References: <41424cf0$1@forums-1-dub>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 10 Sep 2004 21:39:53 -0700, 10.22.241.42
Lines: 97
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 10 Sep 2004 21:21:06 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 10 Sep 2004 21:32:47 -0700
X-Trace: forums-1-dub 1094877167 10.22.108.75 (10 Sep 2004 21:32:47 -0700)
X-Original-Trace: 10 Sep 2004 21:32:47 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:346
Article PK: 124776

Not yet working.

I am still finding out what will be the difference on
running that piece of C# code within ASP.NET process and in
normal local runtime.

> Colin,
> On interest of our own, did you have it working?
> If yes, what was the problem?
> VSV
>
> "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in
> message news:njm0k01mfbpefa7n2o1jtov2mao7k7ssmc@4ax.com...
> > I'm not sure what to tell you about the Excel output, I
> > can't see anything that should change the way it behaves
> > just b/c it's being run under webforms.
> >
> > As for the PDF, can you save the PDF in DataWindow
> > Designer? If not, it may be a configuration issue with
> Ghostscript. >
> > On 9 Sep 2004 00:05:26 -0700, Colin Bradley wrote:
> >
> > >Thanks for your kind response.
> > >
> > >The whole thing is still under development stage. All
> > >things including IIS, database, VS.NET and IE are
> > running on >my W2K workstation. I've no idea how
> > permission affects the >output but I can still save the
> > file in my local hard disk >from the code behind call.
> > Even if I tried using local >admin to lauch the ASP.NET
> > process, I still couldn't save a >correct xls.
> > >
> > >I am using Excel 2003 and it tells me it tries to
> > repair the >xls that I directly open from my local
> > drive. The xls even >can' t be opened in Excel 2000.
> > >
> > >It is interesting that the xls saved from code-behind
> > has >file size sightly smaller (711KB) than the one
> > saved in >winform (776KB), provided that they must come
> > from the same >database result set and the same
> > datawindow object. >
> > >For pdf, I still can't make it in both winform and
> > webform >solution... Nothing but only a "saveas failure"
> > exception is >thrown...
> > >
> > >> Well, WebForms aren't supported in this release, but
> > I >> don't see anything you are doing that wouldn't
> > allow it to >> work. Have you tried comparing the
> > output .xls file from >> the WinForm case with the
> > WebForm case (using WinDiff, for >> example)? I'm
> > presuming you can't open the >> customerlist.xls
> > directly with Excel either - in other >> words, confirm
> > that the file is truly corrupt versus the >> Redirect
> > somehow not working correctly? >>
> > >> On 8 Sep 2004 00:34:00 -0700, Colin Bradley wrote:
> > >>
> > >> >I am developing a new web application. I have some
> > >> reports >in old legacy system that are written in PB
> > but >> have to >migrate to web. So I migrate the old dw
> > by >> Datawindow >Designer first. And I decide to
> > instance a >> datastore in web >form code-behind, set
> > its datawindow >> object and retrieve, >then save the
> > output as pdf or excel >> and redirect the saved >file
> > back to the browser. The >> following is the piece of
> > C# >codes: >> >
> > >> >Sybase.DataWindow.DataStore ds = new
> > >> >Sybase.DataWindow.DataStore();
> > >> >this.oleDbConnection1.Open();
> > >> >Sybase.DataWindow.AdoTransaction tran = new
> > >>
> > >Sybase.DataWindow.AdoTransaction(this.oleDbConnection1)
> > ; >> >tran.BindConnection(); >> >ds.LibraryList =
> > "D:\rpt.pbl"; >> >ds.DataWindowObject =
> > "d_customer_list"; >> >ds.SetTransaction(tran);
> > >> >ds.Retrieve();
> > >> >ds.SaveAs(@"D:\customerlist.xls",
> > >> >Sybase.DataWindow.FileSaveAsType.Excel, true,
> > >> >Sybase.DataWindow.FileSaveAsEncoding.Utf8);
> > >> >Response.Redirect(@"D:\customerlist.xls");
> > >> >
> > >> >However, the saved excel file must be corrupted.
> > But the >> >same piece of codes work well in Winform (no
> > >> >response.redirect certainly). Would anyone can tell
> > me >> what >is happening in Webform leading to the excel
> > format >> >corruption?
> > >> >
> > >> >On the other hand, when I save the same datastore as
> > pdf >> in >web, a saveas exception is thrown. But I've
> > followed >> what >is described in manual and put
> > Ghostscript 705 >> folder into >the Datawindow.NET
> > folder. >> >
> > >> >Thanks,
> > >> >Colin
> > >>
> >
>
>


vsv Posted on 2004-09-14 00:41:51.0Z
From: "vsv" <nospam@nospam.com>
Newsgroups: sybase.public.datawindow.net
References: <41424cf0$1@forums-1-dub> <41428199.1d2d.1681692777@sybase.com>
Subject: Re: Use datastore in Web form code-behind
Lines: 104
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4927.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
NNTP-Posting-Host: 164.110.202.154
X-Original-NNTP-Posting-Host: 164.110.202.154
Message-ID: <41463e4f$1@forums-1-dub>
Date: 13 Sep 2004 17:41:51 -0700
X-Trace: forums-1-dub 1095122511 164.110.202.154 (13 Sep 2004 17:41:51 -0700)
X-Original-Trace: 13 Sep 2004 17:41:51 -0700, 164.110.202.154
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:352
Article PK: 124782

Collin,
Did you try printing to a PDF printer?
VSV

<Colin Bradley> wrote in message news:41428199.1d2d.1681692777@sybase.com...
> Not yet working.
>
> I am still finding out what will be the difference on
> running that piece of C# code within ASP.NET process and in
> normal local runtime.
>
> > Colin,
> > On interest of our own, did you have it working?
> > If yes, what was the problem?
> > VSV
> >
> > "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote in
> > message news:njm0k01mfbpefa7n2o1jtov2mao7k7ssmc@4ax.com...
> > > I'm not sure what to tell you about the Excel output, I
> > > can't see anything that should change the way it behaves
> > > just b/c it's being run under webforms.
> > >
> > > As for the PDF, can you save the PDF in DataWindow
> > > Designer? If not, it may be a configuration issue with
> > Ghostscript. >
> > > On 9 Sep 2004 00:05:26 -0700, Colin Bradley wrote:
> > >
> > > >Thanks for your kind response.
> > > >
> > > >The whole thing is still under development stage. All
> > > >things including IIS, database, VS.NET and IE are
> > > running on >my W2K workstation. I've no idea how
> > > permission affects the >output but I can still save the
> > > file in my local hard disk >from the code behind call.
> > > Even if I tried using local >admin to lauch the ASP.NET
> > > process, I still couldn't save a >correct xls.
> > > >
> > > >I am using Excel 2003 and it tells me it tries to
> > > repair the >xls that I directly open from my local
> > > drive. The xls even >can' t be opened in Excel 2000.
> > > >
> > > >It is interesting that the xls saved from code-behind
> > > has >file size sightly smaller (711KB) than the one
> > > saved in >winform (776KB), provided that they must come
> > > from the same >database result set and the same
> > > datawindow object. >
> > > >For pdf, I still can't make it in both winform and
> > > webform >solution... Nothing but only a "saveas failure"
> > > exception is >thrown...
> > > >
> > > >> Well, WebForms aren't supported in this release, but
> > > I >> don't see anything you are doing that wouldn't
> > > allow it to >> work. Have you tried comparing the
> > > output .xls file from >> the WinForm case with the
> > > WebForm case (using WinDiff, for >> example)? I'm
> > > presuming you can't open the >> customerlist.xls
> > > directly with Excel either - in other >> words, confirm
> > > that the file is truly corrupt versus the >> Redirect
> > > somehow not working correctly? >>
> > > >> On 8 Sep 2004 00:34:00 -0700, Colin Bradley wrote:
> > > >>
> > > >> >I am developing a new web application. I have some
> > > >> reports >in old legacy system that are written in PB
> > > but >> have to >migrate to web. So I migrate the old dw
> > > by >> Datawindow >Designer first. And I decide to
> > > instance a >> datastore in web >form code-behind, set
> > > its datawindow >> object and retrieve, >then save the
> > > output as pdf or excel >> and redirect the saved >file
> > > back to the browser. The >> following is the piece of
> > > C# >codes: >> >
> > > >> >Sybase.DataWindow.DataStore ds = new
> > > >> >Sybase.DataWindow.DataStore();
> > > >> >this.oleDbConnection1.Open();
> > > >> >Sybase.DataWindow.AdoTransaction tran = new
> > > >>
> > > >Sybase.DataWindow.AdoTransaction(this.oleDbConnection1)
> > > ; >> >tran.BindConnection(); >> >ds.LibraryList =
> > > "D:\rpt.pbl"; >> >ds.DataWindowObject =
> > > "d_customer_list"; >> >ds.SetTransaction(tran);
> > > >> >ds.Retrieve();
> > > >> >ds.SaveAs(@"D:\customerlist.xls",
> > > >> >Sybase.DataWindow.FileSaveAsType.Excel, true,
> > > >> >Sybase.DataWindow.FileSaveAsEncoding.Utf8);
> > > >> >Response.Redirect(@"D:\customerlist.xls");
> > > >> >
> > > >> >However, the saved excel file must be corrupted.
> > > But the >> >same piece of codes work well in Winform (no
> > > >> >response.redirect certainly). Would anyone can tell
> > > me >> what >is happening in Webform leading to the excel
> > > format >> >corruption?
> > > >> >
> > > >> >On the other hand, when I save the same datastore as
> > > pdf >> in >web, a saveas exception is thrown. But I've
> > > followed >> what >is described in manual and put
> > > Ghostscript 705 >> folder into >the Datawindow.NET
> > > folder. >> >
> > > >> >Thanks,
> > > >> >Colin
> > > >>
> > >
> >
> >


Colin Bradley Posted on 2004-09-15 01:05:16.0Z
Sender: 51f8.41479686.1804289383@sybase.com
From: Colin Bradley
Newsgroups: sybase.public.datawindow.net
Subject: Re: Use datastore in Web form code-behind
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <41479703.5200.1681692777@sybase.com>
References: <41463e4f$1@forums-1-dub>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 14 Sep 2004 18:12:35 -0700, 10.22.241.42
Lines: 108
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 14 Sep 2004 17:53:12 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 14 Sep 2004 18:05:16 -0700
X-Trace: forums-1-dub 1095210316 10.22.108.75 (14 Sep 2004 18:05:16 -0700)
X-Original-Trace: 14 Sep 2004 18:05:16 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:364
Article PK: 124794

No. I do not have PDF distiller driver.

> Collin,
> Did you try printing to a PDF printer?
> VSV
>
> <Colin Bradley> wrote in message
> > news:41428199.1d2d.1681692777@sybase.com... Not yet
> working. >
> > I am still finding out what will be the difference on
> > running that piece of C# code within ASP.NET process and
> > in normal local runtime.
> >
> > > Colin,
> > > On interest of our own, did you have it working?
> > > If yes, what was the problem?
> > > VSV
> > >
> > > "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote
> > > in message
> > > > news:njm0k01mfbpefa7n2o1jtov2mao7k7ssmc@4ax.com...
> > > > I'm not sure what to tell you about the Excel output
> , I can't see anything that should change the way it
> > > > behaves just b/c it's being run under webforms.
> > > >
> > > > As for the PDF, can you save the PDF in DataWindow
> > > > Designer? If not, it may be a configuration issue
> > > with Ghostscript. >
> > > > On 9 Sep 2004 00:05:26 -0700, Colin Bradley wrote:
> > > >
> > > > >Thanks for your kind response.
> > > > >
> > > > >The whole thing is still under development stage.
> > > > All >things including IIS, database, VS.NET and IE
> > > > are running on >my W2K workstation. I've no idea
> > > > how permission affects the >output but I can still
> > > > save the file in my local hard disk >from the code
> > > > behind call. Even if I tried using local >admin to
> > > > lauch the ASP.NET process, I still couldn't save a
> > > > >correct xls. >
> > > > >I am using Excel 2003 and it tells me it tries to
> > > > repair the >xls that I directly open from my local
> > > > drive. The xls even >can' t be opened in Excel
> > > > 2000. >
> > > > >It is interesting that the xls saved from
> > > > code-behind has >file size sightly smaller (711KB)
> > > > than the one saved in >winform (776KB), provided
> > > > that they must come from the same >database result
> > > > set and the same datawindow object. >
> > > > >For pdf, I still can't make it in both winform and
> > > > webform >solution... Nothing but only a "saveas
> > > > failure" exception is >thrown...
> > > > >
> > > > >> Well, WebForms aren't supported in this release,
> > > > but I >> don't see anything you are doing that
> > > > wouldn't allow it to >> work. Have you tried
> > > > comparing the output .xls file from >> the WinForm
> > > > case with the WebForm case (using WinDiff, for >>
> > > > example)? I'm presuming you can't open the >>
> > > > customerlist.xls directly with Excel either - in
> > > > other >> words, confirm that the file is truly
> > > > corrupt versus the >> Redirect somehow not working
> > > > correctly? >> >> On 8 Sep 2004 00:34:00 -0700, Colin
> > > > Bradley wrote: >>
> > > > >> >I am developing a new web application. I have
> > > > some >> reports >in old legacy system that are
> > > > written in PB but >> have to >migrate to web. So I
> > > > migrate the old dw by >> Datawindow >Designer first.
> > > > And I decide to instance a >> datastore in web
> > > > >form code-behind, set its datawindow >> object and
> > > > retrieve, >then save the output as pdf or excel >>
> > > > and redirect the saved >file back to the browser.
> > > > The >> following is the piece of C# >codes: >> >
> > > > >> >Sybase.DataWindow.DataStore ds = new
> > > > >> >Sybase.DataWindow.DataStore();
> > > > >> >this.oleDbConnection1.Open();
> > > > >> >Sybase.DataWindow.AdoTransaction tran = new
> > > > >>
> > > >
> > > >
> >Sybase.DataWindow.AdoTransaction(this.oleDbConnection1) ;
> > > > >> >tran.BindConnection(); >> >ds.LibraryList =
> > > > "D:\rpt.pbl"; >> >ds.DataWindowObject =
> > > > "d_customer_list"; >> >ds.SetTransaction(tran); >>
> > > > >ds.Retrieve(); >> >ds.SaveAs(@"D:\customerlist.xls"
> > > > , >> >Sybase.DataWindow.FileSaveAsType.Excel, true,
> > > > >> >Sybase.DataWindow.FileSaveAsEncoding.Utf8);
> > > > >> >Response.Redirect(@"D:\customerlist.xls");
> > > > >> >
> > > > >> >However, the saved excel file must be corrupted.
> > > > But the >> >same piece of codes work well in Winform
> > > > (no >> >response.redirect certainly). Would anyone
> > > > can tell me >> what >is happening in Webform leading
> > > > to the excel format >> >corruption?
> > > > >> >
> > > > >> >On the other hand, when I save the same
> > > > datastore as pdf >> in >web, a saveas exception is
> > > > thrown. But I've followed >> what >is described in
> > > > manual and put Ghostscript 705 >> folder into >the
> > > > Datawindow.NET folder. >> >
> > > > >> >Thanks,
> > > > >> >Colin
> > > > >>
> > > >
> > >
> > >
>
>


Agrinei Jorge Posted on 2004-09-15 19:48:03.0Z
From: "Agrinei Jorge" <ajorge.NOTSPAM@tecnotrends.com.br>
Newsgroups: sybase.public.datawindow.net
References: <41463e4f$1@forums-1-dub> <41479703.5200.1681692777@sybase.com>
Subject: Re: Use datastore in Web form code-behind
Lines: 170
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 200.167.10.2
X-Original-NNTP-Posting-Host: 200.167.10.2
Message-ID: <41489c73@forums-1-dub>
Date: 15 Sep 2004 12:48:03 -0700
X-Trace: forums-1-dub 1095277683 200.167.10.2 (15 Sep 2004 12:48:03 -0700)
X-Original-Trace: 15 Sep 2004 12:48:03 -0700, 200.167.10.2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.datawindow.net:378
Article PK: 124811

This section of documentation in the Powerbuilder 9 help is wrong!!

Look at:
http://sybooks.sybase.com/onlinebooks/group-pb/pbr0901e/deskprorb/@Generic__BookTextView/807


Follow the instructions below:


To install GNU Ghostscript on the PowerBuilder development computer:

http://manuals.sybase.com/onlinebooks/group-pb/pbp0900e/pbeinst/@ebt-link;pt=572;lang=pt?target=%25N%14_1714_START_RESTART_N%25

1. Download gs705w32.exe from
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/gs705 into a temporary
directory on your computer.

You can find a list of alternative mirror sites on the GhostScript Web site
.

2. Run gs705w32.exe to install Ghostscript on your system.

The default installation directory is C:\gs. You can select a different
directory and/or choose to install shortcuts to the Ghostscript console and
readme file.

3. Add the gs7.05\bin directory to your system PATH environment
variable in the Windows Control Panel. For example, if you installed
Ghostscript in C:\gs, add the following to the system PATH environment
variable:

C:\gs\gs7.05\bin

...THEN...

Installing Acrobat Distiller manually:

1. Open up your Printers folder.
2. Select Add Printer
3. Hit Next in that dialog.
4. Select "Local Printer" and hit Next.
5. For "Use the following port", select "File:" and hit Next.
6. Hit "Have Disk"
7. Browse to the \\Sybase\Shared\PowerBuilder\drivers directory and
select the ADIST5.INF file, then hit Open.
8. Hit OK to close the Install from Disk dialog
9. Select "Acrobat Distiller" and hit Next.
10. It may prompt you to keep existing driver, your choice, hit Next.
11. For Printer Name, enter "Sybase DataWindow PS". Or you can enter
something else, and then add that printer name to the DataWindow print
specs. Hit Next.
12. On printer sharing, hit Next.
13. Decide whether or not you want a test page, and then hit Next.
14. Hit Finish

<Colin Bradley> wrote in message news:41479703.5200.1681692777@sybase.com...
> No. I do not have PDF distiller driver.
>
> > Collin,
> > Did you try printing to a PDF printer?
> > VSV
> >
> > <Colin Bradley> wrote in message
> > > news:41428199.1d2d.1681692777@sybase.com... Not yet
> > working. >
> > > I am still finding out what will be the difference on
> > > running that piece of C# code within ASP.NET process and
> > > in normal local runtime.
> > >
> > > > Colin,
> > > > On interest of our own, did you have it working?
> > > > If yes, what was the problem?
> > > > VSV
> > > >
> > > > "Jim O'Neil [Sybase]" <joneil_at_sybase_dot_com> wrote
> > > > in message
> > > > > news:njm0k01mfbpefa7n2o1jtov2mao7k7ssmc@4ax.com...
> > > > > I'm not sure what to tell you about the Excel output
> > , I can't see anything that should change the way it
> > > > > behaves just b/c it's being run under webforms.
> > > > >
> > > > > As for the PDF, can you save the PDF in DataWindow
> > > > > Designer? If not, it may be a configuration issue
> > > > with Ghostscript. >
> > > > > On 9 Sep 2004 00:05:26 -0700, Colin Bradley wrote:
> > > > >
> > > > > >Thanks for your kind response.
> > > > > >
> > > > > >The whole thing is still under development stage.
> > > > > All >things including IIS, database, VS.NET and IE
> > > > > are running on >my W2K workstation. I've no idea
> > > > > how permission affects the >output but I can still
> > > > > save the file in my local hard disk >from the code
> > > > > behind call. Even if I tried using local >admin to
> > > > > lauch the ASP.NET process, I still couldn't save a
> > > > > >correct xls. >
> > > > > >I am using Excel 2003 and it tells me it tries to
> > > > > repair the >xls that I directly open from my local
> > > > > drive. The xls even >can' t be opened in Excel
> > > > > 2000. >
> > > > > >It is interesting that the xls saved from
> > > > > code-behind has >file size sightly smaller (711KB)
> > > > > than the one saved in >winform (776KB), provided
> > > > > that they must come from the same >database result
> > > > > set and the same datawindow object. >
> > > > > >For pdf, I still can't make it in both winform and
> > > > > webform >solution... Nothing but only a "saveas
> > > > > failure" exception is >thrown...
> > > > > >
> > > > > >> Well, WebForms aren't supported in this release,
> > > > > but I >> don't see anything you are doing that
> > > > > wouldn't allow it to >> work. Have you tried
> > > > > comparing the output .xls file from >> the WinForm
> > > > > case with the WebForm case (using WinDiff, for >>
> > > > > example)? I'm presuming you can't open the >>
> > > > > customerlist.xls directly with Excel either - in
> > > > > other >> words, confirm that the file is truly
> > > > > corrupt versus the >> Redirect somehow not working
> > > > > correctly? >> >> On 8 Sep 2004 00:34:00 -0700, Colin
> > > > > Bradley wrote: >>
> > > > > >> >I am developing a new web application. I have
> > > > > some >> reports >in old legacy system that are
> > > > > written in PB but >> have to >migrate to web. So I
> > > > > migrate the old dw by >> Datawindow >Designer first.
> > > > > And I decide to instance a >> datastore in web
> > > > > >form code-behind, set its datawindow >> object and
> > > > > retrieve, >then save the output as pdf or excel >>
> > > > > and redirect the saved >file back to the browser.
> > > > > The >> following is the piece of C# >codes: >> >
> > > > > >> >Sybase.DataWindow.DataStore ds = new
> > > > > >> >Sybase.DataWindow.DataStore();
> > > > > >> >this.oleDbConnection1.Open();
> > > > > >> >Sybase.DataWindow.AdoTransaction tran = new
> > > > > >>
> > > > >
> > > > >
> > >Sybase.DataWindow.AdoTransaction(this.oleDbConnection1) ;
> > > > > >> >tran.BindConnection(); >> >ds.LibraryList =
> > > > > "D:\rpt.pbl"; >> >ds.DataWindowObject =
> > > > > "d_customer_list"; >> >ds.SetTransaction(tran); >>
> > > > > >ds.Retrieve(); >> >ds.SaveAs(@"D:\customerlist.xls"
> > > > > , >> >Sybase.DataWindow.FileSaveAsType.Excel, true,
> > > > > >> >Sybase.DataWindow.FileSaveAsEncoding.Utf8);
> > > > > >> >Response.Redirect(@"D:\customerlist.xls");
> > > > > >> >
> > > > > >> >However, the saved excel file must be corrupted.
> > > > > But the >> >same piece of codes work well in Winform
> > > > > (no >> >response.redirect certainly). Would anyone
> > > > > can tell me >> what >is happening in Webform leading
> > > > > to the excel format >> >corruption?
> > > > > >> >
> > > > > >> >On the other hand, when I save the same
> > > > > datastore as pdf >> in >web, a saveas exception is
> > > > > thrown. But I've followed >> what >is described in
> > > > > manual and put Ghostscript 705 >> folder into >the
> > > > > Datawindow.NET folder. >> >
> > > > > >> >Thanks,
> > > > > >> >Colin
> > > > > >>
> > > > >
> > > >
> > > >
> >
> >