OpenDocument4all - Info and tools about OpenDocument
Sunday, 05 February 2012
Home arrow Forum
Forum Statistics
Total user: 89
Total message: 179
Main Menu
Home
My Blog
AODL - Project
AODC - Project
OO Development & Info
Forum
About OpenDocument ...
Search
News
Contact Us
Login Form





Lost Password?
No account yet? Register
Sourceforge.net

SourceForge.net - Goto the project homepage
Project site on SF.net

 

Demand OpenDocument

 

Countomat Webcounter und Webstatistik (Statistik & Logfileanalyse, Counter)

OpenDocument4all-Forum

 
Issue with AODL and visual basic .net
Date: 2007/09/27 17:13 By: Giovanni Status: User  
Karma: 0  
Fresh Boarder

Posts: 1
graphgraph
Hello,

I'm using AODL to export some values from my app to an opendopcument spreadsheet.

I create a mster sheet with calc, write in the title, formatting some cells (border, alignment...) and save it.

in my app i have some code to open the file, that work.
then i have a cycle to write some values in the loaded sheet

I post here some code:
-----------------------------------------------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbDati.Click

Dim Inizio As New Date(dtpInizio.Value.Year, dtpInizio.Value.Month, dtpInizio.Value.Day - 1)

Dim gg As Integer
Dim strQuery As String

'foglio della base
Dim foglio As New SpreadsheetDocuments.SpreadsheetDocument
foglio.Load(SelFile)
'paragrafi
Dim parag As AODL.Document.Content.Text.Paragraph

'cicla tutti i giorni
For gg = 0 To 4
'aggiungo un giorno ogni volta
Inizio = Inizio.AddDays(1)

dim VALUE as new string ("some text")

'creo i paragrafi
parag = Content.Text.ParagraphBuilder.CreateSpreadsheetParagraph(foglio)

Dim testo As New AODL.Document.Content.Text.FormatedText(foglio, "testo01", VALUE)
parag.TextContent.Add(testo)

'esporto i valori nel foglio
foglio.TableCollection(0).RowCollection(5 + (3 * gg)).CellCollection(2).Content.Add(parag)

Next

'salvo il file
foglio.SaveTo(SelFile)

End Sub
------------------------------------------------------------

comments are in italian... sorry.
It is a very simple code writing a paragraph in a cell.

the problem is that AODL give an error on
foglio.TableCollection(0).RowCollection(5 + (3 * gg)).CellCollection(2).Content.Add(parag)

saying that cell index is too high. i get the cellcollection.count and it is 3... very bad as in my sheet, in that row, i have 6 cell with border and formatting options....

any help would be appreciated

Giovanni

P.S. sorry for my bad english =))
The administrator has disabled public write access.

Re:Issue with AODL and visual basic .net
Date: 2007/11/23 21:50 By: Darius Damalakas Status: User  
Karma: 0  
Senior Boarder

Posts: 19
graphgraph
What is exact exception?
Is it IndexOutOfRange?

foglio.TableCollection(0).RowCollection(5 + (3 * gg)).CellCollection(2).Content.Add(parag)


you are trying to access Rowcollection(), but are you sure that there are as many rows as 5 + 3 * gg?
The administrator has disabled public write access.

Quick jump
Download area
Who's Online
We have 32 guests online
Polls
Should AODL and AODC also implement export as PDF and RTF?
 
Popular
© 2005 MamboZ. All rights reserved.