How to Use This with sharepoint 2007

Mar 5, 2008 at 11:44 AM
i tried the export to excel control on Asp.Net application and it's working fine then i tried to use it on user control and add it to a sharepoint webpart but when i pressed the button and after the excel sheet is exported i found only the header (with the columns names and style) not the data i don't know why can anyone help me on this.
Mar 6, 2008 at 5:17 PM
Edited Mar 6, 2008 at 5:20 PM
I also am using this in a custom Sharepoint 2007 web part that i have written. The button appears to not be enabled. It is not clickable. I have not been able to get it to do anything else but appear. Please let me know what i am doing wrong.

NOTE: I downloaded the source that you posted in Oct 2007 and rebuilt because i needed it to be Strong Name signed. If a newer codebase will solve the problem, please let me know when you've posted it.

Here is the code i have used to instantiate it:

excelExport = new ExcelExport.ExcelExport.ExportToExcel();
excelExport.ID = "excelExport";
excelExport.GridViewID = "gvw_anniversaries";
excelExport.CausesValidation = false;
excelExport.Text = "XPORT";
excelExport.ExportFileName = "Anniversaries.xls";
excelExport.ApplyStyleInExcel = "true";
excelExport.Enabled = true;
pnl_portletContents.Controls.Add(excelExport);
Coordinator
Mar 9, 2008 at 3:34 PM
To be honest, I've never tested this in "Sharepoint".

But here are the basics,

If Me.Page returns a value where Me represents the "ExportToExcel" control, and a gridview exists in that Page, then the control "will" work. If you are using this control in an environment that does not match the above basics, it will not work.

As far as the source code, I am having difficulty checking in. I have posted a note to "CodePlexClient" discussion forum.



briantracy01 wrote:
I also am using this in a custom Sharepoint 2007 web part that i have written. The button appears to not be enabled. It is not clickable. I have not been able to get it to do anything else but appear. Please let me know what i am doing wrong.

NOTE: I downloaded the source that you posted in Oct 2007 and rebuilt because i needed it to be Strong Name signed. If a newer codebase will solve the problem, please let me know when you've posted it.

Here is the code i have used to instantiate it:

excelExport = new ExcelExport.ExcelExport.ExportToExcel();
excelExport.ID = "excelExport";
excelExport.GridViewID = "gvw_anniversaries";
excelExport.CausesValidation = false;
excelExport.Text = "XPORT";
excelExport.ExportFileName = "Anniversaries.xls";
excelExport.ApplyStyleInExcel = "true";
excelExport.Enabled = true;
pnl_portletContents.Controls.Add(excelExport);

Mar 12, 2008 at 9:45 AM
look i don't write the code in the web part i make a usercontrol and then render it inside a custom webpart anyway i had the same problem and i had to rebuild the solution to make the dll strongly named. i think why th button is not enabled is that u put it on a separate webpart than the one has the datagrid they should be on the same page in order to make the button works and it will be only enabled after the datagrid is generated. but still i passed all this and the button works but i don't know why it only extract the header although t works fine on a .net website :(