ExcelHelper


Author
Message
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
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.

Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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.

Edhy Rijo

Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
Thank you very much. That did it.
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.
Terry Bottorff
Terry Bottorff
Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)Advanced StrataFrame User (778 reputation)
Group: Forum Members
Posts: 448, Visits: 12K
I read that but I was not sure how to do it. Sorry
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Oh, no big deal, just glad you got it going! Smile
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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! Tongue

Edhy Rijo

Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
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.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Cool Cool
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search