Create a chart object in LotusScript ?

Microsoft OFFICE

    Next

  • 1. Can you use the offset property with OWC10 spreadsheet object?
    I have a web page that I designed with Studio .NET 2002 which uses the old classid for the OWC spreadsheet object of "CLSID:0002E510-0000-0000-C000-000000000046". I believe this is the classid of the orginal OWC9, even though it works fine on machines with OWC10 installed and Office XP. Since it has been a couple of years since I have updated this web page I want to start using the classid for OWC10, which I believe is "CLSID:0002E551-0000-0000-C000-000000000046". When I update the classid the spreadsheet renders properly, however, some of the script that I use to modify the spreadsheet no longer functions. For example, the line MySS.Range("A1").Offset(1).InsertRows(1) generates the "Object doesn't support this property or method:" error message. Is the Offset property no longer used with this newer spreadsheet object? I create the VBscript in the code behind page so that I can connect to SQL data and loop through a data reader. Then, when I am done creating all of the script I need I pass it to the HTML portion of the page using the Literal tool. Not sure if this is the preffered method or not, but it seems to work. Alvin Bruney, if you happen to read this, I have ordered your book. I read the first chp and it looks like it might help me as I get back into using the OWC. I also wanted to thank you for answering my post from yesterday. Sean
  • 2. DataAccess Page MsoText Box - restrict to a single line
    Anybody know how to restrict a MSOTextBox in an Access 2003 DataAccessPage to a single line? Thanks, r.janisch
  • 3. OWC Chart and Spreadsheet in a repeater
    I am using asp.net, vb and codebehind with a repeater containing an OWC spreadsheet and chart in the itemtemplate. What I want is when a user clicks a button, data is loaded into each repeater items spreadsheet and some formating is done. Then the spreadsheet and chart are made visible. The problem is I cannot get a reference to any of the spreadsheets or charts. ie if I try to use the item and control properties of the repeater or the findcontrol method the objects dont seem to exist although I can see them in the browser. Is this related to the objects being activex? Cheers Rick
  • 4. Can OWC10 and OWC11 co-exist?
    I have developed some web pages that use the excel spreadsheet object from the Office XP version of the Office Web Components (OWC10). They work fine as long as the client machine has Office XP installed along with OWC10. However, a machine with Office 2003 installed along with OWC11 does not allow the user to view the Excel spreadsheet. What can I do as the developer to allow a client machine with Office 2003 installed to view a web page that has a 2002 Office Web component on it? Do I have to upgrade my development machine to use the Office 2003 Web Components? Is there no way for one OWC spreadsheet object to support multiple versions of Office on the client side?
  • 5. Pivot table: Cancel long running query?
    How to cancel a long running query in pivottable. Each time I drag any dimension to the data axis. The pivottable takes quite some time. I wonder if there is any event or way by which I can stop the pivot query process. In excel a pivot query could be cancelled by pressing <esc> key. Environment: VB 6.0; WIN 2K; OfficeXP web components; Local cube. Thanks, VJ

Create a chart object in LotusScript ?

Postby doxeone » Wed, 09 Nov 2005 23:32:01 GMT

hello

I'd like to create an object in LotusScript to build dynamic Charts in
a web page,

I don't find the way to create this object in LotusScript...

Any ideas ?

Thanks a lot


Re: Create a chart object in LotusScript ?

Postby Alvin Bruney - ASP.NET MVP » Wed, 09 Nov 2005 23:59:11 GMT

If the language supports instantiating COM components, use the appropriate
syntax as defined in the language to create a chart object and use its
methods.

-- 
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------










Re: Create a chart object in LotusScript ?

Postby doxeone » Thu, 10 Nov 2005 00:29:53 GMT

Hi Alvin and thank you for answering

Do you know where can i find forums or tutorials to find the right
syntaxes for create the object ?

I don't find in the Lotus Notes help...

Thanks a lot & sorry for my english, i'm french :)


Re: Create a chart object in LotusScript ?

Postby Alvin Bruney - ASP.NET MVP » Thu, 10 Nov 2005 04:01:28 GMT

I don't know of any lotus script resources, however you can get the black
book. It will show you how to build charts in .NET and vb/javascript. From
there, you can simply port the syntax to lotus script.

-- 
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------










Re: Create a chart object in LotusScript ?

Postby doxeone » Thu, 10 Nov 2005 18:10:26 GMT

Ok thanks you Alvin :) i succeed in create my object... But i have
another problem now :| i don't have any errors when i run my code but
how can i do to display the charts ?

If the only solution is to "print" a .gif file or is it possible to
embed the component in the page to interact with ??

How can i do for that...?

My current code is :

Sub Initialize
	On Error Goto erreur

	' On declare le graphique, les constantes et la categorie (echelle des
dates)
	Dim ChartSpace1, Cht, axCategory

	' On recupere l'objet
	Set ChartSpace1 = CreateObject("OWC11.ChartSpace")

	With ChartSpace1
		.Clear
		.Charts.Add
		.Charts(0).SeriesCollection.Add
		.Charts(0).SeriesCollection(0).Caption = strCaption
		.Charts(0).SeriesCollection(0).SetData .Constants.chDimCategories, _
		.Constants.chDataLiteral, varCategories
		.Charts(0).SeriesCollection(0).SetData .Constants.chDimValues, _
		.Constants.chDataLiteral, varValues
		.Charts(0).Type = .Constants.chChartTypeBarClustered
		.Charts(0).Axes(.Constants.chAxisPositionBottom).NumberFormat =
"$#,##0"
	End With

	Exit Sub

erreur:
	Print Cstr(Err) + " : " + Error$ + " at line " + Cstr(Erl)
	Exit Sub
End Sub

thank you


Re: Create a chart object in LotusScript ?

Postby Alvin Bruney - ASP.NET MVP » Fri, 11 Nov 2005 02:18:22 GMT

the script language must support some form of writing the object to the
response stream for display in the browser, or you can embed the object in
the page using the <clsid> tag, load data and simply display it.

-- 
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------










Re: Create a chart object in LotusScript ?

Postby doxeone » Tue, 15 Nov 2005 18:45:11 GMT

come back here for another problem (one more sorry), i follow your
advices and use intensively the msdn reference to work but i am
discouraged...

I "translate" a vbscript script which is working very well to
lotusscript (which are very similar)
the vbscript's one worked pretty good but not the lotusscript one,
datas are good, there are not the problem.

but in html page the office component launch but the charts are not
builded (image to illustrate this :
http://pix.nofrag.com/09/9b/2662a36b515451f08b354d3b6e50.html at left
the lotusscript at right the vbscript)

here is the code :

VB :

Sub Initialize
On Error Goto erreur

Dim strCat As String
Dim strVal As String

Set s = New notessession
Set db = s.CurrentDatabase
Set contextDoc = s.DocumentContext
docUNID = getQueryVal(contextDoc.Query_String_Decoded(0),"docUNID")
Set queryDoc = db.GetDocumentByUNID(docUNID)

strVal = "Array("
For i=0 To Ubound(queryDoc.Expr2 )
strVal = strVal +|"|+Format$(queryDoc.Expr2(i))+|",|
Next
strVal = Left$(strVal,Len(strVal)-1)
strVal = strVal +")"

strCat = "Array("
For i=0 To Ubound(queryDoc.Expr2 )
strCat = strCat +|"|+Format$(queryDoc.COUNTRY_NAME(i))+|",|
Next
strCat = Left$(strCat,Len(strCat)-1)
strCat = strCat +")"

Print |<html>|
Print |<body>|
Print |<object classid="clsid:0002E556-0000-0000-C000-000000000046"
id="ChartSpace1" style="width:100%;"></object>|
Print |</body>|
Print |<script language="vbscript">|
Print |Function Window_OnLoad()|
Print |Set c = ChartSpace1.Constants|
Print |Set oCht = ChartSpace1.Charts.Add|
Print |Set oSer = oCht.SeriesCollection.Add|
Print |oSer.SetData c.chDimCategories, -1, |+strCat+||
Print |oSer.SetData c.chDimValues, -1, |+strVal+||
Print |oSer.Interior.Color = "green"|
Print |End Function|
Print |</script>|
Print |</html>|

Exit Sub

erreur:
Print Cstr(Err) + " : " + Error$ + " at line " + Cstr(Erl)
Exit Sub
End Sub


And the LS :

Sub Initialize
On Error Goto erreur

Dim login As String
Dim password As String
Dim UDLPath As String

Set s = New notessession
Set db = s.CurrentDatabase
Set contextDoc = s.DocumentContext
docUNID = getQueryVal(contextDoc.Query_String_Decoded(0),"docUNID")
Set queryDoc = db.GetDocumentByUNID(docUNID)

originQuery = queryDoc.qQuery(0)
SQLQuery = queryDoc.inWorkQuery(0)

If SQLQuery="" Then
SQLQuery = originQuery
End If

login = queryDoc.qLogin(0)
password = queryDoc.qPassword(0)
UDLPath = queryDoc.qUDLPath(0)
orderBy = queryDoc.orderBy(0)
sortBy = queryDoc.sortBy(0)

Set cn = CreateObject("adodb.connection")
Call cn.open("File Name="+UDLPath+"",login,password)
Set Result = CreateObject("ADODB.Recordset")
Result.Open SQLQuery, cn

Dim strCat As Variant
Dim strVal As Variant

strCat = queryDoc.COUNTRY_NAME
strVal = queryDoc.Expr2

Dim ChartSpace1,c,cht,sc
Set ChartSpace1 = CreateObject("OWC11.ChartSpace")
With ChartSpace1
Set c = .Constants
Set cht = .Charts.Add()
cht.Type = c.chChartTypeColumnClustered

cht.SetData c.chDimSeriesNames, c.chDataLiteral, "test"
cht.SetData c.chDimCategories,c.chDataLiteral, strCat
cht.SeriesCollection(0).SetData c.chDimValues,c.chDataLiteral,
strVal
End With

Print {Content-Type:text/html}
Print |<html>|
Print |<head>|
Print |<title>|+queryDoc.qTitle(0)+|</title>|
Prin

Similar Threads:

1.Create excel chart from LotusScript, change xlLine line weight

I need to adjust the line weight of an xlLine type chart from within 
LotusScript. I cannot find any methods that control the line weight in VBA. 
Everything I see concerning line weight deals with border, not the plotted 
line. Any suggestions or help appreciated?

2.How to Create Chart via LotusScript?

I want to create chart in a form via LotusScript. I donot know where I
can find how to create chart in LS to fit my chart. Any Idea?

3.Excel created in LotusScript slow

We have a Lotus Notes application that generates all sorts of output to Excel 
spreadsheets via Excel objects.    Recently (in the last month or so) we have 
a group of users experiencing a problem where the Excel session created by 
the LotusScript code is slow to populate some cells and when the spreadsheet 
is turned over to the user (visible=true), the users also experience very 
slow scrolling.  For example, if you hold down the mouse on the down elevator 
arrow, the spreadsheet should scroll the rows by pretty fast, but we are 
experiencing maybe one row per second or so.   If we close the Lotus Notes 
session and leave the Excel up, it's still slow.

But, (regardless of whether you close Lotus Notes or not) if you are to save 
the spreadsheet, close Excel, reopen the saved spreadsheet, then the 
performance in the spreadsheet it normal (and fast).

This doesn't happen to all users.  Even I cannot reproduce the problem on 
either of my two laptops.

The users who do experience the problem also experience the same problems 
when they run the code from different variations (including test versions) of 
the Lotus Notes database.

We haven't released any code changes lately.

Any ideas on where to focus the troubleshooting?  The LotusScript code uses 
fairly standard Excel objects (such as Workbooks.Add to establish the 
worksheet) and sheet.cells calls to populate the cells.  Nothing fancy.

I'm thinking there something on these laptops that are clashing with the 
Excel session.   These users all used to fly through the generated 
spreadsheets.

Thanks in advance for any input / suggestions!

4.Create hyperlink on word document with LotusScript

I am having a problem in trying to create hyperlink on Word from a
given URL. I am using the code below to write the link, but the url(lnk
variable in this case), is written as text not a hyperlink.Please help
guys..

myWordApp.selection.InsertAfter "Document Link: " & lnk & Chr(10) &
Chr(10)

5.Auto-create chart objects

I have an excel spreadsheet with 600 rows in it.  Each row has the name of an 
item followed by several columns of numbers.

I need to create 3 different small charts in a Word document for each row in 
the spreadsheet.  In word, you will see a Item Name, with 3 small, but 
different charts on the next line, followed by a blank line.

I know I can create the charts in Excel using a macro and then copy and 
paste them into word as pictures.  Once that is done, I can tell word to run 
a macro to format the pictures.  But the quality of the text breaks down 
depending upon how much I stretch the charts.

WHAT I WOULD RATHER DO is, either from Excel, tell word to insert Excel 
chart objects or from Word, get the data from Excel and create the chart 
objects.

Using the first method, I have created a macro in Excel to tell Word to run 
a macro to put in a line of text with the item name in it, followed by a 
paragraph break, followed by inserting an Excel object.  But where do I put 
the macro that tells the Excel object how to format itself?  I do not want to 
store the macro in each Excel object as that would bloat the document.  I 
have tried to place the Macro back in the original Excel sheet, but when I 
tell it to run, it seems to want to run within the original Excel sheet, not 
within the Excel object in Word.

What am I doing wrong?  Or am I missing something even simpler that would 
solve my problem?

6. DEMO: Create Charts with Notes View Data

7. Excel97 chart objects compatible with Excel2000 chart objects

8. Creating resizing macro - select chart as object?



Return to Microsoft OFFICE

 

Who is online

Users browsing this forum: No registered users and 94 guest