Sunday, March 11, 2012
Custom Page Size
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
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
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
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 JonnyThis 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
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.