By Terry Bottorff - 2/1/2010
I downloaded your sample and it runs like a charm. I tried it on my project and I get this error:The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine. I am running window 7 64 bit and I believe their is no 64 bit jet provider. Why does your sample run and mine won't? Is there a way around this? TIA.
|
By Edhy Rijo - 2/1/2010
Hi Terry,
Your project is setup by default to be build for "Any CPU", if your application is design to run in "x86", change the Project's Platform to "x86" and it will build for 32 bits and will run in 64bit OS as 32bits.
|
By Terry Bottorff - 2/1/2010
Thank you very much. That did it.
|
By Trent L. Taylor - 2/1/2010
Yup....if you read the fine print on the sample I posted, I indicated that you have to compile in x86 for a 64-bit platform since Jet doesn't have a 64-bit driver. Looks like Edhy pointed you in the right direction.
|
By Terry Bottorff - 2/1/2010
I read that but I was not sure how to do it. Sorry
|
By Trent L. Taylor - 2/1/2010
Oh, no big deal, just glad you got it going!
|
By Edhy Rijo - 2/19/2010
Today I started to use the ExportToExcel() method of the MicroFour.StrataFrame.Tools.ExcelHelper, very easy and straight forward method. Since it will use the BO.CurrentDataTable, I was able to rename my columns and even add couple of columns I needed and the output was just perfect, of course the document in Excel needs to be formatted.
Now I have a couple of questions:
1.- The document is created with the file name I pass to the method, but the "Tab Name" or "Sheet" created in Excel will have the name of the BO.CurrentDataTable and even if I change the BO.CurrentDataTable.Name, it will always use the original BO.CurrentDataTable.Name, then when printing the document the title used is the "Tab" name. I know I can change this in the document Header, but this is a document that will be generated many times and this will be a very annoying task for the end user, so is there a way to control the name used for the "Tab Name" or "Sheet"?
2.- For the columns, the BO.CurrentDataTable has the types defined, String, Decimals, etc. in Excel all columns are type "General", is there a way to honor the column type of the BO.CurrentDataTable?
At any rate, I was generating this document in Excel using the RSS Export to Excel, but the quality of the Excel output was not good and the way they generate the columns make it impossible to add formulas, etc. in the resulting Excel document. This method is by far much more flexible and faster. Thanks!
|
By Edhy Rijo - 2/21/2010
Trent, do no worry about my previous message questions.
I found out by looking at the source code that you are using the businessObject.TableName which is a ReadOnly property, I believe you could have used the CurrentDataTable.Name instead and that could be modify by us.
I found a better way by using the Office Automation, I was able to open the document created by the ExcelHelper class and formatted in the way I needed, even adding custom formulas, nice headers and footers. Of course it took me a bit of time but it was worthy.
|
By Trent L. Taylor - 2/22/2010
Cool
|
|