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.
Unfortunately, activation email could not send to your email. Please try again.

Import data table data type issue.

Thread ID:

Created:

Updated:

Platform:

Replies:

95518 Jul 14,2010 02:44 PM Sep 20,2010 07:54 AM ASP.NET Web Forms (Classic) 21
loading
Tags: XlsIO
Sandhya Doddi
Asked On July 14, 2010 02:44 PM

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.

Geetha M [Syncfusion]
Replied On July 15, 2010 12:31 AM

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

Sandhya Doddi
Replied On August 10, 2010 11:38 AM

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.

Geetha M [Syncfusion]
Replied On August 11, 2010 12:42 AM

Hi Sandhya,

Thank you for the update.

Regards,
Geetha

Sandhya Doddi
Replied On August 11, 2010 06:46 PM

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.

Geetha M [Syncfusion]
Replied On August 12, 2010 02:56 AM

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

Sandhya Doddi
Replied On August 12, 2010 11:56 AM

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.

Lokesh R [Syncfusion]
Replied On August 13, 2010 06:04 AM

Hi Sandhya,

Thank you very much update.

Thanks,
Lokesh.

Sandhya Doddi
Replied On August 16, 2010 04:39 PM

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

Geetha M [Syncfusion]
Replied On August 18, 2010 04:44 AM

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

Sandhya Doddi
Replied On August 18, 2010 05:59 PM

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

Geetha M [Syncfusion]
Replied On August 19, 2010 02:20 AM

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

Sandhya Doddi
Replied On August 23, 2010 11:36 AM

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

Geetha M [Syncfusion]
Replied On August 24, 2010 12:43 AM

Hi Sandhya,

Currently there is no workaround available to Scale the document.

Please let us know if you have any questions.

Regards,
Geetha

Sandhya Doddi
Replied On September 7, 2010 07:27 PM

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

Geetha M [Syncfusion]
Replied On September 8, 2010 07:19 AM

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


Sandhya Doddi
Replied On September 8, 2010 12:14 PM

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


Geetha M [Syncfusion]
Replied On September 9, 2010 01:34 AM

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


Sandhya Doddi
Replied On September 14, 2010 01:43 PM

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

Sandhya Doddi
Replied On September 14, 2010 04:46 PM

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


Sandhya Doddi
Replied On September 14, 2010 04:54 PM

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



F95518_a06048c1.zip

Lokesh R [Syncfusion]
Replied On September 20, 2010 07:54 AM

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.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;