cancel
Showing results for 
Search instead for 
Did you mean: 

save dw in PBD or PBL at runtime

Former Member
0 Kudos

Hi all

PB classic 12.5.1 & MS SQL Server 2008 R2

I already create dynamic datawindow object at runtime but how I can save it in a  PBD at runtime

Also, how I can save it in PBL at runtime and use it without compilation for my application

finestraco

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all

Thanks for your help, actually I do not know the fields names at runtime and also there is no table at all

for this reason I create external datawindow and I accept from user which fields (name,type,..etc)

after that I create the table .for data entry

but how i can convert the created datawindow on-fly (external) to another datawindow  (SQL SELECT )

thanks again for your help

finestraco

Former Member
0 Kudos

Hi Finestraco;

Have you thought about using the SyntaxFromSQL ( ) command for the SQL aware DWO creation?

Regards ... Chris

Former Member
0 Kudos

Hi Chris

Thanks for your reply, I already use SyntaxFromSQL(), But I thought that there is another easy way to do that.

Actually, the user designs a card and add fields like text,column,picture,barcode,line,capture an image ..etc and after that I create external datawindow on-fly  then I create another SQL SELECTDW for dataentry called a production form which let the users enter data  to the a table I created according to External DW, after that the user design and print a report according to SQL Select  DW , It means that I created three DW one as External and two as SQL SELECT (Card,Form,Report).. I thought maybe another way to do all previuos works  in proper manner.

Thanks again Mr. Chris and for all

finestraco


Former Member
0 Kudos

hi all

I forget to tell that, when I try to set in printpreview  mode for the created datawindow on-fly  to use zoom in & out, but it gives error null object reference....

thanks

tobias
Explorer
0 Kudos

Hello!

You can store the datawindowsyntax in the database and recreate them every time you want to use them.

The second approach could be to store the syntax as a file an then use the PowerBuilder-Function "LibraryImport". You can check out the syntax at the help files...

hth,

Tobias

Former Member
0 Kudos

Hi Tobias;

   Just to also add ... you can use:

1) LibraryCreate ( ) method to create a new PBL "on-the-fly".

2) After importing the DWO, use the AddToLibraryList ( ) method to append the library to your applications search path (which you can rename to a .PBD BTW).

HTH

Regards .. Chris

Former Member
0 Kudos

Hi finestraco;

   You do not need to place the DWO into PrintPreview mode to zoom it. Just use the following syntax to zoom in by 2x (200%) ...

DC.Modify ( "DataWindow.Zoom='200' ") 

Note: the only DW object type that will not zoom is a graph. In that case, you definitely need to enter print preview mode.

HTH

Regards ... Chris

tobias
Explorer
0 Kudos

Hi Chris,

true - but there is no need to create a new pbl. In my opinion an existing (maybe one for all dynamic created dwos) should be enough. Otherwise it could get rather confusing at runtime... 😉

regards,

Tobias

PS: Merry xmas to everyone!

Former Member
0 Kudos

I agree ... I like your suggestion to use the DBMS the best and have implemented dozens of applications utilizing that method.  

tobias
Explorer
0 Kudos

Me too Chris, the only problem could be the performance. Loading from PBL/PBD is so much faster then a create from syntax. Damn! 😉

So, going into holildays by now! Best wishes,

Tobias