Skip to main content



      Home
Home » Archived » BIRT » Is it possible to intergrate birt with SWT?
Is it possible to intergrate birt with SWT? [message #160746] Sat, 13 May 2006 06:42 Go to next message
Eclipse UserFriend
Originally posted by: xy.gmail.com

java.lang.NullPointerException
at org.eclipse.birt.report.viewer.ViewerPlugin.getResourceStrin g(Unknown
Source)
at
org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(Unkno
wn Source)
at
org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(Unknow
n Source)
at org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(Unknown
Source)
at org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(Unknown
Source)
at org.eclipse.birt.report.viewer.utilities.WebViewer.display(U nknown
Source)
at ReportViewer.previewReport(ReportViewer.java:85)
at ReportViewer.createContents(ReportViewer.java:76)
at ReportViewer.<init>(ReportViewer.java:55)
at ReportViewer.main(ReportViewer.java:35)

public class ReportViewer extends Shell {
private Browser browser;
private String reportName =
" D:/eclipse/workspace/MyBirtPlugin/src/DynamicReport.rptdesig n ";
/**
* Launch the application
*
* @param args
*/
public static void main(String args[]) {
try {
Display display = Display.getDefault();
ReportViewer shell = new ReportViewer(display, SWT.SHELL_TRIM);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* Create the shell
*
* @param display
* @param style
*/
public ReportViewer(Display display, int style) {
super(display, style);
createContents();
}

/**
* Create contents of the window
*/
protected void createContents() {
setText("SWT Application");
setSize(500, 375);
setLayout(new GridLayout());

final Composite composite = new Composite(this, SWT.NONE);
final GridData gridData = new GridData(GridData.FILL_HORIZONTAL |
GridData.VERTICAL_ALIGN_BEGINNING);
gridData.heightHint = 37;
composite.setLayoutData(gridData);

browser = new Browser(this, SWT.NONE);
final GridData gridData_1 = new GridData(GridData.FILL_BOTH);
browser.setLayoutData(gridData_1);
//
//showReport();
previewReport();
}

private void previewReport() {
try {
WebViewer.startup(browser);
System.setProperty("RUN_UNDER_ECLIPSE", "true");
DtpManifestExplorer.getInstance().getExtensionManifests();

//WebViewer.display("C:/IANA/2005/Birt/RCP/testBirt/testSampleDB.rptdesign ",
WebViewer.HTML,false);
WebViewer.display(reportName , WebViewer.HTML, browser);
} catch (Exception e) {
//logger.error(e);
e.printStackTrace();
}
}

protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}

}
Re: Is it possible to intergrate birt with SWT? [message #161190 is a reply to message #160746] Mon, 15 May 2006 17:00 Go to previous messageGo to next message
Eclipse UserFriend
What version of BIRT are you using?

Jason

"xy" <xy@gmail.com> wrote in message news:e44d7g$msb$1@utils.eclipse.org...
> java.lang.NullPointerException
> at org.eclipse.birt.report.viewer.ViewerPlugin.getResourceStrin g(Unknown
> Source)
> at
> org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(Unkno
> wn Source)
> at
> org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(Unknow
> n Source)
> at org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(Unknown
> Source)
> at org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(Unknown
> Source)
> at org.eclipse.birt.report.viewer.utilities.WebViewer.display(U nknown
> Source)
> at ReportViewer.previewReport(ReportViewer.java:85)
> at ReportViewer.createContents(ReportViewer.java:76)
> at ReportViewer.<init>(ReportViewer.java:55)
> at ReportViewer.main(ReportViewer.java:35)
>
> public class ReportViewer extends Shell {
> private Browser browser;
> private String reportName =
> " D:/eclipse/workspace/MyBirtPlugin/src/DynamicReport.rptdesig n ";
> /**
> * Launch the application
> *
> * @param args
> */
> public static void main(String args[]) {
> try {
> Display display = Display.getDefault();
> ReportViewer shell = new ReportViewer(display, SWT.SHELL_TRIM);
> shell.open();
> shell.layout();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> /**
> * Create the shell
> *
> * @param display
> * @param style
> */
> public ReportViewer(Display display, int style) {
> super(display, style);
> createContents();
> }
>
> /**
> * Create contents of the window
> */
> protected void createContents() {
> setText("SWT Application");
> setSize(500, 375);
> setLayout(new GridLayout());
>
> final Composite composite = new Composite(this, SWT.NONE);
> final GridData gridData = new GridData(GridData.FILL_HORIZONTAL |
> GridData.VERTICAL_ALIGN_BEGINNING);
> gridData.heightHint = 37;
> composite.setLayoutData(gridData);
>
> browser = new Browser(this, SWT.NONE);
> final GridData gridData_1 = new GridData(GridData.FILL_BOTH);
> browser.setLayoutData(gridData_1);
> //
> //showReport();
> previewReport();
> }
>
> private void previewReport() {
> try {
> WebViewer.startup(browser);
> System.setProperty("RUN_UNDER_ECLIPSE", "true");
> DtpManifestExplorer.getInstance().getExtensionManifests();
>
> //WebViewer.display("C:/IANA/2005/Birt/RCP/testBirt/testSampleDB.rptdesign ",
> WebViewer.HTML,false);
> WebViewer.display(reportName , WebViewer.HTML, browser);
> } catch (Exception e) {
> //logger.error(e);
> e.printStackTrace();
> }
> }
>
> protected void checkSubclass() {
> // Disable the check that prevents subclassing of SWT components
> }
>
> }
>
>
Re: Is it possible to intergrate birt with SWT? [message #161248 is a reply to message #161190] Mon, 15 May 2006 22:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: xy.nil.net

Birt 2.0.1
"Jason Weathersby" <jweathersby@actuate.com> д
Re: Is it possible to intergrate birt with SWT? [message #161614 is a reply to message #161248] Tue, 16 May 2006 17:29 Go to previous message
Eclipse UserFriend
Can you try just using

WebViewer.display(reportName , WebViewer.HTML, browser);
Also verify you have all the plugins that the WebViewer requires.

Jason
"xy" <xy@nil.net> wrote in message news:e4bbsi$t8f$1@utils.eclipse.org...
> Birt 2.0.1
> "Jason Weathersby" <jweathersby@actuate.com> д
Previous Topic:Group Total in Group Header
Next Topic:birt problem
Goto Forum:
  


Current Time: Sun May 11 14:59:26 EDT 2025

Powered by FUDForum. Page generated in 0.03201 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top