OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Solved]How do I display a parameter in a report heading?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
derekd
General User
General User


Joined: 14 Jun 2012
Posts: 7
Location: Warwick UK

PostPosted: Thu Jun 14, 2012 1:21 am    Post subject: [Solved]How do I display a parameter in a report heading? Reply with quote

]I have created a query to input 2 parameters using the BETWEEN function. I have created a report based on it to display rambles between X and Y miles. I want the title of the report to be "Rambles between X and Y miles" where X and Y vary.

Any help would be appreciated. I used to be able to do this in Access without using SQL. I am not familiar with SQL.

Thank you.


Last edited by derekd on Fri Jun 15, 2012 1:12 am; edited 5 times in total
Back to top
View user's profile Send private message Visit poster's website
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Thu Jun 14, 2012 5:30 am    Post subject: Reply with quote

You indicated you created a Query, assume your BETWEEN statement on the Criterion line was ( if not exactly as below, change the code I am providing to match your prompts ):

Code:
BETWEEN :Enter_From_Miles AND :Enter_To_Miles


Two alternatives, use EITHER a or b below:
  1. Alternative a: You will enter TWO additional columns for your Query:

    1. On another column, on the Field line, place:
      Code:
      :Enter_From_Miles

    2. On the Alias line, choose a column name, for example: From Miles

    3. On another column, on the Field line place:
      Code:
      :Enter_To_Miles


    4. On the Alias line, choose a column name, for example: To Miles

    5. Run the Query

    6. Save the Query


  2. Alternative b, You will enter ONE additional column for your Query

    1. On the field line, enter:
      Code:
      'Rambles between ' || :Enter_From_Miles || ' and ' || :Enter_To_Miles' || ' miles'

    2. On the Alias line, enter: ReportTitle

    3. Run the Query

    4. Save the Query
Explanation: Since the Prompt names ( beginning with the colons ) are the same as you used on the Criterion line, they are only prompted for once. After running it, the content for each returned record of the Query also contains your input range, so, these values can be used in the Report or Report Title. Alternative b, creates the Report Title as you described it, using the prompts you already input. Smile

I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your first post Title ( edit button ) if your issue has been fixed / resolved.
Back to top
View user's profile Send private message
derekd
General User
General User


Joined: 14 Jun 2012
Posts: 7
Location: Warwick UK

PostPosted: Thu Jun 14, 2012 7:52 am    Post subject: Parameter query Reply with quote

Many thanks for your help. I managed to get a Query working similar to the examples shown. I deleted a superfluous ' at the end of :Enter-To-Miles and used the following
'Rambles between ' || :Enter_From_Miles || ' and ' || :Enter_To_Miles || ' miles'

My query displays, amongst other fields, 3 extra columns with aliases From Miles, To Miles and ReportTitle. the results are as expected when I run the query.

However, I can't get the report to display the ReportTitle as displayed in the query. I can get the correct data displayed in the report but cannot get the title to display. I copy and paste the ReportTitle field into the title area.
Back to top
View user's profile Send private message Visit poster's website
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Thu Jun 14, 2012 8:05 am    Post subject: Reply with quote

Which Report tool are you using? :

  1. Oracle Report Builder ( formerly named Sun Report Builder ) from the extension
  2. Not the above, but, using Writer as the report surrogate

Yes, you are correct, one superfluous ( extra ) single quote, sorry.

Sliderule
Back to top
View user's profile Send private message
derekd
General User
General User


Joined: 14 Jun 2012
Posts: 7
Location: Warwick UK

PostPosted: Thu Jun 14, 2012 9:03 am    Post subject: Using parameters in a report title Reply with quote

Thank you. I took the hint and downloaded Oracle Report Builder. That solved my problem. I had not downloaded any report builder. i wonder if it was a bug that caused my problem. I like Oracle Report Builder. thanks for the tip!
Back to top
View user's profile Send private message Visit poster's website
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Thu Jun 14, 2012 9:07 am    Post subject: Reply with quote

Good that you have resolved the issue.

Therefore, please, follow the instructions below, and, mark this post as [Solved] . . . so others reading / searching the forum will know to look for posts that have been 'resolved' AND no reason to post further solutions, since, it is now solved. Smile

Sliderule

Thanks to add [Solved] in your first post Title ( edit button ) if your issue has been fixed / resolved.
Back to top
View user's profile Send private message
derekd
General User
General User


Joined: 14 Jun 2012
Posts: 7
Location: Warwick UK

PostPosted: Thu Jun 14, 2012 10:38 am    Post subject: parameter report Reply with quote

The problem was solved but I now find i get repeated crashes with Oracle Report Builder. I can eventually build a report using Create a Report in Design View. The Report Wizard has stopped loading altogether. I tried removing Oracle Report Builder and then adding it again (as an extension). I now see that at the download site lots of people have written negative reports about it. Maybe, you were not recommending it after all. Anyway my problem is solved. So, thanks again.
Back to top
View user's profile Send private message Visit poster's website
Sliderule
Super User
Super User


Joined: 29 May 2004
Posts: 2499
Location: 3rd Rock From The Sun

PostPosted: Thu Jun 14, 2012 11:07 am    Post subject: Reply with quote

I use the Oracle Report Builder, without any problems all the time.

Other users comments, are often from some that have elected not to read the documentation or follow instructions.

While you added [Solved] to your first post, you did NOT follow the instruction I gave explicitly at the bottom of my posts. I have asked that you add [Solved] in your first post Title, not in only in your first post. So, others doing a search, will note the posts that have been solved with the words as a part of the title.

Sliderule

Thanks to add [Solved] in your first post Title ( edit button ) if your issue has been fixed / resolved.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group