The database used in this tutorial has been set up on Microsoft Azure.
This tutorial is a continuation of previous Tutorial Update Database Importing By LabTalk Substitution. It shows how to add a button on graph with LabTalk script to open a GetN dialog to enter company name and reimport database based on the new company name and get updated graph.
The procedure is based on Origin 2023b.
This tutorial will show you how to:
string thecompany$="Professional Sales and Service"; //set first company name //The following 3 lines create a dialog to assign new thecompany$ string value getN (Company Name) thecompany$ //(Company Name) will be edit box label in dialog (Which Company to Analyze); //this is dialog title dbimport iw:=[book1]sheet1!; //reimport data of new company from database to Sheet1 of Book1
The text object turns into a button
SELECT SalesLT.Customer.CompanyName, SUM(SalesLT.SalesOrderDetail.OrderQty ) AS OrderCounts FROM SalesLT.Customer INNER JOIN SalesLT.SalesOrderHeader ON SalesLT.SalesOrderHeader.CustomerID =SalesLT.Customer.CustomerID INNER JOIN SalesLT.SalesOrderDetail ON SalesLT.SalesOrderHeader.SalesOrderID =SalesLT.SalesOrderDetail.SalesOrderID GROUP BY SalesLT.Customer.CompanyName ORDER BY SUM(SalesLT.SalesOrderDetail.OrderQty ) DESC