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

Thursday, March 22, 2012

Distinct Count issue in Crystal Reports

Hi there,

I'm having a problem with a pretty easy formula which is suppose to just Distinct Count some ID's for a specific period of time:
Each parameter in the formula represents a field in the database, formula bellow should return 3 records... but it returns 7. If I take out the date conditions (so only DistinctCount remains) (7) records will be returned.

If {@.M_Startdate} <= {@.ClientRefDate} and {@.ClientRefDate} <= {@.M_EndDate} Then DistinctCount({@.UniqueRefID})

I also tried to put is in a different way (which express the same thing);
If {@.ClientRefDate} in [{@.M_Startdate} to {@.M_EndDate}] Then DistinctCount({@.UniqueRefID})

It looks like a date validation is performed when I reverse the <= with >=; Formula bellow returns (0) records, if I remove any date condition (7) records are returned.
If {@.M_Startdate} >= {@.ClientRefDate} and {@.ClientRefDate} <= {@.M_EndDate} Then DistinctCount({@.UniqueRefID})

Using WhilePrintingRecords; right at the top does not help I tried already. Also adding a date validation on the main query of the report does not help because whole data will be affected.
Any suggestions?

Thanks,

RobertHi Robert,
Firstly, I see a potential problem here, straight up. Evaluation order of the formulae. You will get inconsistent/unreliable evaluation in formulae that use other formulae if you don't use the EvaluateAfter statement.

If {@.M_Startdate} <= {@.ClientRefDate} and {@.ClientRefDate} <= {@.M_EndDate} Then DistinctCount({@.UniqueRefID})

try this
EvaluateAfter ({@.M_Startdate}
EvaluateAfter ({@.ClientRefDate})
EvaluateAfter ({@.M_EndDate})
EvaluateAfter ({@.UniqueRefID})

If {@.M_Startdate} <= {@.ClientRefDate} and {@.ClientRefDate} <= {@.M_EndDate} Then DistinctCount({@.UniqueRefID})

That way, you are forcing this formula to evaluate the others first.
This may be why the different statements return different results.

Secondly, you are using formulae to provide what I presume are references to data fields (like @.UniqueRefID). I presume there is a pressing reason to do it this way rather than just referencing the underlying data field itself? Going to the underlying data without using a formula is always going to be quicker, and more reliable, as it removes the formulae........

Dave|||Hi Robert,
Firstly, I see a potential problem here, straight up. Evaluation order of the formulae. You will get inconsistent/unreliable evaluation in formulae that use other formulae if you don't use the EvaluateAfter statement.

try this
EvaluateAfter ({@.M_Startdate}
EvaluateAfter ({@.ClientRefDate})
EvaluateAfter ({@.M_EndDate})
EvaluateAfter ({@.UniqueRefID})

If {@.M_Startdate} <= {@.ClientRefDate} and {@.ClientRefDate} <= {@.M_EndDate} Then DistinctCount({@.UniqueRefID})

That way, you are forcing this formula to evaluate the others first.
This may be why the different statements return different results.

Secondly, you are using formulae to provide what I presume are references to data fields (like @.UniqueRefID). I presume there is a pressing reason to do it this way rather than just referencing the underlying data field itself? Going to the underlying data without using a formula is always going to be quicker, and more reliable, as it removes the formulae........

Dave

Hi Dave,

Referencing fields from the database can be quicker sometimes but in this case I'm pressed to use parameters for different calculations. I tried qwith "direct" database fields, result is the same.

Using:
EvaluateAfter ({@.M_Startdate}
EvaluateAfter ({@.ClientRefDate})
EvaluateAfter ({@.M_EndDate})
EvaluateAfter ({@.UniqueRefID})

If {@.M_Startdate} <= {@.ClientRefDate} and {@.ClientRefDate} <= {@.M_EndDate} Then DistinctCount({@.UniqueRefID})
would have to work but unfortunately same result is returned.

Second pass functions require data from more than one record and in this case(WhilePrintingRecords) should evaluate params first... but it does not.

I'll keep trying,

Thanks a bunch,

Robert

Monday, March 19, 2012

Displaying Top N subtotal as well as grand total

I am currently migrating Crystal Report XI reports over to the
Reporting Services and came across a problem.
The Crystal Report displays Top N records, subtotal of these Top N
records, and the grand total of all the records. SQL stored procedure
underneath returns all the records.
>From what I have been reading in online groups and helps, these types
of features are not directly supported in the Reporting Services. The
workaround I have found so far involves returning two sets of results
("Top N" results and "All" results) and combining the two result
sets.
Since some query takes up significant amount of time, I would like to
avoid calling the stored procedures twice if necessary. Does anyone
know how I can avoid this and work with just one result set?
Thanks in advance.
ShoheiBring all the records and use filter "Top N" to filter for Top N records only.
Amarnath [MVP]
"Shohei.Yamauchi@.gmail.com" wrote:
> I am currently migrating Crystal Report XI reports over to the
> Reporting Services and came across a problem.
> The Crystal Report displays Top N records, subtotal of these Top N
> records, and the grand total of all the records. SQL stored procedure
> underneath returns all the records.
> >From what I have been reading in online groups and helps, these types
> of features are not directly supported in the Reporting Services. The
> workaround I have found so far involves returning two sets of results
> ("Top N" results and "All" results) and combining the two result
> sets.
> Since some query takes up significant amount of time, I would like to
> avoid calling the stored procedures twice if necessary. Does anyone
> know how I can avoid this and work with just one result set?
> Thanks in advance.
> Shohei
>|||If you are using SQL Server 2005, you can use ROW_NUMBER () in a Data
set so that you can get top N

Displaying the Top N records count

Hi,
I am using crystal reports 10.0. I am generating a report in which I have to show only the top 5 records(depending on the count) out of a large number of records. I achieved displaying top 5 records by selecting the Group sort expert from Record menu. But, the problem is that the individual column totals which is generated by CR 10.0 is still of the total records and not that of the 5 records which are displayed. Please help me show the total of the displayed records only.
Thanks and Regards,
Raj

The report looks something like this:

Policy Name Accepted Expired Total
Test1 2 3 5
Test2 2 3 5
Test3 2 3 5
Test4 2 3 5
Test5 2 3 5
-----------------
Total 20 30 50
------------------

U can see that the total shown is wrong since it is showing the total of all the records. I want the total row to be as:

Total 10 15 25

I dont think writing a formula as sum(Accepted) would help as i have tried it and its giving the same total.

Please give me the solution as soon as possibleOriginally posted by rajdotme
Hi,
I am using crystal reports 10.0. I am generating a report in which I have to show only the top 5 records(depending on the count) out of a large number of records. I achieved displaying top 5 records by selecting the Group sort expert from Record menu. But, the problem is that the individual column totals which is generated by CR 10.0 is still of the total records and not that of the 5 records which are displayed. Please help me show the total of the displayed records only.
Thanks and Regards,
Raj

The report looks something like this:

Policy Name Accepted Expired Total
Test1 2 3 5
Test2 2 3 5
Test3 2 3 5
Test4 2 3 5
Test5 2 3 5
-----------------
Total 20 30 50
------------------

U can see that the total shown is wrong since it is showing the total of all the records. I want the total row to be as:

Total 10 15 25

I dont think writing a formula as sum(Accepted) would help as i have tried it and its giving the same total.

Please give me the solution as soon as possible

Hi,

Validate in Detail Format Section using with "RecordNumber" value is <= 5 (variable value).

yours friendly,
K.Babu|||Hi,
Thanks for the Reply. Could u please tell me the exact location where to change. I still couldnt find it.

Thanks and Regards,
Raj|||Hi rajdotme,
Use the formulae given below

Formula1 {@.Reset}
whileprintingrecords;
NumberVar x:=0;
NumberVar y:=0;
NumberVar z:=0;

Formula2 {@.Accepted}
whileprintingrecords;
Numbervar x:=x+{Table.Accepted}

Formula3 {@.Rejected}
whileprintingrecords;
Numbervar y:=y+{Table.Rejected}

Formula4 {@.Total}
whileprintingrecords;
Numbervar z:=z+{Table.Total}

Now, Place Formula1 in the group header and suppress it
Place other formulae in the group footer

Madhivanan

Displaying Report in Multicolor

In a table i'm having numbers from 1 to 10 , in crystal i want to show no. 1 to 5 in different color and from 5 to 6 in different color . Cna i do this in Segate Crystal Report ?? Pls help me...You can do a Conditional Format. You enter a formula to determine what color the field should be.

For example, in CR 8.5 using RDC... Right-click on the field you want colored, click Format, on the Border Tab, click the 'x-2' button and type in your formula (ex. {Field1} = 5), choose the color from the dropdown menu... Maybe you could use a Case Statement to select multiple colors?

Sunday, March 11, 2012

Displaying Picture In Crystal Report

I want to display picture of customers in crystal reports.

For that purpose I have created table customer.

When new custiomer comes to me I take their picture using PC camera and save that picture in one of the folders.

At the same time I am sending path of that picture to database.

Now when I display record of customer in Crystal report. I want to diaplay their pictures tooo.

Can you help me??Place the OLE Object -> Bitmap Image on the report and right click the OLE Object ->Format Graphics -> Picture Tab and Graphic Location enter the path which is stored in the database in the formula. This will show the image in runtime.

Keep this in mind this functionality is available after Crystal Reports 10.

In the earlier versions you have to store the image as BLOB in the database and then show that field on the report.

Displaying Number Format As Per The Regional Settings in Crystal Report

Sir,
I am Using Crystal report 10.
How to Display The Number Format as like The Regional Setting in The computer.
After Changing The Regional Settings, I Changed The Number Format to The System Default Format...But It is Not Working...
Plz Help meHi There,
Can you please let me know if you found solution to this problem? We have the same problem in our reports. We cannot use formula fields as we have close to 60 reports and converts all fields to formula fields would not be possible.
Thanks in advance

displaying more then one record from the same table in the same field

I was wondering if there was any way to make crystal reports grab multiple records from the same table and displahy them in one database field. Basicly I have a table that users would type info into each line of text that they type would equal one record on the table. When I run the report I need to display all the lines of text that they typed in. If I just refrence the table in the database field in crystal it will only pull the first record from the table and thats it.

Here is an example of the table
00000101 0001 This is a tes of the emergency broadcast system, if there was an actual emergency you would hear
00000101 0002 about it after the tones.This is a tes of the emergency broadcast system, if there was an actual
00000101 0003 emergency you would here about it after the tones.This is a tes of the emergency broadcast system

Now if I run the report the only thing it will dislay is the first line (record number "0001")

Thanks for any helpAdd a Textbox to your report. Then drag the first DB Field into the textbox, then drag the second DB Field into the same textbox.

I attached a picture of an Address field from one of my reports. It's a textbox and I dropped the 5 DB fields onto it (Name, Address, City, State, Zip)

Friday, March 9, 2012

Displaying image from db in crystal report

hello there

I am using VB.Net 2003 with oracle 9i. My table contains a BLOB field that contains images. I tried to create a report (crystal report that is packed with VB.Net 2003) by including the table and dragging the BLOB field onto the report. But when i try to run the report, it gives me "Failed to open a rowset" error. If i run the report without the BLOB field, the report works fine.

Any idea?!?!

Thanks in advance
AndyHow did you store the images in the table?
Sounds that some images are corrupted
Visist this site and see if you find solution
www.businessobjects.com

Saturday, February 25, 2012

Displaying A Date Prompt (Range) In Page Header

I inserted a date prompt (range) into a "Page Header" of a "Crystal Reports", but when I refreshed the report, the date prompt did not display in the "Page Header". What am I doing wrong ?Never mind, I found a solution. Below is the solution . . .

"From: " + ToText ( Minimum ( {?Prompt_Date} ) ) +
" To: " + ToText ( Maximum ( {?Prompt_Date} ) )

display vocuher report twice with same data on CR 8.5

Hello ,
I need to display a voucher report twice in crystal reports 8.5 . I DONT want to print them on printer but display the same report twice with exactly the same data only with the 'COPY' printed in the 2nd voucher in crystal report.

Pls tell me how to write the formula n in which section.I am new to crystal reports n dont know how to write formulas in such a situation!
Pls help me

I get the following result set from my Stored Proc attached to report.
51 XML Markup Language Active 128 Copy
53 Team-Woodbury Audit Active 128 Copy
55 Team 4 Beebe's Team Active 128 Copy
56 Team 5 Bill's Team Active 128 Copy
51 XML Markup Language Active 128 Original
53 Team-Woodbury Audit Active 128 Original
55 Team 4 Beebe's Team Active 128 Original
56 Team 5 Bill's Team Active 128 Originali want to print twice in single page

Sunday, February 19, 2012

display records row wise

hello

I am facing a problem in the crystal reports 8.5

In the database table one column is date ,
so here in my report i want to display the records in such a way that
the for every date there should be one colum like for 31 days there should the date in all 31 day

for example please refer the attachment

or see below the requirement is

in my example the records with the days like 21,22
which is diplaying in next to row of the 21 day but i want to show in the same row i.e side by side not in the next row

please any query please pass it so that i can explain you in more detail
urgentplz any one help me|||Maybe you can do this with a crosstab - no idea as I've never used them.
So, although there may be better ways the one I instantly thought of is:

Assuming you are grouping by month:
Create/initialise an array of 31 elements in the group header.
For each detail, add the value into the appropriate array element.
Display each element in its appropriate position in the footer, under its day number.

For completeness you could also suppress any day number heading if > number of days in the month.|||thanks for reply

But i had created with standard report.

but one more issue in this if i take in footer it will display only one record

how can i resolve this|||Don't know what you mean by "But i had created with standard report."

Anyway, if I understand correctly what you really want is for each detail line to be printed but for the 'RT' etc. values to be under the correct day number heading.
Maybe you could left-pad the 'RT' string with a number of spaces dependent on the day number, e.g.

ReplicateString (' ', ({day}-1) * n ) + {table.column}

where n makes the 'RT' text line up underneath the day number heading for any given day number assuming you have n characters between the start of each day number.
(Best to use Courier font or similar, rather than Ariel...)|||Dont use standard report. Use Cross tab option. See help file for more information

Display picture in crystal report

i have a picture field in an ms access database and i have problem displaying the picture in crystal report. it shows the name of the file in the field instead of the picture itself.Did you store only filepath or the image itself?
If it is file path then it wont work. You need to save the image itself to the table

Display of reports on browser with Custom Assembly

Hi friends,

We are using SQL Server Reportin Services 2005 (SSRS) for development of our reports instead of Crystal Reports. As per our clients requirement we want to make all reports dynamic eg. whatever background color user select should appear for that report etc etc.

So for this we have written one function and created DLL for that. Now we are refering that DLL in all our reports as Assembly Name in Reports \ Report Properties \ Referance. We have stored that DLL at two different locations also

C:\Program Files \Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

so when we run our reports from Preview tab DLL is just wroking fine.

But when we deploy all our report on Brwoser and when we try to execute them from browser DLL is now working i.e no function value is working. only normal report without styleing is coming.

So can anyone help me out coz this is very argent

any help will be greatly appreciated

RTFM ;)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_rdl_6d0i.asp

especially:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_rdl_0so6.asp

I gave my custom assembly FullTrust:

<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="MyNewCodeGroup"
Description="A special code group for my custom assembly.">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\MyAssembly.dll"/>
</CodeGroup>

Display of Parameters

Hi,
I need to develop 2 reports using Crystal Reports 11. Both the reports are very similar except that one accepts 2 parameters & the other accepts only one parameter & hence their selection criteria would differ accordingly. I was wanting to know if I could merge both the reports into one, such that I use a third parameter which is boolean & asks which kind of report the user wants to see. Based on the boolean value the report needs to display either 1 parameter or both the parameters. Is this possible in crystal reports ? If not, what is the other best way I could do this ? Please suggest.Hi
Yes ur approch is right, u can do that. Make a single report and accept 3 parameters. based on parameter 1 filter ur report data in a if else condition in record selection formula.|||u can create any report based on different parameters at runtime. of course that means u have to code it in a more generic way... I have done this, bt its in vc++. I suggest u look into the sample code if u want it in vb...its not that hard...
ps: sample code is in ur crytl installed folder.|||Thanks for the responses. If i try using a 3rd parameter method, I have a problem. That is, I can filter the records perfectly fine, however when the parameter window shows up it shows all the parameters in it, the one's that the first report would use & the ones that the second report would also use. I dont want that. Based on the value of the boolean parameter, it should show the corresponding parameters for the first report & accordingly for the second. how do i achieve this ? I'm using only crystal reports....|||Thanks for the responses. If i try using a 3rd parameter method, I have a problem. That is, I can filter the records perfectly fine, however when the parameter window shows up it shows all the parameters in it, the one's that the first report would use & the ones that the second report would also use. I dont want that. Based on the value of the boolean parameter, it should show the corresponding parameters for the first report & accordingly for the second. how do i achieve this ? I'm using only crystal reports....

Hi
If u r not using any front end then u can use two seperate sub reports (on demand sub report) in main report. so number of reports are increased now.

Friday, February 17, 2012

Display multiple reports

Does anyone know if there is a way to display multiple reports in one Crystal Report Viewer?
I'm using the Crystal Reports that are bundled with Microsoft Visual Basic .NET (2003).
Thank you,
Sandiyou can do with the help of subreports
Open the report and add other report as Subreport

Display image in Crystal Report 10

I have to generate a report containing data and images in the database, e.g. product information + product image (kept as "image" type in MSSQL database). The information and images are kept in one table named "ProductInfo". The no. of images may vary depending on user input, e.g. on-shelf date. The expected output of the report is similar to below:

<<image1>>
Item: ABC Shampoo
Product No.: 1111

<<image2>>
Item: XXX Toothpaste
Product No.: 2222

<<image3>>
Item: YYY Shaver
Product No.: 3333

User will input the date range in a VB form and a Crystal Report Preview will show the output. I am currently using VB.NET 2003, Crystal Report 10, MSSQL 2000. Would you please help? Thanks very much.

Regards,Store image path in database field, then use picture box in detail section to display pictures.

U can use graphic location property in format editor of picture box...

Tuesday, February 14, 2012

Display groups in seperate pages

Hi all
I am working on Crystal reports 8.5
I have 4 groups,need to display every group in seperate pages
Could any one pls help meright click on the report and select the "section expert" option. In this, you select your group header and on the right side tick the "new page after" option. Click on the corresponding button for the option and enter "Not OnFirstRecord".|||Thank you
it works fine

display fields vertically and horizontally

hello, i just started using crystal reports and have been trying to get the report to display the same fields as shown below.

2006/02/11 2005/11/09 2006/01/01
James john sandy

2003/08/16 2007/01/22 2006/01/01
Jane fred martha

2004/12/10 2005/05/03 2006/07/03
phil diane roger

The data is all come from the same fields (Start_Date) and (first_name) .

is it possible to display the data as such using crystal reports?

regards,

peter.Try this.
Place first field in the details section. In section expert check the box "Format with multiple columns". Set your options on layout tab.

Next, right click on details section and select "Insert section below". Place your second field in this section. Repeat the steps from above ("format with multiple columns", etc).

Hope this helps.

Display empty rows

I am creating some reports with crystal reports 8.5

I made crosstabs listing the sales of certain products by store and month.

The stores are listed in the rows, products and months are in the columns. In the complete yearly reports everything is fine, because there are no empty rows.

When i create subreports for just a certain month or product, there might be empty rows, like, there might have been no sales of that particular product, in that store in that month. Instead of just displaying a row with the store name and Zero value, it just doesn`t show the row at all.

I need those empty rows to show and display zero values. The option "suppress empty rows" is not checked.

Any ideas ?

Example
...............January 2007
...............Product 1
Store1......0 <- this row is not displayed
Store2......6
Store3......24You'll need an outer join somewhere, rather than an inner join - read the help on join types, or describe your current tables and joins.|||I am just beginning in crystal but I did have the same issue but my training yesterday was about table joints.
You have to have your primary table as your "source" table where you have most of your data. When you link your secondary table, go to link options and you need to have the linking as "left join or outter join ...not Equal". Even though you have no value on that one record, it will show it with an empty cell or box but you will see everything else from that record. I still wouldn't know how to display the zero.