Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts

Sunday, March 11, 2012

Custom Page Size

Hai,

Is it possible to setup custom page size in crystal reports? I do have about 40 column and it is necessary to display and printing in report viewing. What I do now is I used A3 paper size & landscape. In report design, the page ruler at the top shows 23(inc / cm..not sure about this). Anyhow..can I adjust it to be more bigger than this? Currently the reports can generate the data as per requirement..but it look quite messy and bit cram. Kindly adviseYou need to install a printer driver for larger sized paper.
Bit of a pain when Crystal supports extract to Excel but won't let you design a report bigger than an installed printer driver size.|||Hi JaganEllis

Thanks for the response.
I did install the printer software. Adobe PDF creator..which is the software allowed me the option to choose A1 to A3 size. When I used A2 page size..it expand till 26 (page ruler) ..it look better than used a3 or A4 size. Unfortunatelly still quite messy.. so, I've changed to A1 size..and now I can resize the column and the data printing little bit nice. However..when tested it in report viewing..the error message come out 'Page too large' .. ayyo! Another problems come out.. hmmm what should I do? anybody can suggest me another printer software that can printing for larger size.

Out of idea already..kindly advise.
Crystal 2402

Custom names for summary fields

Using Crystal Reports 8.5 I have created a report which displays a pie chart of the column totals in a report. Unfortunately the names of the summary fields are used as labels for the pie chart slices and they are ugly - things like "sum qryOrders.OrderValue". Is there a way to replace these labels with my own choice of text?From the deafening silence, the answer appears to be 'No'. In case anyone else has the same issue, here is a workaround. Suppress the display of pie slice labels. Suppress the display of the chart legend. Create your own legend box using the basic drawing tools - filled rectangles - and add your own text labels.|||For the sake of future Googlers; I too was having this problem, and I had given up when I realized that if you sort "in specified order", you can then set up your "Named Groups" such that the "Group Name" is the name that you wish to have displayed.

For example, the formula for one of my named groups is "@.Allocation" "is equal to" "International Equity", and the name of the group is "Int'l Equity".

Works like a charm, sorry I'm too late to help you.|||Well, within a couple of minutes of posting, I realized that this only works if you have only one field to show a value for. So, it's not going to work where I really need it to, but still, it's useful elsewhere.

Thursday, March 8, 2012

Custom Groups

I'm wondering if there is any way in RS to create what Crystal reports calls Custom or Named Groups. This functionality allows you to define groups based on the values found in one of the fields on your report. For example, if I were grouping on a person's last name and I want 3 groups based on the first letter: A-G, H-P, Q-Z. I would want to keep it contained in one table.RS also has a concept of groups, and the construction of groups is very flexible. Groups are usedion DataRegion, such as Table, Matrix and Lists. Groups can be be grouped, filtered, sorted using multiple expressions. These expression can be just a field value, or they can be more complex.

In your case, you could create a group that uses an expression to return 1 if the value starts with A-G, return 2 if the value starts with H-P, and so on. The expression would look something like this, it assumes only upper case ASCII characters.

=Switch("ABCDEFGH".Contains(Fields!Name.Value.Substring(0,1)), 1, "IJKLMNOP".Contains(Fields!Name.Value.Substring(0,1)), 2, "QRSTUVWXYZ".Contains(Fields!Name.Value.Substring(0,1)), 3)

or

(use 64 since Choose uses the 1-based index into the array)

=Choose(Convert.ToInt32(Fields!Name.Value.Chars(0)) - 64, {1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3})

If you want something a little cleaner, then I would use a custom function that takes the first character as an argument and determines the appropriate value using regular control statements.|||

Thanks Ian!

Instead of editing the report, I decided to just add a field to my SQL statement to group on. It looks something like this:

select case
when left(lname,1) between 'a' and 'h' then 'A-H'
when left(lname,1) between 'i' and 'p' then 'I-P'
when left(lname,1) between 'q' and 'z' then 'Q-Z'
end as NameType from employee

I then created a group on the NameType field.

This worked great and my group headers were named properly as well.

|||I am trying something similar, but for some reason it does not like the syntax near AS. I see that it creates field called "NameType"...but does 'Employee' refer to the table the lname is coming from?|||Yes, the 'AS NameType' clause specifies the name for the result of the case statement, and 'lname' is a field in the 'Employee' table.

What is your query? Can you post it? I'm happy to take a look at it and see if there is something I can spot that would result in the syntax error.

Ian

Custom Groups

I'm wondering if there is any way in RS to create what Crystal reports calls Custom or Named Groups. This functionality allows you to define groups based on the values found in one of the fields on your report. For example, if I were grouping on a person's last name and I want 3 groups based on the first letter: A-G, H-P, Q-Z. I would want to keep it contained in one table.RS also has a concept of groups, and the construction of groups is very flexible. Groups are usedion DataRegion, such as Table, Matrix and Lists. Groups can be be grouped, filtered, sorted using multiple expressions. These expression can be just a field value, or they can be more complex.

In your case, you could create a group that uses an expression to return 1 if the value starts with A-G, return 2 if the value starts with H-P, and so on. The expression would look something like this, it assumes only upper case ASCII characters.

=Switch("ABCDEFGH".Contains(Fields!Name.Value.Substring(0,1)), 1, "IJKLMNOP".Contains(Fields!Name.Value.Substring(0,1)), 2, "QRSTUVWXYZ".Contains(Fields!Name.Value.Substring(0,1)), 3)

or

(use 64 since Choose uses the 1-based index into the array)

=Choose(Convert.ToInt32(Fields!Name.Value.Chars(0)) - 64, {1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3})

If you want something a little cleaner, then I would use a custom function that takes the first character as an argument and determines the appropriate value using regular control statements.|||

Thanks Ian!

Instead of editing the report, I decided to just add a field to my SQL statement to group on. It looks something like this:

select case
when left(lname,1) between 'a' and 'h' then 'A-H'
when left(lname,1) between 'i' and 'p' then 'I-P'
when left(lname,1) between 'q' and 'z' then 'Q-Z'
end as NameType from employee

I then created a group on the NameType field.

This worked great and my group headers were named properly as well.

|||I am trying something similar, but for some reason it does not like the syntax near AS. I see that it creates field called "NameType"...but does 'Employee' refer to the table the lname is coming from?|||Yes, the 'AS NameType' clause specifies the name for the result of the case statement, and 'lname' is a field in the 'Employee' table.

What is your query? Can you post it? I'm happy to take a look at it and see if there is something I can spot that would result in the syntax error.

Ian

custom formulas

im moving over from a crystal background, in crystal i was able to create custom formulaes and use them somewhere in the report, can this be done in RS, if so how?

thanks

Jonny

Hi Jonny

This can definitely be done.
On the report layout view, right click on the top right hand corner of the report (where there is the little black square) and select 'Properties'. Then click on the Code tab. You can write any functions you need there.
To call the function from an expression you just type
= Code.MyFunction(Param1,Param2)

Cheers
Mark

Saturday, February 25, 2012

custom count within group crystal XI

Hi,

I need to count number of consequtive weeks within a group:

Group_name consequtive: 2
person1 7/5/07
person2 7/19/07
person3 7/26/07


Consequtive is equal to 2 within this group, since person 2 and 3 are 1 week apart.

anybody know how to code this in CR XI?

thx in advanceUse the DateDiff function. If the DateDiff (w) of the previous week to this week = 1, then increment a running total by 1.