User: rt Date: 2008-06-16 13:29:40+0000 Modified: dba/reportdesign/source/core/api/ReportEngineJFree.cxx
Log: INTEGRATION: CWS rptchart02 (1.7.4); FILE MERGED 2008/05/22 08:09:54 oj 1.7.4.3: #i86902# impl author and title functions 2008/04/16 06:27:51 oj 1.7.4.2: RESYNC: (1.7-1.8); FILE MERGED 2008/04/03 06:35:18 oj 1.7.4.1: #i86343# remove unused code File Changes: Directory: /dba/reportdesign/source/core/api/ ============================================= File [changed]: ReportEngineJFree.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/api/ReportEngineJFree.cxx?r1=1.8&r2=1.9 Delta lines: +18 -7 -------------------- --- ReportEngineJFree.cxx 2008-04-10 18:14:17+0000 1.8 +++ ReportEngineJFree.cxx 2008-06-16 13:29:37+0000 1.9 @@ -50,6 +50,7 @@ #include "corestrings.hrc" #endif #include <tools/debug.hxx> +#include <svtools/useroptions.hxx> #include <unotools/tempfile.hxx> #include <unotools/sharedunocomponent.hxx> #include <comphelper/mimeconfighelper.hxx> @@ -160,11 +161,6 @@ set(PROPERTY_STATUSINDICATOR,_statusindicator,m_StatusIndicator); } // ----------------------------------------------------------------------------- -::rtl::OUString OReportEngineJFree::transform() -{ - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")); /// TODO has to be changed into the real name for the report transformation -} -// ----------------------------------------------------------------------------- ::rtl::OUString OReportEngineJFree::getNewOutputName() { ::rtl::OUString sOutputName; @@ -187,14 +183,16 @@ } m_xReport->storeToStorage(xTemp,aEmpty); // store to temp file because it may contain information which aren't in the database yet. - uno::Sequence< beans::NamedValue > aConvertedProperties(5/*6*/); + uno::Sequence< beans::NamedValue > aConvertedProperties(7); sal_Int32 nPos = 0; aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("InputStorage")); aConvertedProperties[nPos++].Value <<= xTemp; aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutputStorage")); const static String s_sExt = String::CreateFromAscii(".rpt"); - String sName = m_xReport->getName(); + String sName = m_xReport->getCaption(); + if ( !sName.Len() ) + sName = m_xReport->getName(); ::utl::TempFile aFile(sName,sal_False,&s_sExt); uno::Reference< embed::XStorage > xOut = OStorageHelper::GetStorageFromURL(aFile.GetURL(),embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE,uno::Reference< lang::XMultiServiceFactory >(m_xContext->getServiceManager(),uno::UNO_QUERY)); utl::DisposableComponent aOut(xOut); @@ -213,6 +211,19 @@ aConvertedProperties[nPos].Name = PROPERTY_ACTIVECONNECTION; aConvertedProperties[nPos++].Value <<= m_xActiveConnection; + // some meta data + SvtUserOptions aUserOpts; + ::rtl::OUStringBuffer sAuthor(aUserOpts.GetFirstName()); + sAuthor.appendAscii(" "); + sAuthor.append(aUserOpts.GetLastName()); + static const ::rtl::OUString s_sAuthor(RTL_CONSTASCII_USTRINGPARAM("Author")); + aConvertedProperties[nPos].Name = s_sAuthor; + aConvertedProperties[nPos++].Value <<= sAuthor.makeStringAndClear(); + + static const ::rtl::OUString s_sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")); + aConvertedProperties[nPos].Name = s_sTitle; + aConvertedProperties[nPos++].Value <<= m_xReport->getCaption(); + // create job factory and initialize const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(uno::Reference< lang::XMultiServiceFactory >(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW)); uno::Reference<task::XJob> xJob(m_xContext->getServiceManager()->createInstanceWithContext(sReportEngineServiceName,m_xContext),uno::UNO_QUERY_THROW); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
