Reg : Using Arithematic Operators in Template

Hi,
I'm stuck with a small issue ie using arithematic operator in velocity template.
Please find the below code.
Bean Class : Graohics Bean
private String Width="250";
public void setWidth(String Width) {
this.Width = Width;
public String getWidth() {
return (int)(Integer.parseInt(Width)/0.75) + "";
Template Class :
#set($pwidth = "$graphicsAttributes.Width")
#set($pwidth1 = $pwidth + 20)
I am trying to add +20 to $pwidth1 which is returning string therefore the value is jus appending no acutual logical operation happening.
Can we convert String to Integer in a velocity template? .
Kindly help me out in solving this issue.

Well, your #1 is what Reports is designed to do.
You could do #2 if and only if the report is
always formatted exactly the same and only the
data values changed. And, your fields would have
to be fixed in size because #2 wouldn't support
elasticity at all.
#2 could be done with a separate program that
updated fields in an existing RTF file with new
data values, but it wouldn't be Oracle Reports
any more...
(You don't want to generate variable RTF
yourself. Reports has lots of bugs in its RTF
generator, but it's still better than writing it
yourself!)
-- allan plumb

Similar Messages

  • Additions with out using arithematical operators

    HI i have problem in java programming thatis how can i do additions and substractions with out using + ,-*(arithematical operators) in java

    make a guess
    its most probably home work
    But one has to wonder why this question is in the servlet forum

  • Problem in using relational operators in Data Templates

    Hi All,
    I have a query like following in data template type of Data set but I am not getting any data if I use simple < operator. Same query shows data in the database. Is there any other specific way of using relational operators in Data templates ? Please help in this regard
    <dataTemplate name="REVIEW_DATE" dataSourceRef="MY_DB">
         <dataQuery>
              <sqlStatement name="REVIEW_DATE">
                   <![CDATA[
    SELECT
    TABLE1.REVIEW_DATE
    FROM TABLE1 TABLE1 , TABLE2 TABLE2
    WHERE
    TABLE1.COLUMN1 = TABLE2.COLUMN2
    AND TABLE1.REVIEW_DATE < TABLE2.CURRENT_DATE]]></sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="REVIEW_DATE" source="REVIEW_DATE">
                   <element name="REVIEW_DATE" value="REVIEW_DATE"/>
              </group>
         </dataStructure>
    </dataTemplate>Thanks a lot !
    -Sookie

    solved after watching www.youtube.com/watch?v=FCujba8euWc
    thanks to all

  • Use realational operators in an SQL query??????

    does any one knows how to use realational operators in an SQL query??????
    i wud like to do something like
    select decode(2<3,sysdate,sydate +1) from dual
    but i know decode does not supports relational operators......
    thanx and Regards
    amyt

    You can use a CASE statement which does support relational operators, or if you must use DECODE, then you can use something like:
    SELECT DECODE(SIGN(2 - 3),-1,sysdate,sysdate - 1)
    FROM dual;The SIGN function returns -1 if the expression is < 0, 1 if the expression is > 0 and 0 if the expression is 0. This works for numeric comparisions. You can use the GREATEST or LEAST functions in a similar fashion for character comparisions.
    TTFN
    John

  • How do I use the alternate list template when rendering web app items to a page?

    I need to have the ability to use the main list template on particular pages, but then use different markup for other pages - is there a way that I can specify the alternate list template within the module tag?

    Hi Matt, You should read about web apps here:
    http://helpx.adobe.com/content/help/en/business-catalyst/partner/web-apps-module-create-cu stom.html
    And module reference here:
    http://helpx.adobe.com/business-catalyst/kb/modules-quick-reference.html
    If you insert through the admin and click customise you will see the option to use listbackup. You will also see that layout availible via FTP and in the admin or DW.
    Here you can see where in the module paramaters the option to choose listbackup occurs:
    http://helpx.adobe.com/business-catalyst/kb/modules-quick-reference.html#id_65138

  • I am changing from Word to Pages. I have created my custom template with all my styles etc and that is what comes up when I go for a New Document. Fine. How do I get it to use the same Custom Template when I use Pages to open a Word document?

    I am changing from Word to Pages. I have created my custom template with all my styles etc and that is what comes up when I go for a New Document. Fine. How do I get it to use the same Custom Template when I use Pages to open a Word document?

    The template is a document in itself, it is not applied to an existing document whether it is a Pages document or a Word document converted to a Pages document.
    You would need to either copy and paste content, using existing styles, or apply the styles to the converted Word document.
    You can Import the Styles from an existing document and those imported Styles can be used to override the current document's styles:
    Menu > Format > Import Styles
    The process is simplified if the styles use the same names, otherwise you will need to delete the style you don't want and replace it with the one that you do want when asked, then the substitution is pretty straightforward.
    Peter

  • Is it possible to use an XML Data Template to create a report in APEX?

    Hi,
    I have created an XML Data Template in BI Publisher passing one parameter and running two queries, then created an RTF Document Template to present the data.
    I can create a nice report in BI Publisher using the two elements. I have used RTF Document Templates to publish reports in APEX but the data comes from a Report region running a single query.
    I would like to run a report based in this kind of XML Data Template, in order to use several children queries related to a parent query. Is it possible to do it in APEX, or you have to use BI Publisher?
    Francisco
    ===========================
    Below is a simple data template definition:
    <dataTemplate name="cotizacion_template" description="Prueba de data template para cotizaciones" dataSourceRef="dbxprts">
         <parameters>
              <parameter name="p_id_cotizacion" dataType="character" defaultValue="1009" include_in_output="true"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="header_query">
                   <![CDATA[select id_cotizacion, fecha_cotizacion, id_clipro from f_cotizaciones where id_cotizacion = :p_id_cotizacion]]>
              </sqlStatement>
              <sqlStatement name="detail_query">
                   <![CDATA[select id_cotizacion as id_cot_child, id_detalle_cotizacion, partida, cantidad, id_producto from f_detalle_cotizaciones where id_cotizacion = :id_cotizacion]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="F_COTIZACIONES" source="header_query">
                   <element name="ID_COTIZACION" value="ID_COTIZACION"/>
                   <element name="ID_CLIPRO" value="ID_CLIPRO"/>
                   <element name="SUMA_CANTIDAD" value="F_DETALLE_COTIZACIONES.CANTIDAD" function="SUM()"/>
                   <group name="F_DETALLE_COTIZACIONES" source="detail_query">
                        <element name="PARTIDA" value="PARTIDA"/>
                        <element name="CANTIDAD" value="CANTIDAD"/>
                        <element name="ID_PRODUCTO" value="ID_PRODUCTO"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>

    Hi,
    I have the similar question. I used data templates in BI Publisher but now I want to use the same data template in Apex to print some reports.
    I tried to some examples but these were only using report queries. I also tried with the Web Service but this didn't work for me either maybe because I didn't
    used it in the right way. When I used the WS I received the binary of the report so the WS worked it was just the how and where to use it that didn't work for me.
    Now this older entry is BUMPED maybe we find a solution for our problem this way.
    regards,
    Steven

  • I created a book in iBooks Author using the Photo Book template. When I rotate to portrait orientation, the photo or widget disappears and a table of contents appears with only the interactive media showing.

    I created a book in iBooks Author using the Photo Book template. When I rotate to portrait orientation, the photo or widget disappears and a table of contents appears with only the interactive media showing.

    Thanx for the prompt response, KT. I have indeed seen that thread, only just after I posted the question.
    I have spent hours on the phone with what I now know is a call center in Texas on this question.
    I think Apple could be a little more "hands on" with iBooks Author users, and it should also be pointed out that landscape photos will not display in portrait mode.
    In my case, I used gallery widgets to display vertical photos, since they look better in portrait mode.
    But instead of simply rotating, the page disappears and a TOC of interactive media appears. The gallery behaves as expected when tapped. This is not what I expected, but since the gallery works, I can live with it.
    Right now I have "tickets" telling me to "fix" this "problem or to disable portrait mode.
    I don't want to disable portrait mode.
    Will Apple accept the books if I tell them this is not an "error?"

  • Decode function - using comparison operators

    Can I use comparison operators in a decode function such as below:
    select tasknum, title, esthrs, assigndate,
    decode(assigndate, < '04-OCT-04', '--') accum_hrs
    from assignment
    thanks.

    Found my answer.

  • SP2013 - Date Filter Web Part looses connection when used in a site template

    Hi,
    I created two table reports in SQL Reporting Services 2012 and inserted in a web page using the Reporting Service Report viewer in SharePoint 2013 with CU Dez 2013. The two reports require two dates and I use two date filter web parts (I did not try the
    date range solution I saw in the fórum).
    So the user inputs the two dates in date filters that send the information to thereports in the same page.
    They work in the site and I saved it as template. However when I create e new site using it as a templates, the date filter connections are broken and of course, they did not work.
    For another report where I usea text filter, it worked without any problem in the template.
    Does anybody know any workaround?
    Thank you.
    Best regards, Ricardo Segawa - Segawas Projetos / Microsoft Partner

    Hi ,
    The new site based on the saved site template will generate new ID for date filter web part, in the web part page the SPWebPartConnection "ProviderID" value seems still to reference the original date filter web part ID (see from
    SharePoint Designer), as a workaround we can re-configure the web part connection from the web part page manually or programmatically from that new site web part page.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/8d98206d-b41f-4ee4-b537-a4bf5cec0434/sharepoint-2010-save-site-as-template-webpart-connections-broken?forum=sharepointgeneralprevious
    http://sympmarc.com/2007/09/20/removing-a-web-part-connection-in-sharepoint/
    Thank
    Daniel Yang
    TechNet Community Support

  • Email Alert Template Issue - List Alerts (Alert Me) emails not using customized XML alert template

    We have recently customized the XML alerts template (AlertTemplates.xml) for our site collection in SharePoint 2010 to exclude specific fields in the email when users who have subscribed using the "Alert Me" feature. We have renamed the
    custom alerts XML file and loaded the custom template in the following directory (%ProgramFiles%\Common Files\Microsoft Shared\Web server extensions\14\TEMPLATE\XML) and restarted IIS.  Once users subscribe to the alerts using the list "alert me"
    function they received the customized email as intended.
    We needed to auto-subscribe users to the email alerts so what we did was use a powershell script to add users to the alert subscriptions using the script shown below:
    Import-Csv D:\Temp\filename.csv | ForEach-Object{
    $webUrl=$_.WebUrl
    $listTitle=$_.List
    $alertTitle=$_.AlertTitle
    $subscribedUser=$_.SubscribedUser
    $alertType=$_.AlertType
    $deliveryChannel=$_.DeliveryChannel
    $eventType=$_.EventType
    $frequency=$_.Frequency
    $oldAlertID=$_.ID
    $web=Get-SPWeb $webUrl
    $testAlert = $web.Alerts | WHERE { $_.ID -eq $oldAlertID }
    IF ($testAlert) {
    $web.Alerts.Delete([GUID]$oldAlertID)
    Write-Host Old alert $oldAlertID deleted. -Foregroundcolor Cyan
    $list=$web.Lists.TryGetList($listTitle)
    $user = $web.EnsureUser($subscribedUser)
    $newAlert = $user.Alerts.Add()
    $newAlert.Title = $alertTitle
    $newAlert.AlertType=[Microsoft.SharePoint.SPAlertType]::$alertType
    $newAlert.List = $list
    $newAlert.DeliveryChannels = [Microsoft.SharePoint.SPAlertDeliveryChannels]::$deliveryChannel
    $newAlert.EventType = [Microsoft.SharePoint.SPEventType]::$eventType
    $newAlert.AlertFrequency = [Microsoft.SharePoint.SPAlertFrequency]::$frequency
    if($frequency -ne "Immediate"){
    $AlertTime=$_.AlertTime
    $newAlert.AlertTime=$AlertTime
    $newAlert.Update()
    Write-Host Created $newAlert.Title for $subscribedUser . -Foregroundcolor Cyan
    } ELSE {
    Write-Host Alert $alertTitle for $subscribedUser already done. Moving on. -Foregroundcolor Magenta
    When we ran the script and added the users and restarted the service, all users who were auto-subscribed via this method get the email without the customizations that were done in teh custom alert template.  All users who manually subscribed on their
    own to the list using the "Alert Me" function would get the customized email.
    Does anyone know why users who manually subscribe to the alerts get the customized email, and users who were auto-subscribed using the powershell script do not get the customized email and get the standard generic email template?

    Hi  ,
    According to your code, it create a new alert using SPUser.Alerts.Add() method. For this method, it will create a new alert based on the predefined alert template by default.
    If you only assigned the custom alert template to the list, users who manually subscribe to the alerts get the customized email, but users who were auto-subscribed using the PowerShell script get the standard
    generic email template.
    For your issue, you can set the new alert ‘s alert template:
    http://social.technet.microsoft.com/Forums/en-US/1b19c12f-fc37-48cf-8b59-6c09f095dc23/custom-alert-email-templates-issue-list-alerts-emails-not-using-customized-xml-alert-template?forum=sharepointgeneralprevious
    Here is a good blog you can have a look:
    http://blogs.msdn.com/b/sharepointdeveloperdocs/archive/2007/12/07/customizing-alert-notifications-and-alert-templates-in-windows-sharepoint-services-3-0.aspx
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Eric Tao
    TechNet Community Support

  • HT4168 I have created an 100 page booklet in Pages, with many photographs, can I export it to ePub, and make an electronic book, because it says that "Note: The Pages document must have been created using a word processing template"?

    I have created an 100 page booklet in Pages, with many photographs, and much written word, can I export it to ePub, and make an electronic book, because it says that "Note: The Pages document must have been created using a word processing template"?....
    Basically what I want to do is publish the document into both an eDocument, and a hard copy document. What is the best way to do this?

    No Peter, this statement came right off the Apple ePub statement when outlining how to use ePub. the full context is:
    Creating ePub files with Pages
    Summary
    Learn how to create ePub files with Pages.
    Products Affected
    Pages '09
    ePub is an open ebook standard produced by the International Digital Publishing Forum. Pages ’09 lets you export your documents in ePub format for reading with iBooks on iPhone, iPad, or iPod touch.
    iBooks supports both ePub and PDF file formats, and you can export both from Pages.
    When to use ePub or PDF
    Use ePub when text is the most important part of your document, for example when you create a book, a report, a paper, a thesis, or classroom reading material.
    More details on using ePubUse PDF when layout is the most important part of your document, for example when you create a brochure, a flyer, or a manual with multiple illustrations.
    More details on using PDF
    Creating an ePub Document to Read in iBooks
    You can export any Pages word processing document to the ePub file format for reading in an ePub reader, such as the iBooks application on the iPad, iPhone, or iPod touch. Documents created in page layout templates can’t be exported to the ePub format.
    Documents exported to ePub format will look different than their Pages counterparts. If you want to get the best document fidelity between the Pages and ePub formats, style your Pages document with paragraph styles and other formatting attributes allowed in an ePub file. A sample document is provided on the Apple Support site that features styles and guidelines to help you create a Pages document that’s optimized for export to the ePub file format, which you can use as a template or a guide. To learn more about using paragraph styles in Pages, see the topics under the heading “Working with Styles” in the Pages built-in help.
    To read your ePub document in iBooks on your mobile device, you must transfer the ePub file that you create onto your device.
    To use the “ePub Best Practices” sample documentTo learn more about using the ePub format and get a better feel for how a Pages document might appear as a book in iBooks, it’s a good idea to download the “ePub Best Practices” sample document. After reading the guidelines and instructions within the document, you can use it as a template to create your own document. You can also import the styles from the sample document into a new document you create.
    Download the “ePub Best Practices” sample document at the following web address:
    http://images.apple.com/support/pages/docs/ePub_Best_Practices_EN.zip
    Do either of the following:Use the sample document as a template.Import the paragraph styles from the sample document into a new or existing Pages document.
    Export the document you create to ePub format to see how it looks in iBooks.
    Preparing an existing Pages document for export to ePub format
    Documents exported to the ePub format automatically appear with page breaks before every chapter. A table of contents is automatically generated, which allows readers to jump quickly to any chapter title, heading, or subheading in the book. In order to create a meaningful table of contents, it’s important to apply appropriate styles within your document. The ePub reader uses the paragraph styles to determine which items should appear in the table of contents for your book.
    Note: The Pages document must have been created using a word processing template.

  • Using Numbers Personal Budget template I can't figure out how to change the categories in both tabs (budget and transactions)

    Brand new just bought Numbers and I used the personal budget template to enter our monthly budget.  I customized the spread sheet with our budget categories, but then when I go to the transactions tab to add our transactions, it only has the generic categories.  How do I change them so that my transactions end up on the table?

    Hi artlisavz,
    There are 2 places to make changes.
    I assume this is where you have already changed things:
    The Budget tab- Summary by Category- just click the name and change it. Or else you dragged the "=" at the lower left to add rows. Added your categories.
    You need to edit the popup in the Transactions tab- Category popup.
    Popup menu is a data format. You find it on the right side bar Format>Cell>Data Format> Popup Menu. Change, delete, go wild. If you edit the first one you can copy it, select the rest of the column and paste. If you find you want an additional in a month or so you can enter it as text (after deleting the popup), then select it and the popup above and choose the popup format instead of multiple and you will have added it to that popup. You will need to fill it to the rest of the column.
    If you added additional categories, you want to update the pie chart.
    Click the pie chart, click "Edit Data References", drag the section to include your added categories.
    quinn

  • Problem Using Relational Operators !!

    The code given under is not working corretly. The problem is stated as comments in the program.
    if(result.next())
    String temp_no=t_no.getText();
    String temp_nm=t_name.getText();
    String temp_result1= result.getString(2);
    String temp_result2= result.getString(3);
    if(temp_no!=temp_result1) // The condition is always true.Even if i give the same no & name as in database!! Why is it so?
    JOptionPane.showMessageDialog(cdFrame, new String("There Is No Disc With The Specified Number !!"));
    else
    if(temp_nm!=temp_result2)
    JOptionPane.showMessageDialog(cdFrame, new String("There Is No Disc With The Specified Name !!"));
    else
    upd.executeUpdate();     
    JOptionPane.showMessageDialog(cdFrame, new String("DATA HAS BEEN UPDATED !!"));
    else
    JOptionPane.showMessageDialog(cdFrame, new String("There Is No Such Disc As Stated In Old Data !!"));
    }                              The Program compiles properly and gives no runtime error. What's the problem!!

    yes dude, u can't use relational operators for objects.. its works only on simple data types..

  • [SOLVED] How do I use .tex files as templates in vim?

    I finally got vim just the way I like it, and I plan to write papers using LaTeX now that I have seen the light. I created a .tex file called documentTemplate.tex with all the options set up for the title, author, font, margins, etc. just the way I like it. What I would like to do is be able to execute a command that opens this document with vim and then be forced to save it as a different file name. I have made my documentTemplate.tex read-only, and when I open it with vim, it gives me the usual warning and then allows me to edit the document without actually writing over it.
    The problem I have experienced is after writing the file with a new name using ":w ~/Documents/<filename>", I am not able to save over that document with ":w". Every subsequent ":w" tries to save what I have over documentTemplate.tex, but not the new file name. How can I make this work correctly?
    If there is a better way to use .tex documents as templates with vim please let me know. I am not using vim-latex because it seems to be dying/not that good/unnecessary/whatever. What are the other LaTeXers doing? At least some of you guys must use vim!
    Thanks,
    Allamgir
    Last edited by Allamgir (2009-08-17 16:19:22)

    Or add something like this in your .vimrc (much cleaner imo):
    if has('autocmd')
    autocmd BufNewFile * silent! 0r $HOME/.vim/templates/%:e.tpl
    endif
    Where in this case $HOME/.vim/templates/tex.tpl is your latex template.  Now everytime you open a file that has a .tex extension (or possibly filetype, I'm not sure what is used here) your template will be loaded.  You can obviously modify it to whatever suits you the best.
    Note that this is taken straight out of my .vimrc, and it is set up to handle multiple template languages, not just tex files.  Adding a $HOME/.vim/templates/py.tpl automatically adds python templates too.
    Last edited by rson451 (2009-08-17 16:33:42)

Maybe you are looking for