Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Pie chart not displayed
MaverickS
Hi,
I created a report in which i used pie-chart but it is not displayed in preview of report.
I am attaching report design .
Please help.
Regards,
Maverick
Find more posts tagged with
Comments
mwilliams
Are you getting any kind of error in the chart wizard or when you run the design? Is there any way you can reproduce the issue in a report that I can run? Either using the sample database or a flat file?
Azad Singh
<blockquote class='ipsBlockquote' data-author="'MaverickS'" data-cid="101468" data-time="1338377304" data-date="30 May 2012 - 04:28 AM"><p>
Hi,<br />
<br />
<br />
I created a report in which i used pie-chart but it is not displayed in preview of report.<br />
<br />
I am attaching report design .<br />
<br />
Please help.<br />
<br />
Regards,<br />
Maverick<br /></p></blockquote>
<br />
<br />
Hi Maverick, Can u try changing the type of pie chart's "Output format" to JPG OR PNG? <br />
<br />
<br />
SVG is not fully supported by BIRT yet. I hope this might work.
MaverickS
Hi Birt Guru
Actually i am generating my report design by java code in pdf format and after generation pie chart not displayed but rest of the data is coming perfectly fine.
I am using code in a similar way as mentioned below.
Do i need to use any code related to charting engine for displaying pie-chart in above mentioned code.?
// start up Platform
config = new EngineConfig( );
config.setBIRTHome(?C:\\BIRT_231\\birt-runtime-2_3_1\\
ReportEngine?);
config.setLogConfig(?C:\\BIRT_231\\logs?, java.util.logging.Level.
FINEST);
Platform.startup( config );
// create new Report Engine
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_
ENGINE_FACTORY );
engine = factory.createReportEngine( config );
// open the report design
IReportRunnable design = null;
design = engine.openReportDesign(?C:\\BIRT_231\\designs\\param
.rptdesign?);
// create RunandRender Task
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
// pass necessary parameters
task.setParameterValue(?ordParam?, (new Integer(10101)));
task.validateParameters();
// set render options including output type
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName(?my_report.pdf?);
options.setOutputFormat(?pdf?);
task.setRenderOption(options);
// run task
task.run();
task.close();
engine.destroy();
Regards,
Maverick
MaverickS
Hi Birt Guru,
I have made a sample test report based on classic models database.
And then use below mentioned Java code to produce it in pdf format.
Output generated is also attached along with it (Report.pdf).
Please help me that how can i display pie chart in my pdf report.
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
import org.eclipse.birt.report.engine.api.PDFRenderOption;
public class Report {
public static void main(String[] args){
GenerateReport();
}
public static enum ReportFormat {
PDF, HTML, XLS;
}
public static void GenerateReport(){
IReportEngine engine=null;
EngineConfig config = null;
try{
// start up Platform
config = new EngineConfig( );
Platform.startup( config );
// create new Report Engine
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
// open the report design
IReportRunnable design = null;
design = engine.openReportDesign("\\test.rptdesign");
// create RunandRender Task
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
// set render options including output type
PDFRenderOption options = new PDFRenderOption();
String argDestination = "D:\\Report.pdf";
options.setOutputFormat(ReportFormat.PDF.toString());
options.setOutputFileName(argDestination);
task.setRenderOption(options);
// run task
task.run();
task.close();
engine.destroy();
System.out.println("Report generated successfully");
}catch( Exception ex){
ex.printStackTrace();
}
finally
{
Platform.shutdown( );
}
}
}
Regards,
Maverick
MaverickS
Please help if anyone know the solution
mwilliams
Sorry for the delay. Since you're using SVG format, try adding this line, to make sure SVG is supported:
options.setSupportedImageFormats("PNG;GIF;JPG;BMP;SWF;SVG");
MaverickS
Thanks Birt Guru for your support.
But i am sorry to say that still pie chart is not coming.
Regards,
Maverick
mwilliams
Alright, I'll give your sample a try and test the code, sometime this afternoon.
MaverickS
Hi Birt guru,
Have you tried my code ?
Regards,
Maverick
mwilliams
Sorry for the delay. With your code, except pointing to where I have the design and specifying my output destination, I get the pie chart in my pdf as expected.