1d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5d1766043SAndrew Rist * distributed with this work for additional information 6d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14d1766043SAndrew Rist * software distributed under the License is distributed on an 15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17d1766043SAndrew Rist * specific language governing permissions and limitations 18d1766043SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20d1766043SAndrew Rist *************************************************************/ 21d1766043SAndrew Rist 22d1766043SAndrew Rist 23*2ef7dab5Smseidel 24cdf0e10cSrcweir#ifndef __com_sun_star_report_XDatabaseDataProvider_idl__ 25cdf0e10cSrcweir#define __com_sun_star_report_XDatabaseDataProvider_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__ 28cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl> 29cdf0e10cSrcweir#endif 30cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl> 31cdf0e10cSrcweir#include <com/sun/star/beans/UnknownPropertyException.idl> 32cdf0e10cSrcweir#include <com/sun/star/lang/XInitialization.idl> 33cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl> 34cdf0e10cSrcweir#include <com/sun/star/sdbc/XConnection.idl> 35cdf0e10cSrcweir#include <com/sun/star/sdbc/XParameters.idl> 36cdf0e10cSrcweir#include <com/sun/star/sdbc/XRowSet.idl> 37cdf0e10cSrcweir#include <com/sun/star/chart2/data/XDataProvider.idl> 38cdf0e10cSrcweir#include <com/sun/star/chart2/data/XRangeXMLConversion.idl> 39cdf0e10cSrcweir 40cdf0e10cSrcweir//============================================================================= 41cdf0e10cSrcweir 42cdf0e10cSrcweir module com { module sun { module star { module chart2 { module data { 43cdf0e10cSrcweir 44cdf0e10cSrcweir//============================================================================= 45cdf0e10cSrcweir 46cdf0e10cSrcweir/** identifies a <type>XDataProvider</type> for result sets. 47cdf0e10cSrcweir 48cdf0e10cSrcweir @see XDataProvider 49cdf0e10cSrcweir @see DataProvider 50cdf0e10cSrcweir */ 51cdf0e10cSrcweirinterface XDatabaseDataProvider 52cdf0e10cSrcweir{ 53cdf0e10cSrcweir /** For accessing data a component provides for being used by 54cdf0e10cSrcweir charts. 55cdf0e10cSrcweir */ 56cdf0e10cSrcweir interface XDataProvider; 57cdf0e10cSrcweir 58cdf0e10cSrcweir /** allows you to convert the ranges a data provider deals with 59cdf0e10cSrcweir internally into valid XML. 60cdf0e10cSrcweir */ 61cdf0e10cSrcweir interface XRangeXMLConversion; 62cdf0e10cSrcweir 63cdf0e10cSrcweir /** allows access to the properties of the instance. 64cdf0e10cSrcweir */ 65cdf0e10cSrcweir interface com::sun::star::lang::XInitialization; 66cdf0e10cSrcweir 67cdf0e10cSrcweir /** allows life-time control of the database data provider. 68cdf0e10cSrcweir */ 69cdf0e10cSrcweir interface com::sun::star::lang::XComponent; 70cdf0e10cSrcweir 71cdf0e10cSrcweir /** allows access to the properties of the instance. 72cdf0e10cSrcweir */ 73cdf0e10cSrcweir interface com::sun::star::beans::XPropertySet; 74cdf0e10cSrcweir 75cdf0e10cSrcweir interface com::sun::star::sdbc::XParameters; 76cdf0e10cSrcweir interface com::sun::star::sdbc::XRowSet; 77cdf0e10cSrcweir 78cdf0e10cSrcweir /** is used for subreports and contains the names of columns of the parent report. 79cdf0e10cSrcweir <p> These columns are typically the foreign key fields of the parent report. 80cdf0e10cSrcweir The values of theses columns are used to identify the data for the subreport. 81*2ef7dab5Smseidel Each time the parent report changes it's current row, the subreport requires 82*2ef7dab5Smseidel its data based on the values of the master fields.</p> 83*2ef7dab5Smseidel <p>If the report is no sub report (e.g. its parent is not a report itself), this 84cdf0e10cSrcweir property is not evaluated.</p> 85cdf0e10cSrcweir 86cdf0e10cSrcweir */ 87cdf0e10cSrcweir [attribute,bound] sequence<string> MasterFields; 88cdf0e10cSrcweir 89cdf0e10cSrcweir /**is used for subreports and contains the names of the columns of the subreport 90cdf0e10cSrcweir which are related to the master fields of the parent report. 91cdf0e10cSrcweir <p>Entries in this sequence can either denote column names in the sub report, 92*2ef7dab5Smseidel or parameter names.<br/> 93cdf0e10cSrcweir For instance, you could base the report on the SQL statement 94cdf0e10cSrcweir <code>SELECT * FROM invoices WHERE cust_ref = :cid</code>, and add <code>cid</code> 95cdf0e10cSrcweir to the DetailFields property. In this case, the parameter will be filled from 96cdf0e10cSrcweir the corresponding master field.<br/> 97cdf0e10cSrcweir Alternatively, you could simply base your report on the table <code>invoices</code>, 98cdf0e10cSrcweir and add the column name <code>cust_ref</code> to the DetailFields. In this case, 99cdf0e10cSrcweir and implicit filter clause <code>WHERE cust_ref = :<new_param_name></code> will 100cdf0e10cSrcweir be created, and the artificial parameter will be filled from the corresponding 101cdf0e10cSrcweir master field.<br/> 102cdf0e10cSrcweir If a string in this property denotes both a column name and a parameter name, it 103cdf0e10cSrcweir is undefined which way it is interpreted, but implementations of the service are required 104a893be29SPedro Giffuni to either decide for the parameter or the column, and proceed as usual. 105cdf0e10cSrcweir </p> 106cdf0e10cSrcweir <p>The columns specified herein typically represent a part of the primary key 107cdf0e10cSrcweir fields or their aliases of the detail report.</p> 108cdf0e10cSrcweir <p>If the report is no sub report (e.g. it's parent is not a report itself), this 109cdf0e10cSrcweir property is not evaluated.</p> 110cdf0e10cSrcweir * 111cdf0e10cSrcweir */ 112cdf0e10cSrcweir [attribute,bound] sequence<string> DetailFields; 113cdf0e10cSrcweir 114cdf0e10cSrcweir /** is the command which should be executed, the type of command depends 115cdf0e10cSrcweir on the CommandType. 116cdf0e10cSrcweir <p>In case of a <member>CommandType</member> of <member>CommandType::COMMAND</member>, 117cdf0e10cSrcweir means in case the <member>Command</member> specifies an SQL statement, the inherited 118cdf0e10cSrcweir <member scope="com::sun::star::sdbc">RowSet::EscapeProcessing</member> 119cdf0e10cSrcweir becomes relevant:<br/> 120cdf0e10cSrcweir It then can be to used to specify whether the SQL statement should be analyzed on the 121cdf0e10cSrcweir client side before sending it to the database server.<br/> 122cdf0e10cSrcweir The default value for <member scope="com::sun::star::sdbc">RowSet::EscapeProcessing</member> 123cdf0e10cSrcweir is <TRUE/>. By switching it to <FALSE/>, you can pass backend-specific SQL statements, 124cdf0e10cSrcweir which are not standard SQL, to your database.</p> 125cdf0e10cSrcweir 126cdf0e10cSrcweir 127cdf0e10cSrcweir @see com::sun::star::sdb::CommandType 128cdf0e10cSrcweir */ 129cdf0e10cSrcweir [attribute,bound] string Command; 130cdf0e10cSrcweir 131cdf0e10cSrcweir /** specifies the type of the command to be executed to retrieve a result set. 132cdf0e10cSrcweir 133cdf0e10cSrcweir <p><member>Command</member> needs to be interpreted depending on the value of this property.</p> 134cdf0e10cSrcweir 135b1bc2d97SMatthias Seidel <p>This property is only meaningful together with the <member>Command</member> 136cdf0e10cSrcweir property, thus either <em>both</em> or <em>none</em> of them are present.</p> 137cdf0e10cSrcweir 138cdf0e10cSrcweir @see com::sun::star::sdb::CommandType 139cdf0e10cSrcweir */ 140cdf0e10cSrcweir [attribute,bound] long CommandType; 141cdf0e10cSrcweir 142ffebe23aSMatthias Seidel /** specifies an additional filter to optionally use. 143cdf0e10cSrcweir 144cdf0e10cSrcweir <p>The Filter string has to form a SQL WHERE-clause, <em>without</em> the WHERE-string itself.</p> 145cdf0e10cSrcweir 146cdf0e10cSrcweir <p>If a <member>DataSourceName</member>, <member>Command</member> and <member>CommandType</member> 147cdf0e10cSrcweir are specified, a <type>RowSet</type> can be created with this information. If the results provided by the 148cdf0e10cSrcweir row set are to be additionally filtered, the Filter property can be used.</p> 149cdf0e10cSrcweir 150cdf0e10cSrcweir <p>Note that the Filter property does not make sense if a <member>ResultSet</member> has been specified 151cdf0e10cSrcweir in the DataAccessDescriptor.</p> 152cdf0e10cSrcweir 153cdf0e10cSrcweir @see com::sun::star::sdb::RowSet 154cdf0e10cSrcweir @see ResultSet 155cdf0e10cSrcweir */ 156cdf0e10cSrcweir [attribute,bound] string Filter; 157cdf0e10cSrcweir 158cdf0e10cSrcweir /** indicates whether the filter should be applied or not, 159cdf0e10cSrcweir default is <FALSE/>. 160cdf0e10cSrcweir */ 161cdf0e10cSrcweir [attribute,bound] boolean ApplyFilter; 162cdf0e10cSrcweir 163cdf0e10cSrcweir /** additional having clause for the row set 164cdf0e10cSrcweir */ 165cdf0e10cSrcweir [attribute,bound] string HavingClause 166cdf0e10cSrcweir { 167cdf0e10cSrcweir set raises (com::sun::star::beans::UnknownPropertyException); 168cdf0e10cSrcweir }; 169cdf0e10cSrcweir 170cdf0e10cSrcweir /** additional group by for the row set 171cdf0e10cSrcweir */ 172cdf0e10cSrcweir [attribute,bound] string GroupBy 173cdf0e10cSrcweir { 174cdf0e10cSrcweir set raises (com::sun::star::beans::UnknownPropertyException); 175cdf0e10cSrcweir }; 176cdf0e10cSrcweir 177cdf0e10cSrcweir /** is a additional sort order definition for a row set. 178cdf0e10cSrcweir */ 179cdf0e10cSrcweir [attribute,bound] string Order; 180cdf0e10cSrcweir 181cdf0e10cSrcweir /** specifies if the <member>Command</member> should be analyzed on the client side before sending it 182cdf0e10cSrcweir to the database server. 183cdf0e10cSrcweir 184cdf0e10cSrcweir <p>The default value of this property is <TRUE/>. By switching it to <FALSE/>, you can pass 185cdf0e10cSrcweir backend-specific SQL statements, which are not standard SQL, to your database.</p> 186cdf0e10cSrcweir 187cdf0e10cSrcweir <p>This property is usually present together with the <member>Command</member> and 188cdf0e10cSrcweir <member>CommandType</member> properties, and is evaluated if and only if <member>CommandType</member> 189cdf0e10cSrcweir equals <member>CommandType::COMMAND</member>.</p> 190cdf0e10cSrcweir */ 191cdf0e10cSrcweir [attribute,bound] boolean EscapeProcessing; 192cdf0e10cSrcweir 193cdf0e10cSrcweir /** specifies the maximal count of rows which should be fetched. 194cdf0e10cSrcweir <p>A value of zero implies that no limit exists.</p> 195cdf0e10cSrcweir */ 196cdf0e10cSrcweir [attribute,bound] long RowLimit; 197cdf0e10cSrcweir 198cdf0e10cSrcweir /** specifies the active connection which is used to create the resulting report. 199cdf0e10cSrcweir */ 200cdf0e10cSrcweir [attribute,bound] com::sun::star::sdbc::XConnection ActiveConnection 201cdf0e10cSrcweir { 202cdf0e10cSrcweir set raises (com::sun::star::lang::IllegalArgumentException); 203cdf0e10cSrcweir }; 204cdf0e10cSrcweir /** is the name of the datasource to use, this could be a named datasource 205cdf0e10cSrcweir or the URL of a data access component. 206cdf0e10cSrcweir */ 207cdf0e10cSrcweir [attribute,bound] string DataSourceName; 208cdf0e10cSrcweir}; 209cdf0e10cSrcweir 210cdf0e10cSrcweir//============================================================================= 211cdf0e10cSrcweir 212cdf0e10cSrcweir }; }; }; }; }; 213cdf0e10cSrcweir 214cdf0e10cSrcweir/*============================================================================= 215cdf0e10cSrcweir 216cdf0e10cSrcweir=============================================================================*/ 217cdf0e10cSrcweir#endif 218