Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: conditional x and y position field Post Reply Post New Topic
Page  of 3 Next >>
Author Message
Paul46
Newbie
Newbie


Joined: 19 Feb 2008
Online Status: Offline
Posts: 22
Quote Paul46 Replybullet Topic: conditional x and y position field
    Posted: 21 Apr 2009 at 7:27am
Hello,

Since last week i am working with CR XI R2.
I discovered the new function in Size and Position for the x position where one can position a field based on a value.
What i need for my report is to position a field on the x and y position.
So for example:
If i have a value 1 in a field, the field should move to position x 123 and y 456
If i have a value 2 in a field, the field should move to position x 234 and y 567
etc. etc.

But there is no function for the y position, only for the x position.
So my question is; is what i want possible?

Thanks.


Edited by Paul46 - 21 Apr 2009 at 7:28am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Apr 2009 at 8:25am
I don't believe you can conditionally change the Y position.
Perhaps an alternative is to place the field you want to conditionally move onto the report twice, once in the x-y postition for condition 1 and once in the other x-y position for condition 2 and then conditionally suppress each using your values/conditions.
If this leaves a lot of weird space based on the y value you could create a second detail row (or header/footer), place all of the items where you need them with the 2 variations of that field and conditionally suppress the entire row using your values.


Edited by DBlank - 21 Apr 2009 at 8:25am
IP IP Logged
Paul46
Newbie
Newbie


Joined: 19 Feb 2008
Online Status: Offline
Posts: 22
Quote Paul46 Replybullet Posted: 22 Apr 2009 at 4:30am
Thanks. I understand what you say. However, the question was a simplified example, i wanted to know if there is a possibility to conditionally adjust the y position.... to begin with.
In reality i need one field that can take as many as 30 x and y positions based on a value.
I am hesitating to explain the full situation, i might not be clear enough, it's kind of difficult to explain and readers might wander off.
Well, here's for the really interested, what i try to accomplish:

The report i try to make is a fairly simple horeca list for our incorporated teahouse. There are something like 30 items on this list, like; coffee, tea, muffin, donut etc. We give workshops and training to groups of people. The employees of the theehouse want to know how many groups they can expect for a certain day. We work with an eventbookingprogramm called Full House. Full House's output is in Crystal reports format. The internal links from the database in Full House to Crystal reports are beyond our reach, they were once made and we cannot alter them, neither can the company that made Full House. They had a CR professional do it for them on a projectbase. This person is long gone since. So essentially there is no support for the connection between Full House and CR. This also means that we have to make do with excisting connections, we cannot make left outer joins etc.
From this situation i made a report with static textfields of all items we sell.
I cannot generate fields from Full House because Full House only generates what is actually booked that day and the teahouse wants a full list of items. So i made a full list of static textfields (coffee, tea etc.). Now  i want to let the quantity of actually booked (ordered) items appear behind the right static textfield. So if a group ordered 25 cups of coffee, this quantity must appear behind the textfield coffee. When nothing is ordered i surpress the zero.
I tried to get this the way we want for months now and i think how i described it above is the only way to accomplish it.

Well i hope i did not bore you to much and i hope somebody knows the answers to my questions.
Thanks.

Eric
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Apr 2009 at 6:25am
Let's see if I have this right.
 
You have a bunch of text boxes that print for each detail.  The amount for that particular detail you want to move to the correct text box and display, hence the x,y positioning?
 
If this is the case, since y position is out of the question, simply because the functionality is not there, could you instead take your value and place it into any one of a number of shared variables, and then display/suppress the various fields based on the shared variable?  If necessary you could create a second detail band and place the assignment formula in this band and suppress the band (moving it on top of the 'true' detail band).
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Apr 2009 at 7:45am
Basically you need a menu that shows all items available (even if not ordered for that day) with NULL next to items not ordered that day and a total number next to items that have been ordered that day, correct? Do these have to change in order based on quantity or something else that is making you deal with the xy position?
Also what is your data ouput? columns with a total per item, rows per item ordered that you need to count, or something else?
I think there are some decent solutions available depending on the above responses.
IP IP Logged
Paul46
Newbie
Newbie


Joined: 19 Feb 2008
Online Status: Offline
Posts: 22
Quote Paul46 Replybullet Posted: 22 Apr 2009 at 7:56am
By DBlank:
"Basically you need a menu that shows all items available (even if not ordered for that day) with NULL next to items not ordered that day and a total number next to items that have been ordered that day, correct?"

That is exactly what i aim for.

Due to the circumstances i described in my previous post i have to make use of static text fields in a header section. Only the amount field gets generated by Full House and this field is in the detail section. So i have to line up the amount in the detail section behind the corresponding text box in the header section.

As i am a newbie with CR i find it very difficult to describe this with all the right terms. Would it be an idea to attach my report, if that is at all possible? Perhaps you guys see better solutions than i do?

Greetings Eric
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Apr 2009 at 8:10am

so you only have one row of data returned with sums per item or one row per item with a sum of that item? Assuming you want it to be a row of headers then a row of totals then a row of headers then a row of totals repeated...

If it is one row of data with all the sums as columns you can create multiple detail sections, place first set of "Headers: on row a and the corresponding sums below them on details sectionb, next items headers on detailsC, related sums on detailsD, etc. You can conditioanlly suppress any zero values.
If it is one row per item with the sum, set it up in footers the same way.
Create multiple footers rows, A being your text headers and b being running totals conditinally summing items and placed on footer b, repeating as needed.
Make sense?
IP IP Logged
Paul46
Newbie
Newbie


Joined: 19 Feb 2008
Online Status: Offline
Posts: 22
Quote Paul46 Replybullet Posted: 23 Apr 2009 at 3:43am
This seems like a very good idea. I haven't thought about it this way. I try this and report back.

IP IP Logged
Paul46
Newbie
Newbie


Joined: 19 Feb 2008
Online Status: Offline
Posts: 22
Quote Paul46 Replybullet Posted: 27 Apr 2009 at 4:48am
< ="Content-" content="text/; charset=utf-8">< name="ProgId" content="Word.">< name="Generator" content="Microsoft Word 11">< name="Originator" content="Microsoft Word 11"><>

Hello,

 

I tried your suggestions of making a footer and Sum section for every item. Your idea seems excellent but I cannot get it working. This is either because i am a newbie, or because there are already a lot of sections in the pre-made report and when i try to add an extra sum section the report crashes on being generated. So then i tried to add the field: quantity (this field has the right quantity already in it, so no need to sum it) to the footer section but it does not show up on the report when printing.

When I try with textlabels in header section and the field quantity in the details section, the field quantity gets repeated depending on how many items are actually booked, this is good, but how do I place the right quantity field behind the right textlabel?

 

I really don’t think i want something extraordinary. When one sees my report one would think that it must be pretty straightforward to get this working.

 

< ="Content-" content="text/; charset=utf-8">< name="ProgId" content="Word.">< name="Generator" content="Microsoft Word 11">< name="Originator" content="Microsoft Word 11"><>

This is how it looks:


< ="Content-" content="text/; charset=utf-8">< name="ProgId" content="Word.">< name="Generator" content="Microsoft Word 11">< name="Originator" content="Microsoft Word 11"><>


Item
Amount
Item
Amount
Group header section
(All items = textlabels)
(All Amounts = field quantity)

Lunch
2
Coffee
 
 
 
 
 
Muffin
6
Tea
50
 
 
 
 
Juice
 
Yoghurt
 
 
 
 
 
Sandwich1
 
Soup 1
 
 
 
 
 
Sandwich2
3
Soup 2
 
 
 
 
 
Sandwich3
 
Soup 3
 
 
 
 
 
Sandwich4
 
Soup 4
12
 
 
 
 
Cake
 
Donut
 
Details Section
 
Field: quantity
 
Field: quantity
 
 
 
 
 

Remarks Eric:


The header section overlays the details section so the content of the field: quantity shows up behind the top two items (lunch and coffee). With this sort of surpress formula in the field quantity: {@CompDescription} <> "Lunch" i hoped to let only the content show up behind the right item, but i cannot get it to work.


Please note that the amounts in my example get generated from the field: quantity which is linked to the surpressed field: itemdescription. It would all been very much easier to just let the field itemdescription with the right amount behind it to show up, but our teahouse people must have the complete list with all items for sale, so not only the ordered items.

Pffff, i hope this all makes sense and readers still see what i'm trying to ask.


Greetings Eric

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Apr 2009 at 7:06am
Your ouput data for the above example is something like this correct?
Item               amount
Lunch                  2
Muffin                  6
Sandwhich2        3
Tea                    50
Soup4                12
if you create multiple footers and multiple running totals you should be able to replicate the output. Example:
 
footerA:   text "Lunch"    RT#1                Text "Coffee" RT#2
footerB:   text "Muffin"    RT#3                Text "Tea" RT#4etc.
For your running totals conditinaly sum the amount field based on the Item description. You will have to create one per item.
Example Running Total #1 (lunch)
Field to summarize=Amount Field
Type=SUM
Evaluate as a formula:  table.item="Lunch"
Reset
as Never unless you have a grouping here on customers or something else.
Repeat for the next item but replace the evaluate asa formula: table.item="Coffee"
IP IP Logged
Page  of 3 Next >>
Post Reply Post New Topic
Printable version Printable version

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



This page was generated in 0.015 seconds.