Quantcast
Channel: SCN : All Content - PowerBuilder Developer Center
Viewing all 2935 articles
Browse latest View live

Question about editing a datawindow source file

$
0
0

This is a followup on a post I made earlier today about copying column controls in a datawindow.  Terry Voth answered the question.  The answer was 'no'.  You have to edit the source file to copy columns and get the control to point to a new db column.  I have attempted to do that.  I have a bunch of columns repeated over 6 times, with only 1 digit changing in the name.  I want to copy them and edit the source to get a new set of db columns.  I show what I did in the attached screen shot.  Basically I change the reference to the copied column from, for instance, nslctemp_program_1_cip_code_1 to nslctemp_program_2_cip_code.  But when I do a retrieve in the datawindow painter, both sets of columns are pointing at the same data.  I guess I need to edit the source someplace else as well.  Can someone help out?

 

TIA

LAS


What's this I see Vishal Sikka is leaving SAP?

Maximizing App that is minimized

$
0
0

Hello folks,

 

Lets say I have an application called  test.exe

When a user clicks on test.exe , I use CreateMutex to prevent users from opening multiple instances of the application.

 

My question:

If the application is running minimized and if the user clicks on the exe, is there a way to maximize the application that is already running minimized?

 

I've tried getting the handle of the main window and used setforeground  etc.. nothing seems to work.

 

Appreciate your input on this.

thank you

Melvin

In PB .net 12.5.2 how does one compile resources (ie bmp etc) into .exe/dll

$
0
0

I've got 2 WPF targets, both were recently migrated from PB 6.5 to PD 12.5 Classic, then to PB .net. It appears that for one of them the resource files are compiled into the exe (don't have to be deployed explicitly with the app), but not the other. The resource files are all listed as references in both apps. I don't see any differences in the project objects. There has to be a way to specify to compile the resource files into the exe/dlls, Doesn't there?

 

Thanks in advance,

 

Todd Oesterreich

print a picture

$
0
0

I am trying to print ID card from record in a database. I used the SelectBlob to retrieve the picture image and added it to a picture field in the datawindow. In the preview the picture did not show at all so I could not print it. Here is the Open event script:

Selectblob member_picture

into :lblb_out

from abc_member

Where member_key = :gs_member;

If SQLCA.SQLCODE <> o then

  messagebox("Selectblob ", "Failed")

END IF

tempfile = FileOpen("C:\Member\memb4.bmp",streammode!, Write!, LockreadWrite!, Replace)

writepic = filewrite(tempfile, lblb_out)

ls_image = "c:\member\memb4.bmp"

dw_card.object.p_1.filename = ls_image

dw_card.object.p_1.originalsize = False

dw_card.Object.p_1.width = 8

dw_card.Object.p_1.height = 5

 

the window with the datawindow get displayed with no picture at all. All the other fields are displayed and can be printed.

the file ls_image created in the C:\Member contains the truncated picture

 

Please help.

Placide

Custom row indicator for webforms datawindows

$
0
0

Hi all,

 

I'm trying to implement a custom row indicator for some datawindows of a webform target. Thing is that I dont want to code clicked event in dw_ in order to avoid postbacks. So, I tried some JavaScript coding.

 

Everything worked fine except that the computed fields did not render after I send a sender.SetItem in my JavaScript file. Fields marked as "Value Is HTML" did not repaint as well.

 

I was able to figure out that anything that has to do with visual does not work when you manipulate the datawindow through JavaScript.

 

Anybody has a workaround for this ?

 

Best regards,

 

________________

AUS Julián Tagarro

NeoSistemas SRL

Opening default email application with attachment in PowerBuilder

$
0
0

Hi ,

 

I want to open the default email application (could be Outlook ,Thunderbird ...etc ) and pass email content to it ( recipient , subject , body , attachment )

Then user can review this email and format it then sent it .

 

Iam able to achieve using the below script :

 

ls_syntax = "mailto:" + ls_emailid + "?subject=" + ls_subject +"&body=" + ls_body

ls_syntax = ls_syntax + "&attachment=" + ls_attachment_path +""

ls_syntax =  "rundll32 url.dll,FileProtocolHandler " + ls_syntax 

Run(ls_syntax)

 

However I am not able to pass attachments using the mentioned script above ,

When I googled it , I found that (somehow ) the attachments is not supported using the above command ,

 

But I am wondering , How does WINRAR do it ?!

If you have WinRar installed , you can right click on any file and choose "compress & email" , it does exactly what Iam not able to achieve .

 

Iam using PowerBuilder 11.5 .

Could I have missed something here ?

 

Regards ,

 

Ahmed .

Application Server configuration

$
0
0

Hi,

 

Can someone pls give me a step-by-step info on how to configure an Application Server in PB 12.5 Classic? Application Server like JBOSS, WebLogic.

 

I'm at a total loss since there are NO clear documentation in Powerbuilder Help of how to go about this.

 

Besides this, I also want to ask, can someone pls give me a step-by-step info on how to write a simple web based application in PB 12.5 Classic?

 

Also I cannot seem to understand, when I click on Deploy Tab, I directly get the option Deploy to IIS? Why is this so? How can I choose something other than IIS?


Office 2013 ole

$
0
0

Hallo,

 

We are experiencing problems trying to automate MSword from Office 2013 on a windows 7 machine , using Powerbuilder 11.5. the same setup with office 2010 gave no trouble.

 

This is our code :

 

long ll_return , ll_test

string ls_test

n_oleobject_word  lole_word

OLEObject  lole_doc, lole_selection

lole_word = create n_oleobject_word

ll_return = lole_word.ConnectToNewObject('word.application.15')

lole_doc = CREATE OLEObject

lole_doc = lole_word.Documents.open('L:\Dev\APBS_KLANTEN\DOX\docs\offerte_test.docx', False, True, False, "", "", True, "", "", 0)

lole_doc.bookmarks.Item('ve_stad').Select()

lole_selection = lole_word.application.selection

ll_test = lole_selection.BookMarkID  // ll_test gets the correct value

ls_test =  lole_selection.text  // ls_test gets an empty string which is correct

lole_selection.TypeText('this is a test')

 

 

Everything seems to be going fine until the last statement. At that stage we get the following errormessage:

 

"Error calling external object function typetext at line 13 in clicked event of object m_7 of m_apbs."

 

We think it might have something to do with an office setting  or permissions to alter a word_document .

 

We would be most gratefull for any suggestion.

 

Kind regards,

 

Paul Baudouin

Problem Maximizing Window

$
0
0

I have a window that I'm trying to use as a dashboard.  So, if the user chooses to open the dashboard it opens a maximized sheet in the mdi frame of the application that I would like to persist while they are logged in to the app.  The problem occurs when they open any other windows, which are not maximized.  I would like my dashboard to shrink so it's not visible behind the new open window, but then come back in a maximized form once they close the other window or windows.  Does anyone know how to accomplish this?  Just setting the window to maximized does not work.  I've also tried saving the height and width and then setting them again when the window is activated, but this does not work either.  Trying to set the WindowState to maximized when the window is activated causes multiple window and close icons to appear at the top.  Any suggestions?  Thanks!

Unsure how to populate information to send to a web service

$
0
0

Hi,

 

I'm using PB 12.0, and can't get a call to a web service to work.  We have been using this web service for several years, but want to see about consuming a newer version of this service.  The working version involved generating the webservice proxy using the EasySoap engine, and we pointed it at a .asmx file.  This generated the webservice proxy object and data structures used as parameters and return values for the webservice methods.

 

PowerBuilder2.png

PowerBuilder1.png

 

We had no trouble populating the structures and passing them to the webservice methods, and as well getting the data back in structures and consuming it as needed.

 

Now, the vendor is offering a newer version of the webservice, and I'm guessing its based on WCF, because it utilizes a .svc file.  I wasn't able to get the EasySoap engine to understand it, so I switched to using the .NET SOAP engine, which appears to have worked.  The deployment of this project creates the webservice proxy object and proxy objects for the methods and data structures...but no PB structures themselves.

PowerBuilder3.png

PowerBuilder4.png

This is where my confusion sets in.  Do I utilize these proxy objects like I would a structure?  I assumed so.  I can pass simple proxy objects (ones with scalar values or arrays of strings) to/from the simpler methods on this webservice.  An example of this...

 

PowerBuilder5.png

However, I start to run into issues with more complex cases where one proxy object contains arrays of other proxy objects.  But I'm not sure that is the cause of the issue, because even simple variable assignment statements fail with "null object reference" error, such as this code, where ipx_NexusInfo was declared as a instance variable  px_NexusInfo ipx_NexusInfo.  It fails on the first line inside the IF statement.

 

PowerBuilder6.png

In some cases, I was able to eliminate the problem by treating the proxy object like a normal nonvisual object and instantiating it first with a CREATE statement, but I read in at least one souce online that the create statement shouldn't be necessary (and it wasn't with my simpler situations).  The only other difference I can think of between my simple scenario and more complex scenario is that the more complex scenario is part of a multithreading architecture and uses shared object instances...i.e. SharedObjectRegister() and SharedObjectGet().

 

Am I doing something wrong with these proxy objects, or is PB12.0 or the .NET SOAP engine not compatible with WCF webservices, or are shared objects interfering somehow?  I'll attach the WSDL file in case it provides any clues.

PowerBuilder 12.5 Classic GhostScript creating blank pdf

$
0
0

I am using window 7 x32. PowerBuilder 12.5 Classic and GhostScript 9.1w32

 

I am trying to update an old script (written in PB8) which used to use a Jaguar server to generate PDF documents, but for whatever reason that is no longer supported/working with PB12.5.

 

I have installed GhostScript 9.1 and the registry HKLM\SOFTWARE\GPL Ghostscript\9.1\GS_DLL points to gsdll32.dll and I have a Sybase DataWindow PS printer available

 

The PB Code I am using to generate the PDF is:

 

lstr_pdf_props.s_string[1] = "filename.pdf" 
... 
dw_statement.Object.DataWindow.Export.PDF.Method = Distill! dw_statement.Object.DataWindow.Export.PDF.Distill.CustomPostScript="No" 
dw_statement.SaveAs(lstr_pdf_props.s_string[1], PDF!, false) 

This completes without error and creates a C:\filename.pdf file 3kb in size, however it is a blank page, the file opens in adobe reader but there is no writing or anything printed, just a blank white page.

 

Does anyone have any ides as to what might be going on here?

 

thanks.

Creating pdf files in powerbuilder 12.1 classic on win 7

$
0
0

I'm trying to get the gnu ghostscript working on my win 7 (64-bit) machine.

I installed gs860w32

and, tried to saveas a pdf in a couple of different ways

 

dw_report.Object.DataWindow.Export.PDF.Method = Distill!

dw_report.Object.DataWindow.Export.PDF.Distill.CustomPostScript="No"

dw_report.saveas('',PDF!, FALSE)

 

 

or, just as a saveas PDF!

 

both produced an error in adobe reader

that it couldn't open the file because, either it's not a supported file

or, it's been damaged

 

I've seen a lot of different suggestions on how to implement this

Any ideas? suggestions?

is there a step by step set of instructions, that will help me get this working?

Why not PFC?

$
0
0

We're about to build a new app for our Finance department. All prior applications in the company have been built with PB 10 or 11 and none have used the PFC. We have PB 12.5 licensed, so we'll use this going forward. The big question is whether or not to use the PFC. There will be no other alternatives, i.e., we're not entertaining .NET or any other PB frameworks (if any exist).

 

There is concern that the PFC adds too much overhead, but those of us that have used it in the past cannot fathom a new app without it, warts and all. The decision will be made by the developers (and we're all at the same level), not management. I just need compelling reasons to avoid it. I believe there are none.

 

Larry Molter

Certified PB Advanced Tools Curriculum Instructor in a past life

PB Certified Professional in a past life

Just a grunt now

Old Insert statement has stopped working.

$
0
0

As of this morning I began getting an error on an insert statement, "String or binary data would be truncated."  See Capture.png.  The column that causes the problem is a varchar(11,null).  I know this is the column because the error goes away if I remove it. The value being inserted is a string of 11 spaces.  See capture2.png.  I can't think of anything that might have changed to cause this error to start.  I don't get an error when I insert an 11 char string via Management Studio.  See capture3.png.  We're using PB 12.5 and MSSQL 2005.

 

TIA

LAS


SAP Price List

$
0
0

Hello,

 

We have been told that PowerBuilder is now on the SAP price list. Can someone please tell me how to find it in the SAP store? I need some pricing information.

 

Also can someone please refer me to the published definitive SAP statement on its commitment to PowerBuilder. I can't seem to find it. I don't mean what was said at conferences/meetings or on bits of slideware, I mean the real thing.

 

I so want to believe that PowerBuilder has a future but down here in this pathetic banana republic in the south west corner of the Pacific, it's not looking real good.

 

TIA, Paul

Static functions in PB.NET

$
0
0

Hello, all

Is it possible to create a custom non-visual object and declare static functions for it in PB.NET 12.5.2.

 

I am trying to convert a large console PB classic app to separate .NET components, but I have about a dozen global functions in the target.

I really do not wish to copy all those functions to each DLL. I was hoping there is a way to use static function feature of .NET.

 

Is it possible?

 

Thank you

Arcady

How to migrate PB web services and web applications from 2003 to 2008 MS Server

$
0
0

Greetings All,

 

I have a bunch of web applications that I have deployed to a Windows Server 2003 server. The server is not behaving well and I need to move all of the web applications and web services to a new Windows 2008 Server.

 

I am really guessing at this. Could it be that easy? Seems not. The first web application I tried did not work.

 

I don't really know IIS 7.0.

 

I am guessing that I have to convert the directories shown in IIS 7.0 to applications. I have done this before. And I was prompted to enter a user id and password for the application.  In the past, I used the Administrator user id and password. Now I know that was wrong. First, we changed the Administrator domain password and everything on the server stopped working until I screwed around for hours recreating the 'applications' for each web site and web service. So I don't want to to go through that again. Also, I don't think I should be using Admin rights for a web service.

 

Somehow, this all seems to get done magically and correctly when you deploy via PB.

 

Can someone kindly tell me please...

 

1) What is PB doing during the deploy to a web server on the domain? What is it doing to create web applications, permissions and what user id is it using?

 

2) How can I replicate that manually while I am manually migrating the web applications and web services to a new Windows 2008 Server?

 

Thanks everyone!!

 

Paul

Where oh where can I buy a copy of 12.5?

$
0
0

Greetings all,

 

I need to buy a license of PowerBuilder today if possible. I tried the PB Trial link off this forum, but it is a dead link.

 

I went to the SAP Store and search on PowerBuilder getting back only 'No Solutions'.

 

Will someone please take my $3,000.00 and give me a license? Pretty please?

 

Paul

 

SAP-Thought-Leadership.pngSAP-Store-PowerBuilder-No-Solutions.png

Table does not exist at dw.insertrow(0)

$
0
0

Hi,

 

I am trying to update an old PB app.

 

Background of the basic database structure:

my_data Table:

col1

col2 -- lookup to an_old_table.id

col3 -- newly added as lookup

 

my_new_lookup Table:

code -- 'linked' to col3 above

description

 

an_old_lookup table:

id -- 'linked' to my_data.col2

text

 

I have created a new lookup table in our oracle database, and added an extra column to an existing table this column matches the lookup code and we can pull the full description of the item from there.

 

I would like to add the new lookup table as a dropdown list in a window of my app.

There is already a dropdown list which does exactly this, displaying an_old_table.text in the dropdown but updating my_table.col2 with the id value.

 

I have attempted to duplicate this functionality exactly but with data from my_new_lookup to my_data.col3, but am failing somewhere.

 

I have created a new d_dddw_mynewdropdown, which in the preview window lists all my_new_lookup.description values from the database correctly.

 

In the datawindow, I added a column control, changed the edit to DropDownDW, making sure the DataWindow is d_dddw_mynewdropdown and display and data columns matched description and code respectively.

 

When I do a retreive on the datawindow within powerbuilder, with a record from the my_data table a dropdown box appears correctly in the preview window with the value matching the correct lookup description, so it is flowing through col3 > code > description correctly.

 

The datawindow is embedded into an application window, and this is where I think it is failing... The window has two datawindows on it and part of the open() function does:

If dw_one.Retrieve(ln_id,) > 0 Then  ll_row = dw_one.GetRow()
If dw_one.ShareData (dw_two) <> 1 Then  MessageBox ("Error", "Error in sharing data.")  Else  dw_two.ScrollToRow (ll_row)  End If

Which passes (IE does not display the message box)

It then executes:

dw_one.InsertRow(0)
dw_two.InsertRow(0)

Which is where the application displays an error message which says:

Select Error: ORA-00942: table or view does not exist

I stepped through the code in debug mode and discovered the error message comes from the dw_one.InsertRow(0) line.

 

If I press ok to the error, the application continues to run, but the value of the dropdown box is my_data.col3 (the 'linking' code, not the full description) and the dropdown when pressed is empty.

 

I am not sure what I have done wrong.. In powerbuilder itself everything seems to be working and connecting together as it should when I preview the data in the datawindows, but something about the application window has issues.

 

Has anyone experienced similar things? I do not know where else to look to fix this.

 

Thanks.

Viewing all 2935 articles
Browse latest View live