PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

This forum is for conversations about Internet development using CXP, WebSockets, HttpEndPoint, etc.
Message
Author
User avatar
SlavkoDam
Posts: 111
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#1 Post by SlavkoDam »

Application Article Codebook.

This is an application for creating, browsing, searching, editing and printing article codebook with 1.000.000 records. The codebook uses Serbian Latin language.

Below is the code for creating pages in the application, which are displayed in the following screenshots. You can see in the code that each web UI component is created with a single-function call and its attributes are set in Xbase++ language and style without HTML/CSS. You can find the complete code and the application to run in the attachment. First you have to create the database and then you can browse, search and edit it.

Code: Select all

FUNCTION Cb(oSrv)
**
LOCAL aHClr := {clrBlack,clrSkyBlue,clrDodgerBlue},;
      auth := "COBA Systems;www.cobasystems.com;coba@cobasystems.com;" +;
              "cobasystems@gmail.com;+381 64 2185522 Coba;***;" +;
              "SD-SoftDesign;Alaska Software Technology Partner;" +;
              "www.sd-softdesign.com;info@sd-softdesign.com;" +;
              "sales@sd-softdesign.com"
**
HSETTEXT(oSrv,"Segoe UI")
HASSNSET(oSrv)
**
RETURN HDOCBGN(,{"files/cbook.js"},,,"Article codebook",,,,,,,HSETGUI(,.T.)) +;
       HDLGBGN({,1,"R"},{800,450},"Article coodbook",icoPower,;
               {,{,clrBeige},,10},{,,,clrDefBG},,,"C") +;
       HHEAD(,,"Article Codebook",,{{"Verdana",30},{clrBlue},,,"C"}) +;
       HBTN({20,150},{385,150},;
            "CREATE BIG DATA;Create a test.dbf database;with 1.000.000 data records",;
            icoDbf,{{,14,"B"},{{clrWhite,clrHgBG,clrMViolet},,,aHClr}},;
            {{,,14},{40,40},,clrDefBG},{2,,,10},,,,,"CbDbfClk()") +;
       HBTN({410,150},{385,150},;
            "BROWSE BIG DATA;Browser with data from test.dbf;and standard database operations",;
            icoView,{{,14,"B"},{{clrWhite,clrSeaGreen,clrMGold},,,aHClr}},;
            {{,,14},{40,40},,clrDefBG},{2,,,10},,,,,HTTPREDIR("CbBrw",,"B")) +;
       HTOOLBAR({20,310},,;
                {{"Send mail",icoMail,HTTPREDIR("CbMail",,"B")},;
                 {"Make QR code",bmpQRCode,"CbQrcClk()"},;
                 {"Help",icoHelp,HTTPREDIR("CbHelp",,"B")},;
                 {"Authors",icoAuthor,"MsgInfo('" + auth + "','','Authors')",,;
                  {,,,,.F.}}},;
                {{190,100},{{,14,"B"},{{clrDBlue,clrLBrown,clrMBrown},,,aHClr}},;
                 {,{32,32},,clrDefBG}}) +;
       HDLGPOP(HIMG(,{260,260},,,,,,,{"QrcImg"}),"QRCode COBA SYSTEMS",,,;
               {"QrcDlg"},"DlgClose('QrcDlg');") +;
       HDLGEND() + HDOCEND()

*============================================================================*

FUNCTION CbBrw(oSrv)
**
LOCAL html, path := HAPATH(oSrv) + "data\",;
      aCols := {{"IF(flag_,'files/CheckBox.bmp','')","St",,20,"I"},;
                {"mark_","Code",,60},;
                {"idname_","Acticle name",,140},;
                {"meas_","UoM",,40},;
                {"quan_","Stock" + chrLF + "quantity",,100,,"99,999,999,999.999"},;
                {"price4_","Retail" + chrLF +"price",,100,,"9,999,999,999.99"},;
                {"price0_","Net invoice" + chrLF +"price",,100,,"9,999,999,999.99"},;
                {"price1_","Gross invoice" + chrLF +"price",,100,,"9,999,999,999.99"},;
                {"price2_","Purchase" + chrLF +"price",,100,,"9,999,999,999.99"},;
                {"price3_","Wholesale" + chrLF +"price",,100,,"9,999,999,999.99"},;
                {"taxr_","Tax%",,40,,"999.9"},;
                {"uuid_","UUID",,280}}
**
IF !FEXISTS(path + "Test.dbf") .OR. !FEXISTS(path + "Test.dbt") .OR. ;
   !FEXISTS(path + "Test_s.ntx") .OR. !FEXISTS(path + "Test_n.ntx")
  RETURN ""
ENDIF
**
HASSNSET(oSrv,"IsTemp",.F.)
HASSNSET(oSrv,"FltExp","")
HASSNSET(oSrv,"FltCnt",0)
HASSNSET(oSrv,"Temp",UNIQFNAME(path,,"DBF"))
HASSNSET(oSrv,"Path",path)
SET PATH TO (path)
DBOPEN(,{{{"Test"},{"Test_s"}}},,,.T.)
**
html = HDOCBGN(,{"files/cbook.js"},,,"Article codebook") +;
       HDLGBGN(,{1200},"Article codebook",icoPower,{,{,clrBeige},,10},;
               {,,,clrDefBG},,,"C") +;
       HDIVBGN({,1,"R"},{1200,720}) +;
       HHEAD({20},,"Browse and edit articles",,{,{"mediumblue"}}) +;
       HTOOLBAR({20,110},,;
                {{"Find code",,"CbFltClk('C')"},;
                 {"Find name",,"CbFltClk('N')"},;
                 {"Find word",,"CbFltClk('W')"},;
                 {"Filter price-",,"CbFltClk('P-')"},;
                 {"Filter price+",,"CbFltClk('P+')"},;
                 {"Filter quantity-",,"CbFltClk('Q-')"},;
                 {"Filter quantity+",,"CbFltClk('Q+')"},;
                 {"Filter off",,"CbFltClk('OF')"},;
                 {"Print",,"CbPrnClk()"},;
                 {"Reindex",,"CbIndClk()"},;
                 {"Exit",,HTTPREDIR("CbExit",,"B")}},;
                {{120,30},{{,,"B"},{{clrBlack,clrSkyBlue,clrRoyalBlue},,,;
                 {clrBlue,clrLinen,clrBrown}}}},,{"CbTBar"},"V") +;
       HPARAG({180,70},,"Click on an article to display its details.",;
              {{,12,"B"},{"brown"}}) +;
       HBRWPGN({180,110},{500,510},,aCols,{,,"CbPage"},100,,,{"ArtDetDisp"},,;
               {"CbBrw"}) +;
       HFORMBGN({710,110},{470,500},,,,{,{,clrWhite},,5,,"A"},{,,clrMBlue},,,;
                {"ArtForm"}) +;
       HFORMTBL({,-5,"M","R"},;
                {{35,"Article code:",{,,12,7},,,,,{,"Code"}},;
                 {35,"Article name:",{,,30,25},,,,,{,"Name"}},;
                 {35,"Unit of measure:",{,,5,3},,,,,{,"Meas"}},;
                 {35,"Stock quanitity:",{,,18,15},,,,,{,"Quan"}},;
                 {35,"Retail price:",{,,15,13},,,,,{,"Price4"}},;
                 {35,"Net invoice price:",{,,15,13},,,,,{,"Price0"}},;
                 {35,"Gross invoice price:",{,,15,13},,,,,{,"Price1"}},;
                 {35,"Purchase price:",{,,15,13},,,,,{,"Price2"}},;
                 {35,"Wholesale price:",{,,15,13},,,,,{,"Price3"}},;
                 {35,"Tax (%):",{,,5,5},,,,,{,"Tax"}},;
                 {35,"Date of change:",,"D",,,,{,"Date"}},;
                 {35,"ID:",{,,10,5},,,,,{,"Id"}},;
                 {35,"UUID:",{,,40,36},,,,,{,"Uuid"}},;
                 {35,"Flag:",,"2S",,,,{,"Flag"}},;
                 {120,"Description:",{340,,,5},"ML",,,,{,"Desc"}}},;
                {130,350}) +;
       HFORMEND() +;
       HTOOLBAR({620,660},,;
                {{"Add",bmpNewDoc,"ArtAddClk()",,,{"AddBtn"}},;
                 {"Edit",icoEditText,"ArtEditClk()",,,{"EditBtn"},.T.},;
                 {"Delete",icoTrash,"ArtDelClk()",,,{"DelBtn"},.T.},;
                 {"Save",bmpSave,"ArtSaveClk()",,,{"SaveBtn"},.T.},;
                 {"Cancel",bmpDelete,"ArtCancClk()",,,{"CancBtn"},.T.}},;
                {{110,30},,{,,,clrDefBG}}) +;
       HEDITDATA(,{{35,"Value: ",{,,20,20},,,,,{"Filter","Filter"}}},;
                 {50,165},"Filter",,,,{"FltDlg"},"CbFltAct") +;
       HEDITDATA(,;
                 {{35,"From code:",{,,12,7},,,,,{"FrCode","FrCode"}},;
                  {35,"To code:",{,,12,7},,,,,{"ToCode","ToCode"}}},;
                 {80,120},"Print",,,,{"PrnDlg"},"CbPrnAct") +;
       HEDITDATA(,{{35,"Code: ",{,,12,7},,,,,{"Code_","Code_"}}},;
                 {50,120},"New code",,,,{"NewDlg"},"ArtNewAct") +;
       HSCRP(HSETGUI(.T.,.T.) + " GetDisable(1,14); GetDisable(19);") +;
       HDIVEND() + HDLGEND() + HDOCEND()
CLOSE
RETURN html

*============================================================================*
Image
Image
Attachments
CodeBook.zip
(30.38 MiB) Downloaded 766 times
Last edited by SlavkoDam on Wed Dec 20, 2023 6:09 am, edited 4 times in total.
Best regards,

Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

User avatar
unixkd
Posts: 575
Joined: Thu Feb 11, 2010 1:39 pm

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#2 Post by unixkd »

Can PowerWeb be used with SQLExpress ? I don't use Alaska DBEs

Thanks

Joe

User avatar
SlavkoDam
Posts: 111
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#3 Post by SlavkoDam »

Joe,

Yes, PowerWeb can be used with SqlExpress. PowerWeb generates frontend of your web app. In the backend you can use whatever you want and work with any type of database you use.
Best regards,

Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

User avatar
PedroAlex
Posts: 234
Joined: Tue Feb 09, 2010 3:06 am

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#4 Post by PedroAlex »

Slavoljub Damnjanovic,

I I will need to create a web application to query, create and print records in a web application that runs in a browser.
This application will be used on a Sunmi V2 POS on android 7.1. (https://www.sunmi.com/en-US/v2/)
Can Powerweb serve this type of application!?
Does it allow printing in android on a printer connected by BT?
Do you have any example that I can try!?
Thanks.
Pedro Alexandre

User avatar
SlavkoDam
Posts: 111
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#5 Post by SlavkoDam »

Pedro,

PowerWeb can service any kind of web app. As I said before, I work only in Windows and have no experience with Android.
There are two ways of printing in a web app:
1. Create HTML print document and print it with document print() function to a default system printer.
2. Create XPP print document with PowerWebPrn and print it to a default or selected XbpPrinter() object.

All PowerWeb examples I have, I posted here on the forum. Something that is similar to your app is my Order reservation example.
Best regards,

Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

User avatar
PedroAlex
Posts: 234
Joined: Tue Feb 09, 2010 3:06 am

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#6 Post by PedroAlex »

I'm trying to test your examples on my network and they don't work.
It only works on the pc where the pwcom folder is stored.
If you replace the Localhost with the public IP, it doesn't work on your own machine, it doesn't work on another machine on the local network and from the extrior it doesn't either. Obviously I created the rule on the router pointing the internal IP to port 2024. These examples only work on the local machine.
An Alaska xBase programmer seeks to keep up with new market trends. At the moment multiplatform applications are growing a lot. It is necessary that the applications run on Android and MacOS and that they can print on these systems. If we don't catch this train, we're going to lose a lot of ground. Because Microsoft didn't keep up with mobile computing. Android dominates the mobility market and if we can't get our applications running on this system, we'll soon be out of work. Or rather xbase ceases to be useful.
Pedro Alexandre

User avatar
SlavkoDam
Posts: 111
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#7 Post by SlavkoDam »

Yes, PowerWeb demo examples work only on a local computer, because they are demos and work on a locally created HTTP server. But, PowerWeb production version can run on any internet address on the web.

Alaska software is for Windows OS, you can check that on Alaska website. I am developing libraries and applications in Alaska software for Windows OS. I am not interesting for developing in other OS. I don't know if Alaska software can work on Android or MAC and don't care. Do you know that? If you want to develop applications on non-Windows platforms, find some other tools and do it on your own way. PowerWeb is not for that.
Best regards,

Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

User avatar
SlavkoDam
Posts: 111
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#8 Post by SlavkoDam »

This is a link to a public server where is installed PowerWeb app example Article Codebook. It is available all the time. This shows that PowerWeb app can run from any web address, not only on a local computer. It all depends what is the address of the HTTP server, the app is running on.

http://server.cobasystems.com:1050/codebook/cb

Considering printing in a web app, HTML print() function works the same on any platform where the app is running. It doesn't depend on the system where is the web app or the programming language it is written with.
Best regards,

Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

User avatar
PedroAlex
Posts: 234
Joined: Tue Feb 09, 2010 3:06 am

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#9 Post by PedroAlex »

{
Considering printing in a web app, HTML print() function works the same on any platform where the app is running. It doesn't depend on the system where is the web app or the programming language it is written with.
}

are you sure about this ?
did you test on mac or android tablet ?
Pedro Alexandre

User avatar
SlavkoDam
Posts: 111
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: PowerWeb app example - Article Codebook with 1.000.000 Recs (Part 6)

#10 Post by SlavkoDam »

As I said, I work only on Windows. If you have some of those tablets, you can try.
Best regards,

Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

Post Reply