Get charts/graphs from Excel to Matlab Report Generator - excel

I know most of you would advise me to just get the data with xlsread() and plot it in Matlab. However I still want to know if it's possible to get a chart from excel to the matlab report generator as an image (or any other format) by coding it so it's automated.
The reason is I am supposed to make a report using multiple excel files that I did not create and that contains graphs that I would like to put in my report. So that would be more convenient if I could just copy the graphs & charts into my report.
Most of the things I found were saying to plot it with Matlab and nothing else. As i understand with xlsread you can only get [NUM,TXT,RAW]. So is there a function in the Matlab Report Generator to import the Excel graphs or should I just resign myself into reploting everything?

To do what I wanted I followed #CrisLuengo's suggestion and wrote a VBA macro in my spreadsheet that swipes in all the workbooks I have and exports all my charts as jpg.

Related

Insert figure/image to Excel from MATLAB

I'm building my own Excel Add-in using MATLAB Library Compiler.
I'm trying to build a function/add-in which takes two columns of data and plots it on a graph.
I can not figure out how to insert the figure from the MATLAB function into Excel.
Example
We have a MATLAB function called plot2D, which looks like this:
function [fig] = plot2D(DataX,DataY)
fig = figure;
plot(DataX, DataY,'r--');
end
We now use MATLAB Library Compiler and compile it into a xla-file and import it into Excel.
What I want is whenever I use this add-in it should generate a graph inside the current Excel sheet, given two data entries.
Now this doesn't work since Excel can't read the datatype figure of MATLAB.
But how would I go about this? Any suggestions?
Thank you.

How to get the rand() function in excel to rerun when accessing an excel file through python

I am trying to access an excel file using python for my physics class. I have to generates data that follows a function but creates variance so it doesn’t line up perfectly to the function(simulating the error experienced in experiments). I did this by using the rand() function. We need to generate a lot of data sets so that we can average them together and eliminate the error/noise creates by the rand() function. I tried to do this by loading the excel file and recording the data I need, but then I can’t figure out how to get the rand() function to rerun and create a new data set. In excel it reruns when i change the value of any cell on the excel sheet, but I don’t know how to do this when I’m accessing the file with Python. Can someone help me figure out how to do this? Thank You.
Excel formulas like RAND(), or any other formula, will only refresh when Excel is actually running and recalculating the worksheet.
So, even though you may be access the data in an Excel workbook with Python, you won't be able to run Excel calculations that way. You will need to find a different approach.

Pre-populating PowerPoint file with Excel input

I am currently in the following situation:
I have an Excel file where I perform calculations and charts + diagrams are created based on the calculations.
I have a PowerPoint report where I have to copy-paste these visualizations into.
I will need to repeat this process for many Excel files, all containing the same lay out. You can view them as a questionnaire: each Excel file is completed with different answers, though the structure remains the same.
Is there a way for me to create a template PowerPoint report file, where at the start I select which Excel file to 'load', and it pre-populates my PowerPoint file with the correct charts from the selected Excel file?
ndeed, there is a free option available. With SlideFab 2 (lite) you can automate Excel to Powerpoint without coding: You would need to setup the Powerpoint template and link all shapes with the required Excel ranges or charts. Then SlideFab creates the slides for you. When the structure is really the same, you could just let SlideFab connect to the next Excel file and rerun the slide-making process again.
You could also consider using RDBmerge to collect all workbook sheets into one Excel and using formulas to create a kind of staging area which is used for linking with Powerpoint. This would have the benefit that when you iterate a list of worksheet names, your lookup (e.g. using vlookup or index/match) functions would grab the appropriate data into the staging area. SlideFab could then create all slides at once through changing the selected worksheet in a repetitive way.
In case of questions, feel free to reach out.
Disclaimer: I am the owner of SlideFab 2.
Cheers
Jens

Why do programatically created Excel charts look like they are 10 years old?

I am trying to programatically generate Excel 2010 charts (specifically scatter plots) in LabVIEW using the Excel Insert Graph.vi. When I open Excel and select data and create the chart it looks nice and new and easily configurable. When I use the VI to do it, it looks old and ugly and clicking on it to get options takes away my ribbon and appears to transport me back to 2003-land. I'm assuming this works the same way in VB/C# Excel graphing but I haven't tested it. Does anyone know why I can't access the newer charts when graphing through my program? I am using xlxyScatter as the chart type.

SSRS export to Excel UNFORMATTED

I'm looking into SSRS with intention of exporting a lot of the reports to excel. The problem is that when you export it changes cell sizes and removes borders to try and keep the original report format.
Is there anyway to stop this happening? So that the report exports to excel with the "usual" excel formatting? If it requires any coding that's fine as most of my reports will be run from C# code.
Thanks
Mat
You could export to a CSV and import that into a spreadsheet, possibly with some sort of template sheet for the particular report.
You could export the data to Sheet2. Mark sheet 2 as hidden.
Create your designer report on Sheet1.
Run an Excel Macro to read data from Sheet2 and put on Sheet1.
It's not pretty, but you could consider generating Excel sheets from the XML renderer, as described here - this would give you full control over the appearance of the worksheet.
I think what's happening is that you have stacks of fields in your reports that aren't aligned with each other and so when you export to excel, it compensates and generates extra columns to try to come close to what you report looks like.
I used to get this all time and then I figured out that if you used as little tables as possible while using more grouping within that grid, it goes along way to send a clean format to excel. Also watch out if you use a report header whose ends don't align to columns within the report.
So match object's begin and ends with other objects' or span of cells' begins and ends.
I create a seperate report with the same data, but no formatting.
Include a button to export on the main report, and when they click it, it directs them to an unformatted version of the report that is automatically exported to Excel.

Resources