ASP.NET: How to retrieve data from access/Excel file? - asp.net-mvc

A company is creating a web site for the organization I work for. Since the web site is still being developed, some modules are not yet there. For instance, in order to print data obtained from a query, one needs first to export it to Excel or Access. Then, from Excel or Access, it is important to do some adjustments (adjust columns width and rows height, modify titles, so on) to make it easy to print.
I would like to create a small web application that will avoid us doing those operations manually. Unfortunately, the other application is in JSP/Java while I only know ASP.NET/C#.
How can I retrieve all this data, which are either in Excel or Access, and reload them into my application for printing?
Thank you

This guy did a brilliant article on getting data from excel using ado.net, I have written a program based on his instructions and it is working fine with Excel 2007 files, and can handle very long column data as well.
Link to article

Have you considered writing a macro in Excel instead of trying to do everything on the server? Creating a macro in VBA isn't difficult, and you can distribute it as an Add-In to your users. Takes some good instructions for them to install it, but avoids all the potentially messy issues of import/export of Excel files.

Related

Custom Report Printing in Oracle Apex

What is the best way to create a Custom Report Template to print in Oracle Apex ? I saw some posts that've already been answered, but since they were Apex 5.1, I was wondering if these were still up to date, or if there are easier way no (I am using Apex v21.1). Also, the "Printing" attribute in the Reports does not give me the possiblities to do these specific things :
I would like the users to print an Interactive Report, which will display the logo of the company, the export date, and the data obviously. Is it possible to set custom margin so the list take more space on the page, and to set a custom size for the column, in case I have a column with a long text in it ?
Thanks in advance,
Thomas
Welcome to one of the weakest points of Oracle APEX, printing.
Honestly, the best option is Apex Office Print(AOP), but they are a paid plugin.
They enable lots of different printing, quite easy to grasp, and I am quite satisfied with them.
Other options I have seen are:
Make an excel sheet from within the database and you can generate that dynamically(you can also expand fields, colour them, probably can also put an image in there but I havent tried that).
I once decided to torture myself and I tried printing through HTML, as in I created an HTML document with the data I wanted(I made an invoice), but that has many problems, chief among them being page breaks.
Another option that was recommended to me, but that I have not yet tried was setting up an Apache FOP, having the Oracle database generate an XML, send it there and get back a nice looking pdf(http://www.apex-reports.com/videos.html).
I hope you get something working, and if you try this Apache FOP approach please let me know how it goes.

Is it good to use Excel interop in an MVC.net application to Expose Excel calculations to web

I have a web application developed with MVC.net. In this application i create a simple user interface to represent some cells of an excel file. When user change values of the UI it has to get reflected in the Excel file and needs to do some calculations and return results to the UI. I was using Excel interop for this solution and i don't need to save it back to the Excel.
Is this a fine solution or is it not a recommended one. If there are any other solutions please do let me know.
Thanks in advance.

Importing a large amount of data for testing only.

Here is some background:
I have a client that wants me to test a rails app against a large number of potential inputs in a form page. He has an Excel spreadsheet with about 200 potential input combinations that will be entered into the form.
The client want's the app to be able to "read" the spreadsheet and execute the couple hundred form submissions.
My solution was to just import the spreadsheet into a database table, but the client doesn't want an extra database table in the application.
So here is the question:
Is it possible/not exceptionally complicated to read/crawl a spreadsheet or csv file to do the above, or import data into only the test database?
I haven't been able to find any resources that aren't about simply importing the spreadsheet.
Thanks!
Use spreadsheet gem to read and parse your data from excel.
Use capybara to automate the form submission. Initial learning curve will be steep, but once you get a hang of it, it comes really handy to automate web interactions.
There is a ruby gem called roo which allows you to access the contents of:
Open-office spreadsheets (.ods)
Excel spreadsheets (.xls)
Google (online) spreadsheets
Excel’s new file format .xlsx
Using this gem, you can read test data from file and use them in tests to execute.
Do you have some magical method for importing the spreadsheet into the database already? Because the way I see it, you're going to have to parse the spreadsheet at some point anyway and there's no good reason to add overhead by throwing all of this into a database. Write a script that takes the entries and tries them, submission by submission, that way you won't need to store anything.

iPad app designing: sync with Excel file

I'm designing a new app for iPad for a small company. This app will use Core Data to store a local database and a database of products and prices. The last database needs to be always up to date since the prices can change.
This company, has a Excel file to keep this database of prices. So they don't have a SQL db to which I can interact from my app.
One option could be to export the Excel file in CVS and put that file in their server (accessible by internet). Then my app should parse the file.
I don't like very much this idea, though.
Do you have any suggestion?
I had a very similar problem to you. I recently got into a project where the client wanted to import information from an Excel file into an app. I know a lot of people say, just transform it into a CSV and parse it that way, but I really didn't want the client to go through yet another step and introduce a different file format - as simple as that may be.
I also really don't like having the information in the cloud, especially Google. Privacy is something that's important to most companies and I'd doubt they'd approve of you using Google to parse the info.
In order to parse the file, I created QZXLSReader. It's a drag-and-drop solution so it's a lot easier to use. I don't think it's as feature complete, but it worked for me.
It's basically a library that can open XLS files and parse them into Obj-C classes. Once you have the classes, it's very easy to send them to Core Data or a dictionary or what have you.
I hope it helps!
Here are a couple of options for you:
Use Google Doc as the intermediary. When the pricing Excel is updated by someone, simply upload the updated Excel to Google Docs. From your iPad app, you can read the latest data via the Goole API. If the company is up for it, they can move to Google Doc altogether and just modify the online Google Spreadsheet directly.
Use services like StackMob as the intermediary. You will have to write a tool to sync the pricing Excel with SrackMob but you can easily access the data via StackMob's iOS SDK.

OpenOffice spreadsheet import into HSQLDB

OpenOffice ships with HSQLDB. Is it possible to easily import the contents of an OO spreadsheet into the built in database? An added nice to have would be to include the formatting of the cell contents. ie. colors, line feeds, etc.
This question has gone unanswered so I'm offering a bounty. Please provide the code to the solution.
The provided link does work, and no coding is required. To summarize:
Create and register an Open Office DB.
1.1 Looks like you can register any DB for which you have a JDBC driver. (ie. MySql,Postgres)
Create column headings in row 1.
Select data and copy it to the clipboard.
3.1 Limited selection to only the desired rows because OO crashed when I selected all rows.
Go to the Table (Tables pane) view of the database.
Right-click and paste your data.
Follow the instructions provided my the wizard that opens.
I don't know if you would call it easy, but apparently there are ways to import data into open office's base database.
This article explains how to manually import data into the database. And this article has more pretty pictures for the same process. One reason you may not be getting the answer that you want, is that there is very little detail in your question. You could add some more and maybe someone out there can help.

Resources