|
Re: Chart Axis script not working [message #900835 is a reply to message #900811] |
Wed, 08 August 2012 16:36 |
|
Michael
What version of the designer did you test this in? Can you modify the
script like:
cht =
reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("mychart1");
I do not remember when we added the reportContext.getDesignHandle()
direct call but your version may not have the call.
Jason
On 8/8/2012 10:52 AM, Michael Harless wrote:
> I am utilizing a script and a parameter to change the X axis on a chart
> that I am tasked with creating. It works beautifully in BIRT, but when
> I publish it to our EssentiaRX system, it gives this error message:
>
> "TypeError: Cannot call method "getReportItem" of null
> (/report/method[@name="beforeFactory"]#5)."
>
> Here is the script:
>
> importPackage( Packages. org.eclipse.birt.chart.model);
> importPackage (Packages.org.eclipse.birt.chart.model.attribute );
>
> cht = reportContext.getDesignHandle().findElement("mychart1");
> mychart = cht.getReportItem().getProperty( "chart.instance" );
>
> xAxis =mychart.getAxes().get(0);
> xSeriesDef = xAxis.getSeriesDefinitions().get(0);
> xGrouping = xSeriesDef.getGrouping();
>
> if (params["Period"].value == "Week"){
> xGrouping.setGroupingUnit(GroupingUnitType.WEEKS_LITERAL);
> }
> else if (params["Period"].value == "Month"){
> xGrouping.setGroupingUnit(GroupingUnitType.MONTHS_LITERAL);
> }
> else if (params["Period"].value == "Year"){
> xGrouping.setGroupingUnit(GroupingUnitType.YEARS_LITERAL);
> }
>
> We are using BIRT 2.3.1 in Eclipse 3.4.1 as near as I can tell. Thanks
> for any assistance.
|
|
|
Re: Chart Axis script not working [message #900845 is a reply to message #900835] |
Wed, 08 August 2012 17:24 |
Michael Harless Messages: 14 Registered: January 2012 |
Junior Member |
|
|
Jason,
Thanks for the quick reply. Straight off of my screen: BIRT Report Designer, Version: 2.3.1.v20080630-7X7n7FECLqlyX1jw48bOyH4E0ha5, Build id: v20080922-1151.
I tried the code that you suggested and again, it worked fine in the designer, but when published into our EssentiaRX system, it gives the same error as before.
Perhaps I need to speak to those folks?
Mike
[Updated on: Wed, 08 August 2012 17:25] Report message to a moderator
|
|
|
Re: Chart Axis script not working [message #900846 is a reply to message #900845] |
Wed, 08 August 2012 17:29 |
|
Can you post the report?
On 8/8/2012 1:24 PM, Michael Harless wrote:
> Jason,
>
> Thanks for the quick reply. Straight off of my screen: BIRT Report
> Designer, Version: 2.3.1.v20080630-7X7n7FECLqlyX1jw48bOyH4E0ha5, Build
> id: v20080922-1151.
>
> I tried the code that you suggested and again, it worked fine in the
> designer, but when published into our EssentiaRX system, it gives the
> same error as before.
>
> Mike
|
|
|
|
Re: Chart Axis script not working [message #900850 is a reply to message #900846] |
Wed, 08 August 2012 17:32 |
|
Also can you add this to the script?
cht = reportContext.getDesignHandle().findElement("mychart1");
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/chtevents.txt", true ) );
out.println( "Test " + cht);
out.close();
And post what is in chtevents.txt after running on the server.
Jason
On 8/8/2012 1:29 PM, Jason Weathersby wrote:
> Can you post the report?
>
> On 8/8/2012 1:24 PM, Michael Harless wrote:
>> Jason,
>>
>> Thanks for the quick reply. Straight off of my screen: BIRT Report
>> Designer, Version: 2.3.1.v20080630-7X7n7FECLqlyX1jw48bOyH4E0ha5, Build
>> id: v20080922-1151.
>>
>> I tried the code that you suggested and again, it worked fine in the
>> designer, but when published into our EssentiaRX system, it gives the
>> same error as before.
>>
>> Mike
>
|
|
|
|
|
|
Re: Chart Axis script not working [message #900867 is a reply to message #900864] |
Wed, 08 August 2012 18:23 |
|
Ok add a data item to the top of the report and set its expression to
mycht; Then change your script to:
cht = reportContext.getDesignHandle().findElement("mychart1");
mycht = cht;
Make sure to not put a var keyword in front of it. Run the report and
see what is in the label.
Jason
On 8/8/2012 2:19 PM, Michael Harless wrote:
> IBM Power 7. It's a evolutionary child of the old AS/400 systems.
|
|
|
|
|
|
Re: Chart Axis script not working [message #900896 is a reply to message #900880] |
Wed, 08 August 2012 21:14 |
|
Sounds like a good idea. Let us know what you find out.
Jason
On 8/8/2012 3:33 PM, Michael Harless wrote:
> Jason,
>
> It didn't help. I'm still getting the same error. I think that we need
> to send a copy of this to LWSI and see if they can help. Thanks so much.
>
> Mike
|
|
|
Powered by
FUDForum. Page generated in 0.03716 seconds