I am working on a spotfire extension where data is extracted from a spotfire table, sent to a standalone R script, and the results added as a new column. I am having trouble adding a new column to the spotfire table. After a bit of searching, the only references to adding a column were to either add a CalculatedColumn from an existing column and an expression or to convert the data to a text file data source, (the link explains how to do it using python, How to create a data table on the fly in Spotfire via python.). Are these the only options, is there a better way to do it? Note that i am constrained to use Spotfire 6.5, C# and the R.Net environment, i can't use TERR or Iron Python scripts. Any help is appreciated.
Related
I am trying to get data from google sheet into my .net core project using Google.Apis.Sheets.v4.
Google sheet data is growing daily i.e a new column is added daily with current date as header name.
I want to get an entire column based on a given date. Now the problem is I cannot send a fixed range as columns grow on daily basis. So One method is I can use formula to get the header using date but I didn't find an option to send formula from c# through Google.Apis.Sheets.v4. as it accepts only range(as far as my understanding).
Does anyone have any idea how to implement it.
Below is the sample google sheet link
Click Here
I have used formula for eg. =SUBSTITUTE(ADDRESS(3,MATCH(DATE(2022,4,30),Milk!A1:Dz1,0),4),3,"")
**Question is => **
The above formula I can use it in google sheet. But I want to send it from my .net project instead of range and get result. Is it possible to do so and if not is there any other way??
I'm struggling to figure out how to convert a CSV file into a database. I've tried a few methods here but I can't wrap my head around it. I have a CSV file with thousands of rows and I need to convert that into a
SQLite database using C#. Any help is appreciated!
You can leverage MS Excel, open the CSV file and specify your character separator as needed (I believe it will default to tab limited). You can now save your thousands of rows as an Excel spreadsheet versus the character separated file (CSV) format.
Then you can leverage the open source OpenXML libraries to open the Excel document and work with it using object model. In an object oriented fashion, you can programatically create your new database using SQL statements.
Query for the spreadsheet headers to be used as your column names. Of course you'll need to ensure that your source CSV had provided appropriate headers. These can easily be added to the top of the large file if not.
E.g.
https://learn.microsoft.com/en-us/office/open-xml/how-to-get-a-column-heading-in-a-spreadsheet
Next, you simply iterate the rows and construct your SQL statement to insert the rows. You can review the Open XML docs, Microsoft docs, or existing StackOverflow docs for sample code on how this is easily done.
How to read xslx with open XML SDK based on columns in each row in C#?
I am familiar with C# standalones but never written any web applications. I need some pointers on c# asp.net applications to do following stuffs.
Create a table profile, insert rows and columns with rich text edit controls, ability to insert images(low priority) and dynamic row manipulations like move rows, insert custom rows (e.g. a data row from a db that can be inserted into my current table profile) and then export different table profiles into tabbed excel sheet.
I am looking at:
https://msdn.microsoft.com/en-us/library/cc850837%28office.14%29.aspx
http://www.c-sharpcorner.com/UploadFile/hrojasara/export-datagridview-to-excel-in-C-Sharp/
http://www.codeproject.com/Tips/820176/ASP-NET-Gridview-with-Row-Drag-and-Drop-using-Jque
http://www.codeproject.com/Articles/467788/Dynamically-adding-and-deleting-rows-from-ASP-NET
I will do my research but since i have no experience on controls available if someone points in right directions on concepts which is suitable for this as this looks more complex for 1st app it will be helpful
I would recommend you Kendo UI framework that allows to do what you need. This is a website with demo - http://demos.telerik.com/kendo-ui/grid/index. It allows to make Excel and PDF export as well.
I have one Excel sheet, in that plenty amount of data is there, so need to write these data in the SQL server table directly. I searched in google but I didn't found a proper solution for my requirement.
My Excel contains the data in row wise, I mean that data is not continually provided. Having sub headings & some other information about tables description written after every table ended.
I hope you all understand my requirement. Please anybody have idea about this issue, or alternate solution to resolve. Have to store this excel data in to the SQL server table.
Here data is columns as rows & rows as columns. So how to read in this case.
firstname vijay vikram vikek varun
lastame kumar rathod goshal kandari
mobile 45425 456546 54656 454615
Like above my data in excel sheet so how capture this kind of data.
Did you try using a excel interop.Using interop you can even read particular cells.You can read values by specifying a range and build a datatable or list.
These links may help
http://sandeep-aparajit.blogspot.in/2008/08/how-to-read-excel-in-c.html
C#: Getting a cell's value with Excel.interop
If you want to insert data into db directly, without front-end functionality, then you can do it by using SSIS packages or import functionality available in SQL server
I have tried importing data from excel to sql server table. The process is in sql server right click on particular database and under tasks tab select import data option then select source excel file and destination table. It's working fine for me.
Thanks
Venkat
I need to create a workbook which has a raw data on a sheet and a pivot table on another sheet. The pivot is created from the raw data. Then I need to create a chart with this pivot on the same or new sheet.
How can I do this in C# - and is this possible using VSTO?
Easiest way to do it?
Use Open XML SDK 2.0
Build a pre-generated version of the workbook with raw data, pivottable and pivotchart already created.
Install the OpenXML SDK 2.0 setup package
Use the OpenXML SDK 2.0 productivity tool from this install to open the workbook
Select the root element on the left hand pane, and then right click and select Reflect Code
Done - on the left pane is a complete C# class with the necessary code to generate the file.
Well not quite done as you still need to refactor the code to take into account dynamically adding the required data content, however this will get you 97% of the way if you already know C# fairly well.
I've done something similar to this before, but I didn't do it using C#. I used VBA since the language is already built in to Excel.
My approach was this:
Create a worksheet called "RAW DATA." This worksheet has a QueryTable object in it that can be updated via code in VBA.
I manually created a pivot table based on the QueryTable in the RAW DATA worksheet.
I then added code in VBA so that after RAW DATA was updated, Pivot Table was refreshed with the new data.
This method works really well if the layout of your raw data and your pivot table stays the same. I have a workbook that I made for a cowork that updates multiple sheets with pivot tables based on one set of data. She really likes it because just by clicking one button, she has a refreshed view of all of her data.
If this approach works for you and you'd like more details as to how to implement some of those methods, let me know more details of your situation and I can try to help you out.
One option is to connect to database from Excel and refresh the "Raw data" sheet, via VBA or defining an SQL query in Pivot data source. This is not so great as the user who opens the file must be able to connect to the database.
The other option is to fill the "Raw data" sheet programatically via C#. There are numerous libraries that can help you with that, even some free ones, but you can also do it yourself by using the Excel XML format (SpreadsheetML). You can use the Excel 2003 XML format or the new Open XML Excel format. The latter is far more complicated, but with it you can also take advantage of the OpenXML SDK and the Excel Package API.