[Solved] How can DBGrid content be displayed on the web? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- loaded · 2023-08-09 05:52 Hi All, In my desktop application, I easily perform operations related to my PostgreSQL database. But now I have to do something different. Can I publish the data queryed by the user over the Web via the DBGrid object? Or is there a different way? Can it be done? I guess it can be done with Asp or Php. But I want to do it in Lazarus. Any help would be greatly appreciated. Respects. ---------------------------------------------------------------------- Zvoni · 2023-08-09 06:38 TDBGrid has a SaveContent-Method https://lazarus- ccr.sourceforge.io/docs/lcl/grids/tcustomgrid.savecontent.html ---------------------------------------------------------------------- loaded · 2023-08-09 06:43 Thank you so much Zvoni for your information. I want something simultaneous. The user will make a query from the web and will see the results in the browser at that moment. In fact, we can think of it as a simple web server. Is something like this possible in Lazarus? ---------------------------------------------------------------------- DonAlfredo · 2023-08-09 08:00 Fpcupdeluxe logger uses the mORMot to do something you wish for. Using only FPC. Example: https://www.batterybutcher.com:8843/root/getinfohtml?Country=Ireland https://www.batterybutcher.com:8843/root/getinfohtml?Country=Brazil See: https://github.com/LongDirtyAnimAlf/fpcupdeluxe/tree/master/logger https://github.com/LongDirtyAnimAlf/fpcupdeluxe/blob/35fd87c70a84be8cb f31a26d752c9b133786cd92/logger/mormotdatamodelserver.pas#L152 ---------------------------------------------------------------------- loaded · 2023-08-09 09:06 Thank you very much for your reply  DonAlfredo. Seems like a good option for a start. ---------------------------------------------------------------------- egsuh · 2023-08-09 22:40 It’s little bit confusing. DBGrid is visual control, which is not usable in HTTPServer. Using dataset directly may be better for later maintenance (e.g. migrating to CGI server, etc. ) ---------------------------------------------------------------------- loaded · 2023-08-10 05:02 Thank you very much for your reply  egsuh Yes, I realized that in my tests yesterday.    I guess I'll have to learn one-on-one Web Programming. ---------------------------------------------------------------------- egsuh · 2023-08-12 02:59 It would be also great if xml format is directly usable in HTML page. ---------------------------------------------------------------------- delphius · 2023-08-21 08:08 Quote from: loaded on August 09, 2023, 08:43:05 amI want something simultaneous. The user will make a query from the web and will see the results in the browser at that moment. In fact, we can think of it as a simple web server. Is something like this possible in Lazarus? You can use SQLDBRestBridge to achieve this. Here is an example This is just a bridge for performing crud operations on data in the database via the rest api, by itself, for your task, it is only able to output data in the required format (json, xml, etc.), so to output in a human-readable format, you will need to do some additional actions After you have the data in the desired format, for example in json, you just have to give the user a link to a static html page placed anywhere (up to saved on disk), inside which, using javascript, you can request the required data through the created rest api (including with authorization) and output in the required visual form, up to the possibility of filtering the received data and selecting new data, including combined from several queries without reloading the page. ---------------------------------------------------------------------- loaded · 2023-08-21 08:42 Thank you very much for your reply  delphius Regarding the subject, I decided that it would be more useful to switch to a Web Application for database (also map display) operations. I am currently working intensively for another project. When I am available, I will go to the Web Course, then I will only use the Web for such projects.