简体   繁体   中英

Options for PivotTables in Excel

I need to design a small project for generating excel reports in .NET, which will be sent to users to use.

The excel reports will contain PivotTables.

I don't have much experience with them, but I can think of three implementation alternatives:

  1. Set a query for it, populate it, send it disconnected. This way the user will be able to group values and play a little, but he will not be able to refresh the data.
  2. Generate a small access database and send it along with the excel file, connect to it.
  3. Copy the data to the excel (perhaps in some other sheet) and connect to the data there. This will make the excel file very large I think.

What would be the best alternative in regards to performance vs usability? Is there another alternative I don't know about?

Since it's a small project, you can rely on Excel for data storage from the application. It'll be easier to develop and test, and simpler to maintain.

Do you have to keep the data "offline"?

What I usually do in these cases, where you have quite a bit of data, is to use an existing SQL server already on the network. If it is to be used at the office, the users will be online anyway.

Just remember to create a dedicated user with restricted access on the SQL server for this report and don't store the "sa" password in the excel file.

If you mean users outside of the office by "sent to the users", this would not be a good solution. If that is the case, I would try to include the data in the excel sheet and see how big it will become. That will be the most user friendly solution if the file is not too big.

Also, I found this online: Different Ways of Using Web Queries in Microsoft Office Excel 2003 . This will let you store the data on a public website (with a secret URL if you want) and then let Excel pull the data. That way you do not have to fill the users' inbox with large files, and you can also update the data later without resending the excel file.

@Espo

No, the users will not have access to the original datasource, that's why I'm considering creating a small access database with the data subset required for the report

Option 3 sounds the simplest and I would have thought Excel is as if not more efficient than Access for storing the data. The trouble with two files is getting the links between them to work even in a different location.

@paulmorriss

Maybe... the problem with that is that there are limitations as to how much data a single sheet can contain... I'm thinking option 2, unless someone tells me it is not a good idea in regards to performance

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM