We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Import data table data type issue.

I am trying to import a data table to spread sheet which has a column start and end date. But, I am treating them as string values, the value in my data table shows 3/2/2010, but when it is imported on to spread sheet I see 03/02/2010. My datatable has all the column data types as string.

I have used preserveTypes= true,
sheet.ImportDataTable(dtTable, true, 3, 1, true); that didn't help

Can you please guide me in the right direction so, that I can resolve this problem.

21 Replies

GM Geetha M Syncfusion Team July 15, 2010 04:31 AM UTC

Hi Sandhya,

Thank you for your interest in Syncfusion products.

I am afraid that I am not able to reproduce the problem. I have placed my test sample in the link below.

http://help.syncfusion.com/samples/XlsIO.Web/F95518/F95518.zip

Could you please send us the modified sample?

Regards,
Geetha


SD Sandhya Doddi August 10, 2010 03:38 PM UTC

Thanks Geetha for your immediate response.

Actually, at some place my code is overwriting the date. So, it was not Syncfusion problem.

Thanks a lot,

I would like to close the ticket.


GM Geetha M Syncfusion Team August 11, 2010 04:42 AM UTC

Hi Sandhya,

Thank you for the update.

Regards,
Geetha


SD Sandhya Doddi August 11, 2010 10:46 PM UTC

How can I set font styles to complete work book. Including header and footer.

I am trying to set to the sheet like this,

sheet.Range.CellStyle.Font.FontName = "Arial";
sheet.Range.CellStyle.Font.Size = 11f;

But, that doesn't work for complete sheet, it changes the font only to the used range of cells.

Can you please guide me to set the fonts.


GM Geetha M Syncfusion Team August 12, 2010 06:56 AM UTC

Hi Sandhya,

You may change the font of the workbook using StandardFont and StandardFontSize properties of IWorkbook class. Here is the code snippet.

workbook.StandardFont = "Arial";
workbook.StandardFontSize = 11;

Please try this and let us know if you have any questions.

Regards,
Geetha


SD Sandhya Doddi August 12, 2010 03:56 PM UTC

Thanks Geetha,

That works. I spent quite a bit of time setting the font for workbook using IFont. But, this is a good one.

Thanks once again, I appreciate your support.


LR Lokesh R Syncfusion Team August 13, 2010 10:04 AM UTC

Hi Sandhya,

Thank you very much update.

Thanks,
Lokesh.


SD Sandhya Doddi August 16, 2010 08:39 PM UTC

I still have few more questions..

How can add a hyperlink to footer?

How can I achieve the attached functionality using Syncfusion?

Thanks for your support.

-Sandhya



ExcelPictureProperties_a53b714a.zip


GM Geetha M Syncfusion Team August 18, 2010 08:44 AM UTC

Hi Sandhya,

It is not possible to insert Hyperlink in a footer. However, you can insert a link and underline it to display like a hyperlink. Please refer to the code below.

sheet.PageSetup.CenterFooter = @"&Uhttp://www.syncfusion.com";

Here, "&U" underlines the footer text.

Also, you can set "Don't move or size with cells" using the code below.

IPictureShape pictureshape = sheet.Pictures.AddPicture(1, 1, "");
pictureshape.IsMoveWithCell = false;
pictureshape.IsSizeWithCell = false;

Please try this and let me know if you have any questions.

Regards,
Geetha


SD Sandhya Doddi August 18, 2010 09:59 PM UTC

That works like a charm. Thanks a lot. I really appreciate your support and guidence.

Can you please guide me how I can achieve the attached functionality.

And also I would like to change the color to blue for the hyperlinks that are in the footer. Is there any way?

Thanks in advance.

Thanks,
-Sandhya



Removing_scaling_from_header_and_footer_351e7d8f.zip


GM Geetha M Syncfusion Team August 19, 2010 06:20 AM UTC

Hi Sandhya,

It is not possible to toggle "Scale with document" using XlsIO. Also, it is not possible to change the color of font in header or footer in MS Excel 2003. Please refer to the link below.

http://office.microsoft.com/en-us/excel-help/change-the-font-in-header-and-footer-text-HP005198993.aspx

However, changing header / footer color is possible in XLSX format. Please refer to the code snippet below.

sheet.PageSetup.CenterFooter = @"&U&K0070C0http://www.syncfusion.com";

Where K0070C0 refers to Blue color.

Please try this and let me know if you have any questions.

Regards,
Geetha


SD Sandhya Doddi August 23, 2010 03:36 PM UTC

Thanks Geetha for your guidence..

That helped me.. If you have any work around for Scale with Document let me know, that helps me a lot.

Thanks for everything..

-Sandhya


GM Geetha M Syncfusion Team August 24, 2010 04:43 AM UTC

Hi Sandhya,

Currently there is no workaround available to Scale the document.

Please let us know if you have any questions.

Regards,
Geetha


SD Sandhya Doddi September 7, 2010 11:27 PM UTC

Hello,

I am trying to paste an image on the spread sheet using c# code. Image is looking like scaled. The width is 100% but the height is variant. Find the attachment which has the sample.

But, it shows the original size of the image on properties of image. I am not sure where it is scaling.

I appreciate if you can help me on this.

Thanks..
-Sandhya



ImageScalingIssue_c5d077df.zip


GM Geetha M Syncfusion Team September 8, 2010 11:19 AM UTC

Hi Sandhya,

Thank you for your continued interest in Syncfusion products.

I am afraid that I am not able to reproduce the problem. I tried the following code and it worked for me. Could you please send me the modified code snippet?

IPictureShape shape = sheet.Pictures.AddPicture(1,1,@"..\..\test.png");

Regards,
Geetha



SD Sandhya Doddi September 8, 2010 04:14 PM UTC

Thanks Geetha for your quick response..

I am using the below code to put my map image on the sheet..

IPictureShape pictureshape = mapSheet.Pictures.AddPicture(1,1, mapImage, ExcelImageFormat.Png);
pictureshape.IsMoveWithCell = false;
pictureshape.IsSizeWithCell = false;


I don't have any scalings any where..

Thanks,
-Sandhya



GM Geetha M Syncfusion Team September 9, 2010 05:34 AM UTC

Hi Sandhya,

Thank you for the details.

I was not able to reproduce the problem with the code snippets in v8.3.0.21. I have placed the sample in the link below.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=F95518165591204.zip

Could you please send me the modified sample?

Regards,
Geetha



SD Sandhya Doddi September 14, 2010 05:43 PM UTC

Hello,

Now, I know where the image got distorted. If you look at my attachment, titles were placed beside the map image. Eventhough I set IsMoveWithCell = false; IsSizeWithCell = false; when the Wraptext = true in the code, then the image gets distorted based on the lines of title expands. If the wraptext is off and after posting all the data to the spread sheet then manually in the spread shet if I set the wraptext on, the image will not distorted.

Hopefully you understood the problem. Find the spread sheet as attachment.

Thanks,
-Sandhya



2010-09-10T08-23-19-UserFilterSet899(1)_9a7ed55.zip


SD Sandhya Doddi September 14, 2010 08:46 PM UTC

I think even setting the font arial, size 11 also distorts the image. Can I set the standard font for each sheet.



SD Sandhya Doddi September 14, 2010 08:54 PM UTC

Find the attached zip file, can you please suggest me how to achieve both functionalities at the same time.



F95518_a06048c1.zip


LR Lokesh R Syncfusion Team September 20, 2010 11:54 AM UTC

Hi Sandhya,

Thank you very much for the update.

We were not able to reproduce the issue at our side and on further analysis of the output excel sheet created from the posted sample, we could see that the resolution of the image which you have tried to insert is very low ,so you could see that the image got distorted .If you try to insert the same image through MSExcel the same resolution will be maintained.I have attached two excel sheet samples for your reference.

1.HighQualityImage.xlsx
2.LowQualityImage.xlsx

1.HighQualityImage:

In this sheet, i have tried to place a high quality image with resolution of 300 dpi,i could not see any image distortion in the output image and also i have placed another copy of the same image adjacent to it through MSExcel,in the sample you can see both the images have the same clarity and no distortion this is because of the resolution.

2.LowQuality Image:

In this sheet, i have placed the image posted in the last update which has a resolution of 24 depth and also i have placed a copy of an added image adjacent to it through MSExcel,in the sample you can see both the images have the same distortion because of the low resolution.

Samples link:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=ImageDistortion-351727962.zip

Please, let me know if you need any clarifications.

Thanks,
Lokesh.


Loader.
Live Chat Icon For mobile
Up arrow icon