|
|
Comments and Discussions
|
|
 |

|
If any column name contains parenthesis "( or )" then system throws an XSLT error. One quick fix is to add following two lines in "ReplaceSpclChars" method.
fieldName = fieldName.Replace("(", "_x0028_");
fieldName = fieldName.Replace(")", "_x0029_");
|
|
|
|
|

|
while trying to open an excel file (2010 Format), which is created by using Rklib library,
showing this message "Excel cannot open the file because the file format or file extension is not valid.". Please help me to resolve the issue.
|
|
|
|

|
Hello I am mallikarjun,
I have an application where i can export all my data in Excel sheet.
but i want only particular day data.
how to do this ,,
pls help how to do this...
|
|
|
|

|
Thanks for your good Library but
when i export persian/Farsi language data and open saved file, none of characters are in right form. can you help to fix it?
|
|
|
|

|
Would you provide the source for the RKLib.ExportData.dll?
I am extremly interested in seeing the code for this.
|
|
|
|

|
Here's an alternative method of exporting from a DataSet, DataTable or List<> into a genuine Excel 2007 .xlsx file.
It uses the OpenXML libraries, so you don't even need to have Excel installed on your server.
http://www.mikesknowledgebase.com/pages/CSharp/ExportToExcel.htm[^]
All source code is provided, free of charge, along with a demo of how to use it.
It's dead easy to use. Just add the CreateExcelFile class to your library, then call its CreateExcelDocument function, quoting the name of the Excel file that you want to create:
DataSet ds = CreateSampleData();
string excelFilename = "C:\\Sample.xlsx";
CreateExcelFile.CreateExcelDocument(ds, excelFilename);
It doesn't get much simpler than this !
|
|
|
|

|
I have bookmarked the link to download it at any place. Simple and easy to use application.
Nitesh K Luharuka
(Senior Analyst)
R.B.Software Solutions
|
|
|
|
|

|
light, simple and very useful.nice job.
|
|
|
|

|
Hi man it's very very great article , it solved my time to export data from database to excel
Thanks a lot
Houssameddine
|
|
|
|

|
DataTable dt = ((DataSet)Session["dsComplaints"]).Tables["TblComplaints"].Copy();
int[] iColumns = { 1, 2, 3, 5, 6 };
RKLib.ExportData.Export objExport = new
RKLib.ExportData.Export("Web");
objExport.ExportDetails(dt, iColumns, Export.ExportFormat.Excel, "EmployeesInfo2.xls");
|
|
|
|

|
Hi,
I have a problem, I have commas in the data field itself, so while exporting as csv all data with commas are separated into different columns in the csv, is there a solution for this.
Thanks
Sudheshna K
|
|
|
|

|
I can export to greek language?
|
|
|
|

|
It worked fine for me without much effort
thanks
|
|
|
|

|
work on pc not installed excell trims
|
|
|
|

|
is there a way to do multisheet using this control?
Thanks
|
|
|
|

|
i got "XSLT compile error at (5,1096). See InnerException for details" error and dont know how to go about it.can you help me out.
thanks you
|
|
|
|
|

|
Saved me a lot of time. Easy to implement!
|
|
|
|

|
how to force save as force without the prompting the dialog box?
using webforms
tnx
|
|
|
|

|
Article very good and help me lot. but some case it cause exception.The Exception msg:"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."
|
|
|
|

|
Not working Giving error Obj not reference.
|
|
|
|

|
Simple, useful, working ! Thanx !
|
|
|
|

|
have u ever try to open the CSV in excel. open and try and feel shame
|
|
|
|

|
Really it works!!! Great and Thanks
|
|
|
|

|
Date Time after export become 2010-05-03T14:29:12 08:00 instead of 5/3/2010 2:48:12 PM
|
|
|
|
|

|
Have web server datatable with 46 rows but when saved as CSV file on PC, the file only has the header row. The data has not been included. Same happens for save in excel format. Confused.
|
|
|
|
|

|
hi,
i try to export data that contains (decimal, varchar, date) datatype but it doesn't seems to work(all columns have standard as datatype in excel)
please how could i get ride of this problem.
thanks.
|
|
|
|

|
I want to Export data set in excel throw my Web application. Client have the MS Excel install on his PC but @ server MS Excel is not install. Let me know how can i do same thing describe in this application in this scenario.
By De way thanks a lot for providing such a nice code...
Keep it up.
Regards,
Pinakin Rao
|
|
|
|

|
Hi all,
Here always export datas to worksheet with has same name of excel file name.
How can i give different name to worksheet where my all datas will export ?
Please can you help me for exporting all datas to perticular worksheet name.
Thanks a lot !
regards
ashok
|
|
|
|

|
Hi,
Thanks for the DLL.
I like to format the Header Column something like BOLD Characters and Grey background. Hw can I do that?
Thanks in advance
Best
Saami
|
|
|
|

|
Good job.
I have a problem.
I have this code on a web server.
When I want to save an xl ou csv file, i can only do this on the server's drives.
How can i save files on my client c: drive ??
thanks.
|
|
|
|

|
has limitations for excel format like leading zero's and date.
|
|
|
|

|
Very useful tool. Any idea how to preserve leading zeros? E.g to keep 000123 rather than 123.
|
|
|
|

|
Hi,
Can somebody please help on this. Thanks.
First bug:
I am finding any data with special characters such as the long dash or the left and right quote marks gets exported to Excel incorrectly - they come out looking like this: …
Second bug:
Sometimes a column containing a long piece of text (say 3KB) will be cut off when it comes out in the Excel column... I can't find any pattern to this but it is sometimes getting chopped off quite near the start... so my question is this: is there a limit per column that your library outputs or maybe a limit in an Excel column (I thought it was 64Kb)? Are there any conditions you know of that might cause this to happen?
|
|
|
|

|
i have checked the windows app it looks good but it has limitation of 65336 records(excel sheet can acomadte only 65336).if i want to export to excel more than 65336 how can we do that.
NOTE : after 65336 count i want remaining data in the another excel sheet.
Thanks,
Madhu
Madhu
|
|
|
|

|
Hi
U application is good but
When i create excel file then its not a real excel file.
When u open that created excel try to save that file
Then it asks for Save as(because this file is in .txt format type( Tab delimited) file
Try this
|
|
|
|

|
Hi,
I have an requirement of sending a report (which is generated from gridview) to the concern person thorugh mail attachement.
I need to save a exported excel sheet to the server instead of showing prompt of open or save option so that I can attach the same file as attachment.
Can anyone share your ideas?
Thanks,
sravani
|
|
|
|

|
Doesn't produce real excel files.
|
|
|
|

|
Hi I get the following message when i open the exported datatable into an excel file with the export class :
"The file you are trying to open, test.xls, is in a different format than specified by the file extension, Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"
This only happens in Office 2007 Excel
thanks for any help.
Ronald
Ronald
|
|
|
|

|
try
{
if (txtFromDate.Text != "" && txtToDate.Text != "")
{
Objref.FromDate = DateTime.Parse(txtFromDate.Text, culture).ToString("yyyy-MM-dd");
Objref.ToDate = DateTime.Parse(txtToDate.Text, culture).ToString("yyyy-MM-dd");
Objref.Shipper_Cod = ddlshippername.SelectedValue;
Objref.Consignee_Cod = ddlconsignee.SelectedValue;
DataSet dsDaily = new DataSet();
dsDaily = ObjCom.AirExport_DailyStatusReport_Excel(Objref);
//if (dsDaily.Tables[0].Rows.Count > 0)
//{
// try
// {
// objExcel.ExportDetails(dsDaily.Tables[0], Columns, Export.ExportFormat.Excel, "AE_DSR");
// }
// catch (Exception ex)
// {
// throw ex;
// }
//}
if (dsDaily.Tables[0].Rows.Count > 0)
{
int[] Columns = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
string[] Header={"ORGIN","SHIPPER","INVOICE","STYLE_NUM","NO OF PCS","READY DATE","APPROVED DATE","CARGO RCD DATE","DOC REC DATE","CUSTOME CLERANCE","AIR LINE HO DATE","PP_CC","NO OF CTN","GROSS WGT","DIMENSION","CHG_WGT","MAWB","HAWB","FLIGHT DETAILS","STATUS",""};
RKLib.ExportData.Export objExport = new RKLib.ExportData.Export();
objExport.ExportDetails(dsDaily.Tables[0], Columns,Header, Export.ExportFormat.Excel, "AE_DSR");
}
else
{
lblMessage.Visible = true;
lblMessage.Text = "NO RECORD FOUND";
}
}
}
catch (Exception ex)
{
ex.ToString();
}
|
|
|
|

|
Thanks for your source, it's so great.
But in file excel, my data is 6/26/09 become 2009-06-26T00:00:00.0000000+07:00
+84945566789 become 84945566789
Can u help me to fix this.
Thank u very much !!
|
|
|
|

|
Hi
I followed the instructions and added the dll to my project. When I execute my code I get this error -
System.NullReferenceException: Object reference not set to an instance of an object. at RKLib.ExportData.Export..ctor(String ApplicationType)
This occurs in the line :
RKLib.ExportData.Export excelExport = new RKLib.ExportData.Export("Web");
I am not sure what I am doing wrong?
Kalpana
|
|
|
|

|
I'm new to programming. Your article helped me lot in finishing my task.
Thanks so much.
Diya.
|
|
|
|

|
Hello, I am trying to make code that runs on SharePoint site and creates a structured CSV report of the site, containing the sub-sites, the document libraries of these sub sites and the documents number of each document library. Also, report on the number of documents uploaded the last week per sub site. Can anyone help me?
|
|
|
|

|
I require the column name to have an @ symbol. It does not fall over but the field comes out blank, if I remove the @ from the column ir works fine:-
Does not work:-
column = new DataColumn();
column.DataType = System.Type.GetType("System.String");
column.ColumnName = "@filename";
table.Columns.Add(column);
row["@filename"] = file;
Works:-
column = new DataColumn();
column.DataType = System.Type.GetType("System.String");
column.ColumnName = "filename";
table.Columns.Add(column);
row["filename"] = file;
But I need the column on the export to have the @
|
|
|
|

|
We are using RkLib to exeport to excel in my application.
but it throws the following error:
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
The problem is :
I need to execute some code after the function call objExport.ExportDetails(...).
But, because the above exception is thrown ,i am not able to handle the exception and execute the other codes after the function call . Even in Finally block...
can anyone please suggest on this?
Thanks in Advance
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Free source code and tutorials for exporting data to CSV/Excel file from Web/Win Forms
| Type | Article |
| Licence | |
| First Posted | 29 Sep 2004 |
| Views | 1,020,774 |
| Downloads | 37,572 |
| Bookmarked | 353 times |
|
|