is there any way to export the data from infragistics ultraweb grid to a specific excel file which is havinng some formats?
say i have my template in \Templates folder in my server. (i.e \Templates\UserTemplate.xls) i want to write my data from the webgrid to this excel. our server may not have excel installed so i am using infragistics.excel.
thanks
arun.k.s
atmy@chevron.com
The width of the column is in 1/256ths of the average character width of the default font of the workbook. The exported workbook's always use Arial font, but the font height can change. You can determine the font height in points by getting the Workbook's DefaultFontHeight property, which is in twips, and dividing by 20. Then determine how wide the '0' character is without padding in GDI using a graphics object:
Size size;
using ( Font font = new Font( "Arial", (float)( workbook.DefaultFontHeight / 20.0 ) ) size = TextRenderer.MeasureText( grfx, "0", font, Size.Empty, TextFormatFlags.NoPadding )
int width = size.Width;
Multiple the number of pixels you would like to make your column by 256 and divide by the width of the zero character. The result is the width you should set on your column.
Hi,
I wanted to know how to convert the length of a column in ultrawebgrid which is in pixels to that in excel(integer).
For example if the size of column1 is 150px then in excel the size could be 2500 (which is an integer)
Dim owb As Workbook = New Infragistics.Excel.Workbook()Dim len1 As Unitlen1 = UltraWebGrid1.Columns(0).Widthowb.Worksheets.Item(0).Columns(0).Width = len ' this gives me an error
owb.Worksheets.Item(0).Columns(0).Width = len.value ' this works fine. But the width of column on excel is very small and is not visible.
If I multiply len.value by a number then things works but I want the actual convertion factor which should be used.
Thanks,
Junaid.
Hi:
I have som problems to export data of a ultrawebgrid to an exel file.
in my application i create ultrawebgrids on run time, my code reads a table from a database, and in base of the records number i have to create the same number of ultrawebgrids, then i create the same number of buttons, these, are the buttons to export each webgrid to excel.
i´m using a UltraWebGridExcelExporter. When i click some of the buttons, a export to exel window is oppened, and when i click on the open button this opens excel but there is no information.
in other case when i drag a UltraWebGrid from the toolbox, and try export it to excel, and it works so fine, excel is oppened and the information of my webgrid is showed.
some body knows why it is happening? or if it is posible export to excel the information of a webgrid that was created by code on run time?
Hi Derek,
I also tried to load an excel file and then I tried to put some data into my template but it does not work.
Can you give me a hint what I'm doeing wrong?
Thank you,
Jos
Code:
Dim ExcelFile As Infragistics.Excel.Workbook ExcelFile = New Infragistics.Excel.Workbook() ExcelFile = Infragistics.Excel.Workbook.Load("c:\vorlage.xls")' add new does work but the load does nothing ExcelFile.Worksheets(0).Rows(0).Cells(0).Value = "TEST" ExcelFile.Save("c:\test.xls")
Never mind. I am using 2006 volume 3 and the Load function is part of 2007 volume 3.