poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dayne Olivier" <day...@gmail.com>
Subject Re: POI next release......
Date Thu, 17 Jul 2008 14:33:22 GMT
Bhushan,

The following is a sample macro you can use in your excel template to set
the data ranges for a chart. This is a snippet of code from one of my files,
so you will need to edit it according to your needs. Sorry about the
formatting.... Oh, if you put this into a Module, it will run automatically
when you open the Workbook. "auto_open" seems to be a special name that gets
executed when the workbook opens.

[MACRO]
Public Sub auto_open()
Dim ls_End As String
Dim ls_Start As String
ActiveSheet.Range("b2").Select
ls_Start = ActiveCell.Address
Selection.End(xlDown).Select
Selection.End(xlToRight).Select
ls_End = ActiveCell.Address
ActiveSheet.ChartObjects(1).Select
ActiveChart.SetSourceData (Sheets("Loghistory").Range("" & ls_Start & "" &
":" & "" & ls_End & ""))
ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).Name = "=""No the Roads Logged"""
ActiveChart.SeriesCollection(2).Name = "=""Kilometre Distance"""
ActiveSheet.Range("a1").Select
End Sub
[/MACRO]
On Wed, Jul 16, 2008 at 2:05 PM, Bhushan Jain <bhushan1988@gmail.com> wrote:

> Hi Joern ,
> Thanks for the trick.........
> Can you please give me a sample code for this trick?It would be of great
> help. I am new to the use of this library.
>
> I have the values which are to be plotted as a pie-chart.But don't know how
> to proceed......
>
> Thanks,
> -----------
> Bhushan
>
> On Wed, Jul 16, 2008 at 4:44 PM, <joern@muehlencord.de> wrote:
>
> > Hi Bhushan,
> > we use a simple workaround. We create a template file using excel. All
> > charts are already added, the data is outside the print area. Then we
> load
> > the excel via POI, overwrite the data into the hidden fields --> the
> charts
> > becomes updated. Afterwards the file is saved under another filename.
> Works
> > very well - we do have some issues with updating formulas because they do
> > not recalculate all the time. But this should be fixed with 3.1 (we still
> > use 3.0). A simple workaround for this is a macro inside the template
> which
> > refreshes all data when openening the file.
> > Regards
> > Joern
> > Bhushan Jain schrieb:
> >
> >> Hi,
> >> I am using the POI 3.1 final version. But it do not support the drawing
> of
> >> charts in excel(spreadsheet).
> >> It was being said that the next version release will come up with a
> >> solution
> >> to this issue......
> >> I wanted to know that is it sure that we can create charts in
> spreadsheet
> >> from the next version and also that when will the next version or the
> >> version addressing the issue be released?
> >> Thanks,
> >> -------------
> >> Bhushan
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > For additional commands, e-mail: user-help@poi.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message