How to? Complex tables and graphics like excell.

BlitzMX

Member
Joined
Oct 16, 2012
Messages
12
Programming Experience
Beginner
Hello

I am looking for a way to import several excell reports to build a statistic form like the one bellow, how can i do this in Visual Basic.net 2010?
What function or component should i use to presente data the same way and more, with some colors and everything?
print.JPG
Best regards
Thank you
 
Last edited:
Hi,

I cannot find the specific COM library that you have used but I have tried the Excel 11.0 Com library and this imports a different reference.

The best that I can suggest now is to get rid of the COM object that you have found and then install the latest free PIA's from Microsoft and then start the whole process over again starting with my post No.2

Get the PIA's from here:-

Download: Microsoft Office 2010: Primary Interop Assemblies Redistributable - Microsoft Download Center - Download Details

Good Luck and let us know how it goes.

Cheers,

Ian
 
You can't use any interop version with any installed Office suite. BlitzMX found the version 12.0 interop which means Office 2007 is installed. Excel 11.0 is for Office 2003. Office 2010 is interop version 14.0.
 
Hi JohnH,

I understand your point meaning that you cannot mix 'n' match Interop versions with installed Office versions but are you also saying that that you cannot use Interop functionality unless you have a specific version of Office installed?

I have Office installed on my own machine so I do not face this issue but it could be an important point for BlitzMX when reading my last post. I have assumed that you can just install a version of Interop and all will be fine??

Thanks for any clarification you can provide to the both of us.

Cheers,

Ian
 
Maybe I'm missing something, but the original question was about formatting the data no? Is there a grid-type control you can embed into a form in the Excel PIA? Unless you are suggesting embedding Excel itself? Why wouldn't the user continue to use Excel then?

The grid control in .Net is very basic, I doubt you will have much success at a layout like that, with layered headers, etc...
 
are you also saying that that you cannot use Interop functionality unless you have a specific version of Office installed?
That is right, the interop libraries only works as a managed interface to Office, that must be installed for anything to work. For example the 'dim x As New Excel.Application' would throw an exception about no such interface supported if there was actually no Office behind to back up that interop call.
 
Thanks JohnH,

BlitzMX, Please read JohnH's last post. Your solution is to install a version of MS Office for Interop to be fully available in the .NET Framework.

Once done, the examples already posted should begin to behave as expected.

Good Luck.

Ian
 
I´m afraid i cannot do that, its the company´s laptop, i cant install just what i want.
I did ask for VB.net Express because it is free... but if i can´t use it that way i´ll just build another project.

Thank you for all the help.
 
BlitzMX, Please read JohnH's last post. Your solution is to install a version of MS Office for Interop to be fully available in the .NET Framework.
That's not what I meant or said. I would say BlitzMX don't have to install anything since Office 2007 is already installed, which also includes the relevant PIA, and is why BlitzMX found the Excel 12.0 library in references COM tab in the first place. The error in post 13 was simply that file "c:\test.xls" was not found. If you insist there is a 'test' Excel file in c:\ root, could it be it has .xlsx extension? That is the default file extension for Office 2007 Excel files. And how about file permissions, it is nowadays unconventional to open files in C root folder (and many other system folders places), the user may not have read-write rights to that location.
 
Back
Top