开发者

Winform app to Create and interact with Spreadsheet

I have a c# winform app that shows trading info to users. What we want to do is be able to open an excel sheet and have it request the data from the application. In return application gives 开发者_如何学编程data back to excel. After that if the data is updated in application, it also gets reflected in excel. In other words, we make excel display what app is showing (only when excel requests it).

Does anyone know what we need to achieve this?


Original:

Could use a database connection in Excel to query the database directly?
Where does the winform app store it's data?

Edit:
I can think of a few approaches:

  1. Use excel automation to generate the spreadsheets as the user selects the columns.
    This is probably slower then option 2.
  2. On selecting the columns, save the information to a configuration table on the database.
    Have the spreadsheet read this, and using VBA adapt the sheet to match the application.
    This is more complex than option 1, but much quicker.


Would an in memory database work for you? I have used this one http://www.quilogic.cc/features.htm in the past to make Access VBA work with a .net application. You could have your application write the current data into the in memory store and Excel can read from the store through VBA.


Com interop may be of some use to you. http://dotnetperls.com/excel-interop it allows you to create/edit/read excel (and other com apps) from within your C# app when you reference their namespaces.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜