In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to save and load documents from the database in DevExpress Spreadsheet. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
DevExpress Universal Subscription has all the platform controls needed for. Net development, including more than 600 UI controls, report platform, DevExpress Dashboard eXpressApp framework, CodeRush for Visual Studio and a series of auxiliary tools.
System background
Platform: ASP.NET MVC
Product: MVC Spreadsheet
Implementation steps:
1. Create a helper class that returns the Spreadsheet settings, and be sure to specify the Name and CallbackRouteValues properties:
Public static class SpreadsheetSettingsHelper {public static SpreadsheetSettings GetSpreadsheetSettings () {SpreadsheetSettings settings = new SpreadsheetSettings (); settings.Name = "SpreadsheetName"; settings.CallbackRouteValues = new {Controller = "Home", Action = "SpreadsheetPartial"}; Return settings;}}
two。 Handle the Saving event in these settings, and then use the SaveCopy method to save the Spreadsheet document to byte []. Then save the results to the database:
Settings.Saving = (s, e) = > {byte [] docBytes = SpreadsheetExtension.SaveCopy ("SpreadsheetName", DocumentFormat.Xlsx); DataHelper.SaveDocument (docBytes); e.Handled = true;}
3. Use helpers in partial views and controllers with Spreadsheet:
@ Html.DevExpress () .spreadsheet (SpreadsheetSettingsHelper.GetSpreadsheetSettings ()) .Open (Model.DocumentId, Model.DocumentFormat, () = > {return Model.Document;}) .GetHtml () public ActionResult SpreadsheetPartial () {/ / Spreadsheet's CallbackRouteAction method return SpreadsheetExtension.GetCallbackResult (SpreadsheetSettingsHelper.GetSpreadsheetSettings ());}
Change record:
16.1:
Spreadsheet now allows you to handle some operations in Controller, so you can use Spreadsheet ribbon's' Save' button to save the document to data.
15.1:
You can now load the document using the SpreadsheetExtension.Open method and call the SpreadsheetExtension.SaveCopy method to save the changes.
For older versions:
Use ISpreadsheetComponent.LoadDocument to load the document and use ISpreadsheetComponent.SaveDocument-to save the document.
After reading the above, do you have any further understanding of how to save and load documents from a database in DevExpress Spreadsheet? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.