01: /*
02: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
03: * This software was developed by Pentaho Corporation and is provided under the terms
04: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
05: * this file except in compliance with the license. If you need a copy of the license,
06: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
07: *
08: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
09: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
10: * the license for the specific language governing your rights and limitations.
11: *
12: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
13: */
14: package org.pentaho.reportdesigner.crm.report.datasetplugin.sampledb;
15:
16: import org.jetbrains.annotations.NonNls;
17: import org.jetbrains.annotations.NotNull;
18: import org.pentaho.reportdesigner.crm.report.ReportDialog;
19: import org.pentaho.reportdesigner.crm.report.datasetplugin.jdbc.JDBCDataSetReportElement;
20:
21: /**
22: * User: Martin
23: * Date: 14.03.2006
24: * Time: 08:14:29
25: */
26: public class SampleDataSetReportElement extends
27: JDBCDataSetReportElement {
28: public SampleDataSetReportElement() {
29: }
30:
31: public boolean showConfigurationComponent(@NotNull
32: ReportDialog parent, boolean firsttime) {
33: if (firsttime) {
34: @NonNls
35: String sqlQuery = "SELECT\n"
36: + "CUSTOMERS.FIRST_NAME, CUSTOMERS.LAST_NAME,\n"
37: + "PRODUCTS.PRODUCT_NAME, PRODUCTS.PRODUCT_DESCRIPTION, PRODUCTS.PRICE\n"
38: + "FROM CUSTOMERS\n"
39: + "JOIN ORDERS ON CUSTOMERS.CUSTOMER_ID=ORDERS.CUSTOMER_ID\n"
40: + "JOIN ORDER_ITEMS ON ORDER_ITEMS.ORDER_ID=ORDERS.ORDER_ID\n"
41: + "JOIN PRODUCTS ON ORDER_ITEMS.PRODUCT_ID=PRODUCTS.PRODUCT_ID\n"
42: + "ORDER BY\n"
43: + "CUSTOMERS.FIRST_NAME, CUSTOMERS.LAST_NAME, PRODUCTS.PRODUCT_NAME";
44: setSqlQuery(sqlQuery);
45: }
46: return super .showConfigurationComponent(parent, false);
47: }
48: }
|