Call us! 512-349-0334 or (877) INDUSOFT

Sample Application Update – Exchange Data Between Objects in InduSoft Web Studio

We occasionally get questions about how to read-from and write-to databases, grids, and .csv files in InduSoft Web Studio. This is a small application that demonstrates the functionality of reading and writing from/to each of these objects.  There is an Access database in the project that has been populated with information from the Microsoft Northwind “customers” database which is used as the main data source.  This InduSoft Web Studio 7.1 application will write to a .csv file, which will populate the grid on the second screen. Selecting a row on the grid will stuff an array tag with values from each of the columns. Here is the sequence of how it operates (All the functionality is in the buttons and objects—there are no graphics scripts or procedures):

  1. Selecting a date and pushing the “Query” button will query the database (an access database in the project folder that was populated from SQL Server Northwind “Orders”) and puts a/some selected row(s) into the first grid.
  2. The first row is selected by default, and if multiple records were returned (try later dates to get multiple rows), select a desired row, then push the “Load Selected” button, which loads the selected row into the lower grid.
  3. Pushing the “Save Concatenated String to .csv” button creates a concatenated string and saves it to the file name shown in the field.  The default .csv file is “Test1.csv” and you can create any other name by selecting the “Name” field and writing the new filename.extension in the field.
  4. Next, go to the .csv screen and see that the same filename.extension is in the field at the top.  Changing it and/or pushing enter will reload the grid with the file listed in the file field.  You can change this as necessary.  You sort the entire grid by selecting any Column Name: it toggles A to Z then to Z to A.  If you want to reload as it comes from the .csv file, simply push the “Reload Grid” Button.
  5. Selecting any row on the grid will populate the cells containing an array tag at the bottom showing how to get the .csv info back into tags.
  6. Finally, pushing the “Load Grid into Class Tag” button clears the Class Tag members (sets all to null) and reloads the entire grid into the class array tags.



Download the Sample Application Here

See the demo video to watch how this sample application works.

Comments are closed.